mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-24 21:40:48 +02:00
Co-authored-by: Fabian-Lars <github@fabianlars.de>
This commit is contained in:
co-authored by
Fabian-Lars
parent
125ec1dbcf
commit
5b82118158
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"opener": patch
|
||||||
|
"opener-js": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix broken JS commands `opener.openPath` and `opener.openUrl` on mobile.
|
||||||
@@ -9,7 +9,7 @@ use tauri::{
|
|||||||
AppHandle, Runtime,
|
AppHandle, Runtime,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{scope::Scope, Error};
|
use crate::{scope::Scope, Error, OpenerExt};
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub async fn open_url<R: Runtime>(
|
pub async fn open_url<R: Runtime>(
|
||||||
@@ -34,7 +34,7 @@ pub async fn open_url<R: Runtime>(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if scope.is_url_allowed(&url, with.as_deref()) {
|
if scope.is_url_allowed(&url, with.as_deref()) {
|
||||||
crate::open_url(url, with)
|
app.opener().open_url(url, with)
|
||||||
} else {
|
} else {
|
||||||
Err(Error::ForbiddenUrl { url, with })
|
Err(Error::ForbiddenUrl { url, with })
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ pub async fn open_path<R: Runtime>(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if scope.is_path_allowed(Path::new(&path), with.as_deref())? {
|
if scope.is_path_allowed(Path::new(&path), with.as_deref())? {
|
||||||
crate::open_path(path, with)
|
app.opener().open_path(path, with)
|
||||||
} else {
|
} else {
|
||||||
Err(Error::ForbiddenPath { path, with })
|
Err(Error::ForbiddenPath { path, with })
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user