Skip to content

Commit 3d0d2e0

Browse files
authored
fix(opener): ignore inAppBrowser on desktop (#3163)
1 parent 1e3d7ef commit 3d0d2e0

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
opener: patch
3+
opener-js: patch
4+
---
5+
6+
Properly ignore `with: inAppBrowser` on desktop. This prevents an issue were `open_url` seamingly did nothing on desktop.

plugins/opener/src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ impl<R: Runtime> Opener<R> {
5858
/// - **Android / iOS**: Always opens using default program, unless `with` is provided as "inAppBrowser".
5959
#[cfg(desktop)]
6060
pub fn open_url(&self, url: impl Into<String>, with: Option<impl Into<String>>) -> Result<()> {
61-
crate::open::open(url.into(), with.map(Into::into))
61+
crate::open::open(
62+
url.into(),
63+
with.map(Into::into).filter(|with| with != "inAppBrowser"),
64+
)
6265
}
6366

6467
/// Open a url with a default or specific program.
@@ -113,7 +116,10 @@ impl<R: Runtime> Opener<R> {
113116
path: impl Into<String>,
114117
with: Option<impl Into<String>>,
115118
) -> Result<()> {
116-
crate::open::open(path.into(), with.map(Into::into))
119+
crate::open::open(
120+
path.into(),
121+
with.map(Into::into).filter(|with| with != "inAppBrowser"),
122+
)
117123
}
118124

119125
/// Open a path with a default or specific program.

0 commit comments

Comments
 (0)