fix(opener): ignore inAppBrowser on desktop (#3163)

This commit is contained in:
Fabian-Lars
2025-12-16 11:07:15 +01:00
committed by GitHub
parent 1e3d7ef16e
commit 3d0d2e041b
2 changed files with 14 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
---
opener: patch
opener-js: patch
---
Properly ignore `with: inAppBrowser` on desktop. This prevents an issue were `open_url` seamingly did nothing on desktop.
+8 -2
View File
@@ -58,7 +58,10 @@ impl<R: Runtime> Opener<R> {
/// - **Android / iOS**: Always opens using default program, unless `with` is provided as "inAppBrowser".
#[cfg(desktop)]
pub fn open_url(&self, url: impl Into<String>, with: Option<impl Into<String>>) -> Result<()> {
crate::open::open(url.into(), with.map(Into::into))
crate::open::open(
url.into(),
with.map(Into::into).filter(|with| with != "inAppBrowser"),
)
}
/// Open a url with a default or specific program.
@@ -113,7 +116,10 @@ impl<R: Runtime> Opener<R> {
path: impl Into<String>,
with: Option<impl Into<String>>,
) -> Result<()> {
crate::open::open(path.into(), with.map(Into::into))
crate::open::open(
path.into(),
with.map(Into::into).filter(|with| with != "inAppBrowser"),
)
}
/// Open a path with a default or specific program.