new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Tauri · Plugins and security · all subjects

deep-link/api

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Deep Link JavaScript API - getCurrent and onOpenUrl

The deep-link plugin JavaScript API provides getCurrent() to detect if the app was opened via a deep link (returns URLs or null), and onOpenUrl(callback) to listen for deep link events. The getCurrent return value is updated each time onOpenUrl fires. Import from '@tauri-apps/plugin-deep-link' or access via window.__TAURI__.deepLink when using 'withGlobalTauri': true.

Deep Link JavaScript example - listening to deep links

Example code for JavaScript listening to deep links: import { getCurrent, onOpenUrl } from '@tauri-apps/plugin-deep-link'; const startUrls = await getCurrent(); if (startUrls) { // App was likely started via a deep link } await onOpenUrl((urls) => { console.log('deep link:', urls); });

Deep Link Rust API - get_current and on_open_url

The deep-link plugin Rust API provides app.deep_link().get_current() to detect if the app was opened via a deep link (returns Option<Vec<String>>), and app.deep_link().on_open_url(|event| {...}) to listen for deep link events. Access via the DeepLinkExt trait. The get_current return value is updated each time on_open_url fires.

Deep Link Rust example - listening to deep links

Example code for Rust listening to deep links: use tauri_plugin_deep_link::DeepLinkExt; #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { tauri::Builder::default() .plugin(tauri_plugin_deep_link::init()) .setup(|app| { let start_urls = app.deep_link().get_current()?; if let Some(urls) = start_urls { println!("deep link URLs: {:?}", urls); } app.deep_link().on_open_url(|event| { println!("deep link URLs: {:?}", event.urls()); }); Ok(()) }) .run(tauri::generate_context!()) .expect("error while running tauri application"); }

Deep Link URLs event format

The open URL event is triggered with a list of URLs for compatibility with the macOS API for deep links, but in most cases the app will only receive a single URL.

Give your agent this brain