feat: add tauri-plugin-opener (#2019)

This commit is contained in:
Amr Bashir
2024-11-20 00:50:02 +02:00
committed by GitHub
parent 1051db406a
commit 383e636a8e
61 changed files with 2346 additions and 7 deletions
+5
View File
@@ -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())