mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-24 17:20:51 +02:00
fix(opener): ignore inAppBrowser on desktop (#3163)
This commit is contained in:
@@ -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.
|
||||||
@@ -58,7 +58,10 @@ impl<R: Runtime> Opener<R> {
|
|||||||
/// - **Android / iOS**: Always opens using default program, unless `with` is provided as "inAppBrowser".
|
/// - **Android / iOS**: Always opens using default program, unless `with` is provided as "inAppBrowser".
|
||||||
#[cfg(desktop)]
|
#[cfg(desktop)]
|
||||||
pub fn open_url(&self, url: impl Into<String>, with: Option<impl Into<String>>) -> Result<()> {
|
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.
|
/// Open a url with a default or specific program.
|
||||||
@@ -113,7 +116,10 @@ impl<R: Runtime> Opener<R> {
|
|||||||
path: impl Into<String>,
|
path: impl Into<String>,
|
||||||
with: Option<impl Into<String>>,
|
with: Option<impl Into<String>>,
|
||||||
) -> Result<()> {
|
) -> 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.
|
/// Open a path with a default or specific program.
|
||||||
|
|||||||
Reference in New Issue
Block a user