From 3d0d2e041bbad9766aebecaeba291a28d8d7bf5c Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Tue, 16 Dec 2025 11:07:15 +0100 Subject: [PATCH] fix(opener): ignore inAppBrowser on desktop (#3163) --- .changes/opener-ignore-inappbrowser.md | 6 ++++++ plugins/opener/src/lib.rs | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .changes/opener-ignore-inappbrowser.md diff --git a/.changes/opener-ignore-inappbrowser.md b/.changes/opener-ignore-inappbrowser.md new file mode 100644 index 000000000..f56dc4c4e --- /dev/null +++ b/.changes/opener-ignore-inappbrowser.md @@ -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. diff --git a/plugins/opener/src/lib.rs b/plugins/opener/src/lib.rs index 343e91558..1a8b6f0cb 100644 --- a/plugins/opener/src/lib.rs +++ b/plugins/opener/src/lib.rs @@ -58,7 +58,10 @@ impl Opener { /// - **Android / iOS**: Always opens using default program, unless `with` is provided as "inAppBrowser". #[cfg(desktop)] pub fn open_url(&self, url: impl Into, with: Option>) -> 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 Opener { path: impl Into, with: Option>, ) -> 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.