mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-08 16:07:50 +02:00
feat: add tauri-plugin-opener (#2019)
This commit is contained in:
@@ -26,6 +26,8 @@ use tauri::{
|
||||
mod commands;
|
||||
mod config;
|
||||
mod error;
|
||||
#[deprecated(since = "2.1.0", note = "Use tauri-plugin-opener instead.")]
|
||||
#[allow(deprecated)]
|
||||
pub mod open;
|
||||
pub mod process;
|
||||
mod scope;
|
||||
@@ -70,6 +72,8 @@ impl<R: Runtime> Shell<R> {
|
||||
///
|
||||
/// See [`crate::open::open`] for how it handles security-related measures.
|
||||
#[cfg(desktop)]
|
||||
#[deprecated(since = "2.1.0", note = "Use tauri-plugin-opener instead.")]
|
||||
#[allow(deprecated)]
|
||||
pub fn open(&self, path: impl Into<String>, with: Option<open::Program>) -> Result<()> {
|
||||
open::open(&self.open_scope, path.into(), with).map_err(Into::into)
|
||||
}
|
||||
@@ -78,6 +82,7 @@ impl<R: Runtime> Shell<R> {
|
||||
///
|
||||
/// See [`crate::open::open`] for how it handles security-related measures.
|
||||
#[cfg(mobile)]
|
||||
#[deprecated(since = "2.1.0", note = "Use tauri-plugin-opener instead.")]
|
||||
pub fn open(&self, path: impl Into<String>, _with: Option<open::Program>) -> Result<()> {
|
||||
self.mobile_plugin_handle
|
||||
.run_mobile_plugin("open", path.into())
|
||||
|
||||
Reference in New Issue
Block a user