mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-08 14:03:53 +02:00
feat(deep-link): implement getCurrent on Windows/Linux (#1759)
* feat(deep-link): implement getCurrent on Windows/Linux checks std::env::args() on initialization, also includes integration with the single-instance plugin * fmt * update docs, fix event * add register_all function * expose api * be nicer on docs, clippy
This commit is contained in:
committed by
GitHub
parent
77680f6ed8
commit
64a6240f79
@@ -13,6 +13,9 @@ fn greet(name: &str) -> String {
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_single_instance::init(|_app, argv, _cwd| {
|
||||
println!("single instance triggered: {argv:?}");
|
||||
}))
|
||||
.plugin(tauri_plugin_deep_link::init())
|
||||
.plugin(
|
||||
tauri_plugin_log::Builder::default()
|
||||
@@ -20,6 +23,16 @@ pub fn run() {
|
||||
.build(),
|
||||
)
|
||||
.setup(|app| {
|
||||
// ensure deep links are registered on the system
|
||||
// this is useful because AppImages requires additional setup to be available in the system
|
||||
// and calling register() makes the deep links immediately available - without any user input
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
use tauri_plugin_deep_link::DeepLinkExt;
|
||||
|
||||
app.deep_link().register_all()?;
|
||||
}
|
||||
|
||||
app.listen("deep-link://new-url", |url| {
|
||||
dbg!(url);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user