From e7e1d86e85a2e0da3c3dddd689d0b7234e87027d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Andr=C3=A9?= Date: Thu, 5 Nov 2026 16:16:58 +0100 Subject: [PATCH 01/45] refactor(tauri): share embedded native view lifecycle Extract owner-fenced child creation, physical bounds, visibility, closure, preview storage and mandatory browser protections into a shared EmbeddedViews registry and Windows adapter. Keep session registrations, events, history, emulation and page leases in BrowserController; macOS and Linux continue using their existing fallback. Register each child before native construction, deny reserved labels without records, and keep navigation refusals ahead of external opening. Create neutral children off-canvas and hidden before security setup, fence concurrent replacements and failed creations by exact identity, clean pending children on renderer reload, and revoke page leases before native hide attempts. Expose the common registry as application state and document adoption by remote project tabs. Validate on Windows with isolated worktree dependencies: dev:prep, cargo check --locked, 22 browser-controller tests, all 312 Rust tests, UI typecheck, 4 native-adapter tests and 29 browser-frame/session-history tests. Preserve the actual Tauri ACL resolution regression and add owner, missing-record, rollback, replacement, reload and failed-hide authority coverage. --- dev-docs/BROWSER_AUTOMATION.md | 12 +- .../src-tauri/src/browser_controller.rs | 272 +++++++------- .../src/browser_controller_regressions.rs | 72 +++- .../tauri-app/src-tauri/src/embedded_view.rs | 337 ++++++++++++++++++ .../src-tauri/src/embedded_view/windows.rs | 31 ++ .../src-tauri/src/embedded_view_tests.rs | 204 +++++++++++ packages/tauri-app/src-tauri/src/main.rs | 14 +- 7 files changed, 802 insertions(+), 140 deletions(-) create mode 100644 packages/tauri-app/src-tauri/src/embedded_view.rs create mode 100644 packages/tauri-app/src-tauri/src/embedded_view/windows.rs create mode 100644 packages/tauri-app/src-tauri/src/embedded_view_tests.rs diff --git a/dev-docs/BROWSER_AUTOMATION.md b/dev-docs/BROWSER_AUTOMATION.md index aa0b912090..8164d4ff02 100644 --- a/dev-docs/BROWSER_AUTOMATION.md +++ b/dev-docs/BROWSER_AUTOMATION.md @@ -79,7 +79,15 @@ Native/HTTP deadlines bound browser tool execution; the tool context's `signal` Electron uses hardened `` tabs sharing one persistent browser partition (`persist:codenomad-browser-shared-v1`) per data profile/config pair. Attachment verifies guest ownership, allows only credential-free HTTP(S) URLs and denies permissions and downloads; page operations use the guarded channel above. -Windows Tauri uses a child webview owned by the local application window. Commands, capabilities, navigation checks, bounds, visibility, and storage are managed by `browser_controller.rs`. Application capabilities select primary `local-*` webviews, never their parent-window wildcard: Tauri combines window/webview matching with OR, so a window grant would also authorize an untrusted child. Full primary-renderer navigation disposes its preview children. Final-window decisions count native windows, including multi-webview windows. Other Tauri platforms use the iframe preview, without native browser automation. +Windows Tauri uses a child webview owned by the local application window. `embedded_view.rs` owns native creation, geometry, visibility, closure, shared storage paths and mandatory navigation/download/new-window protections; its Windows adapter installs permission denial and native accelerators. `browser_controller.rs` owns session registrations, renderer generations, history, events, emulation and automation leases. Application capabilities select primary `local-*` webviews, never their parent-window wildcard: Tauri combines window/webview matching with OR, so a window grant would also authorize an untrusted child. Full primary-renderer navigation disposes its preview children. Final-window decisions count native windows, including multi-webview windows. Other Tauri platforms use the iframe preview, without native browser automation. + +### Tauri embedded-view contract + +- Consumers choose a unique native label for each creation, including replacements, and a persistent storage directory separate from the application renderer. Preview storage is `browser/shared-v1` inside the scoped profile. The common registry binds each child to a validated local-window owner before native construction. Every bounds, visibility and close operation rechecks ownership; native calls run outside registry locks. +- Creation uses an off-canvas neutral document, hides the child, installs mandatory protections and applies physical bounds while hidden. Creation failures remove only their exact reservation and close the created child. Consumers install business page-load hooks and may further restrict navigation; the common credential-free HTTP(S), new-window and download guards remain mandatory. `about:blank` is accepted only while preparing the neutral child. +- The host navigation interceptor consults the shared `EmbeddedViews` application state first. Reserved `browser-` and `remote-view-` labels with missing records are denied. A child decision returns immediately, before window-origin rules and external-link opening. +- The controller publishes its registration with renderer/generation fencing, navigates, then applies current visibility. Hiding revokes automation leases before native I/O, including when the native hide fails. Owner cleanup also invalidates children still being constructed; an old creation cannot publish after primary-renderer reload. +- Remote project tabs can adopt this layer by replacing direct child creation, geometry, visibility and closure with `EmbeddedViews`, using unique `remote-view-` labels and a server-profile storage directory. Keep origin/profile identity, project entry, login/pairing, titles, events and notifications in the remote consumer. Add its same-origin restriction to the mandatory URL policy, keep Entry/Help effects single-shot and allow only the approved help site to open externally. Qualify remote TLS exceptions and notification permissions separately. The UI routes an autonomous open request to the one loaded instance containing the session, claims the request for one local window, selects that session, and opens its preview. Hidden or duplicate targets are rejected rather than selected implicitly. @@ -88,7 +96,7 @@ The UI routes an autonomous open request to the one loaded instance containing t - Server: `automation-plugin.test.ts`, `automation/desktop-plugin.test.ts`, `routes/automation-plugin.test.ts`, and the shared pruning-presence regressions - Native discovery: build with `npm run build:automation --workspace @neuralnomads/codenomad`, then run `node scripts/test-automation-native.mjs `. The fixture uses an isolated daemon/config/database and exercises ordinary-project discovery, all tools at startup, execution fences, independent leases, shutdown and reopening. CI runs it against the minimum and latest OpenCode runtimes. - Electron: `browser-controller.test.ts`, `browser-webview-security.test.ts`, preload tests -- Tauri: `browser_controller.rs` and `browser_controller_regressions.rs` tests, including actual capability resolution, primary-renderer cleanup, window counting, lock ordering and expired dispatch +- Tauri: `embedded_view_tests.rs`, `browser_controller.rs` and `browser_controller_regressions.rs` tests, including ownership, fail-closed child policy, creation rollback, replacement fencing, actual capability resolution, primary-renderer cleanup, window counting, lock ordering and expired dispatch - UI: `browser-frame-security.test.ts`, `lib/native/browser.test.ts` and `tests/browser/browser-frame-native.test.ts` (real Solid/Electron guests, insecure HTTP, registration disposal and Tauri IPC failure recovery). Linux Electron rendering requires a display; CI runs the browser suite under Xvfb. - Session lifetime: `tests/browser/session-browser-history.test.ts` exercises the real instance shell/store, a real Electron guest and the Tauri IPC boundary across chat/session/project/Info transitions, the preview's X, retained Back history and project-wide URL migration. - Shared site state: the same suite tests real Electron HttpOnly-cookie/localStorage sharing, independent documents/history, app-profile isolation and shared logout; Rust regressions verify Tauri's common persistent browser directory. diff --git a/packages/tauri-app/src-tauri/src/browser_controller.rs b/packages/tauri-app/src-tauri/src/browser_controller.rs index fed3cd96f9..d4e8edd286 100644 --- a/packages/tauri-app/src-tauri/src/browser_controller.rs +++ b/packages/tauri-app/src-tauri/src/browser_controller.rs @@ -1,3 +1,6 @@ +use crate::embedded_view::{ + is_allowed_url, validate_bounds, Bounds as BrowserTargetBounds, EmbeddedViews, +}; use serde::Deserialize; use serde_json::{json, Value}; use std::collections::{HashMap, HashSet}; @@ -5,7 +8,9 @@ use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{Arc, Condvar, Mutex}; use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; use tauri::webview::PageLoadEvent; -use tauri::{AppHandle, Emitter, Manager, PhysicalPosition, PhysicalSize, Window}; +use tauri::{AppHandle, Emitter, Manager, Window}; +#[cfg(test)] +use tauri::{PhysicalPosition, PhysicalSize}; #[cfg(windows)] #[path = "browser_emulation.rs"] @@ -23,14 +28,6 @@ pub(crate) struct BrowserTargetRegistration { bounds: BrowserTargetBounds, } -#[derive(Clone, Copy, Debug, Deserialize)] -pub(crate) struct BrowserTargetBounds { - x: i32, - y: i32, - width: u32, - height: u32, -} - #[derive(Clone, Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub(crate) struct BrowserTargetUpdate { @@ -79,6 +76,7 @@ struct OpenClaim { struct Inner { emulation_profiles: HashMap, registrations: HashMap, + published_generations: HashMap, renderer_versions: HashMap, page_leases: HashMap, navigation_versions: HashMap, @@ -94,11 +92,12 @@ pub(crate) struct BrowserController { profile: Arc, registration_sequence: Arc, run_id: Arc, + pub(crate) embedded_views: EmbeddedViews, } impl BrowserController { fn storage_directory(&self) -> std::path::PathBuf { - self.profile.join("shared-v1") + crate::embedded_view::browser_storage(&self.profile) } pub(crate) fn new(profile: std::path::PathBuf) -> Self { @@ -108,6 +107,7 @@ impl BrowserController { profile: Arc::new(profile), registration_sequence: Arc::new(AtomicU64::new(1)), run_id: Arc::new(uuid::Uuid::new_v4().to_string()), + embedded_views: EmbeddedViews::default(), } } @@ -117,20 +117,15 @@ impl BrowserController { window: &Window, input: BrowserTargetRegistration, ) -> Result<(), String> { - use tauri::webview::{NewWindowResponse, WebviewBuilder}; - use tauri::WebviewUrl; - validate_id(&input.session_id, 256)?; validate_id(&input.registration_id, 128)?; let url = allowed_url(&input.url)?; - let blank = "about:blank" - .parse() - .map_err(|error| format!("failed to prepare browser preview: {error}"))?; validate_bounds(input.bounds)?; let renderer_version = self.renderer_version(window.label())?; - let label = format!("browser-{}", input.registration_id); let registration_id = input.registration_id.clone(); let generation = self.registration_sequence.fetch_add(1, Ordering::Relaxed); + // Native labels are unique across replacements, including in-flight creations. + let label = format!("browser-{}-{generation}", input.registration_id); let navigation_controller = self.clone(); let navigation_registration_id = registration_id.clone(); let policy_controller = self.clone(); @@ -138,19 +133,12 @@ impl BrowserController { // Every preview is a tab in the same browser profile. Its navigation // history and automation attachment remain owned by its session. let profile = self.storage_directory(); - let builder = WebviewBuilder::new(label.clone(), WebviewUrl::External(blank)) - .data_directory(profile) - .on_navigation(move |url| { - let allowed = url.as_str() == "about:blank" || is_allowed_url(url); - if allowed { - policy_controller - .invalidate_page_for_generation(&policy_registration_id, generation); - } - allowed - }) - .on_new_window(|_, _| NewWindowResponse::Deny) - .on_download(|_, _| false) - .on_page_load(move |webview, payload| { + let webview = self.embedded_views.create( + window, + &label, + profile, + input.bounds, + move |webview, payload| { if payload.event() == PageLoadEvent::Started && payload.url().as_str() != "about:blank" { @@ -161,16 +149,13 @@ impl BrowserController { json!({ "registrationId": registration_id, "url": payload.url().as_str() }), ); } - }); - let webview = window - .add_child( - builder, - PhysicalPosition::new(input.bounds.x, input.bounds.y), - PhysicalSize::new(input.bounds.width, input.bounds.height), - ) - .map_err(|error| format!("failed to create browser preview: {error}"))?; - #[cfg(windows)] - crate::windows_browser_accelerators::bind(&webview); + }, + move |_| { + policy_controller + .invalidate_page_for_generation(&policy_registration_id, generation); + true + }, + )?; if let Err(error) = install_webview2_handlers( &webview, self.clone(), @@ -178,19 +163,17 @@ impl BrowserController { window.label().to_string(), generation, ) { - let _ = webview.close(); + let _ = self + .embedded_views + .close(window.app_handle(), window.label(), &label); return Err(error); } - if let Err(error) = webview.show() { - let _ = webview.close(); - return Err(error.to_string()); - } let registration = Registration { session_id: input.session_id, registration_id: input.registration_id.clone(), window_label: window.label().to_string(), - webview_label: label, + webview_label: label.clone(), generation, visible: true, }; @@ -198,20 +181,53 @@ impl BrowserController { { Ok(previous) => previous, Err(error) => { - let _ = webview.close(); + let _ = self + .embedded_views + .close(window.app_handle(), window.label(), &label); return Err(error); } }; if let Some(previous) = previous { - if let Some(previous_webview) = window.app_handle().get_webview(&previous.webview_label) - { - let _ = previous_webview.close(); - } + let _ = self.embedded_views.close( + window.app_handle(), + &previous.window_label, + &previous.webview_label, + ); } if let Err(error) = webview.navigate(url) { - let _ = self.unregister(window.app_handle(), window.label(), &input.registration_id); + let _ = self.unregister_generation( + window.app_handle(), + window.label(), + &input.registration_id, + Some(generation), + ); return Err(error.to_string()); } + let current = self.owned_registration(window.label(), &input.registration_id); + match current { + Ok(current) if current.generation == generation => { + if let Err(error) = self.embedded_views.set_visible( + window.app_handle(), + window.label(), + &label, + current.visible, + ) { + let _ = self.unregister_generation( + window.app_handle(), + window.label(), + &input.registration_id, + Some(generation), + ); + return Err(error); + } + } + _ => { + let _ = self + .embedded_views + .close(window.app_handle(), window.label(), &label); + return Err("Browser target changed during creation".into()); + } + } Ok(()) } @@ -242,6 +258,26 @@ impl BrowserController { return Err("Browser preview renderer is no longer current".to_string()); } let id = registration.registration_id.clone(); + if inner + .registrations + .get(&id) + .is_some_and(|current| current.window_label != registration.window_label) + { + return Err("Browser target belongs to another window".into()); + } + if inner + .published_generations + .get(&id) + .is_some_and(|(_, generation)| *generation > registration.generation) + { + return Err("Browser target changed during creation".into()); + } + // Keep the high-water mark through unregister so an older in-flight + // creation cannot resurrect a replacement that has already been closed. + inner.published_generations.insert( + id.clone(), + (registration.window_label.clone(), registration.generation), + ); let previous = inner.registrations.insert(id.clone(), registration); inner .page_leases @@ -272,27 +308,30 @@ impl BrowserController { Err(unsupported()) } - pub(crate) fn update( + pub(crate) fn update( &self, - app: &AppHandle, + app: &AppHandle, window_label: &str, input: BrowserTargetUpdate, ) -> Result<(), String> { let registration = self.owned_registration(window_label, &input.registration_id)?; - let webview = app - .get_webview(®istration.webview_label) - .ok_or_else(|| "Browser preview is no longer available".to_string())?; let visible = input.visible.unwrap_or(true); if visible { let bounds = input .bounds .ok_or_else(|| "Visible browser target bounds are required".to_string())?; - validate_bounds(bounds)?; - webview - .set_position(PhysicalPosition::new(bounds.x, bounds.y)) - .and_then(|()| webview.set_size(PhysicalSize::new(bounds.width, bounds.height))) - .and_then(|()| webview.show()) - .map_err(|error| error.to_string())?; + self.embedded_views.set_bounds( + app, + window_label, + ®istration.webview_label, + bounds, + )?; + self.embedded_views.set_visible( + app, + window_label, + ®istration.webview_label, + true, + )?; } else { // Revoke authority before the native hide's UI-thread round trip. let mut inner = self.inner.0.lock().map_err(|error| error.to_string())?; @@ -306,7 +345,12 @@ impl BrowserController { .page_leases .retain(|_, lease| lease.registration.registration_id != input.registration_id); drop(inner); - webview.hide().map_err(|error| error.to_string())?; + self.embedded_views.set_visible( + app, + window_label, + ®istration.webview_label, + false, + )?; } let mut inner = self.inner.0.lock().map_err(|error| error.to_string())?; if let Some(current) = inner.registrations.get_mut(&input.registration_id) { @@ -389,6 +433,16 @@ impl BrowserController { app: &AppHandle, window_label: &str, registration_id: &str, + ) -> Result<(), String> { + self.unregister_generation(app, window_label, registration_id, None) + } + + fn unregister_generation( + &self, + app: &AppHandle, + window_label: &str, + registration_id: &str, + generation: Option, ) -> Result<(), String> { let (inner, ready) = &*self.inner; let mut inner = inner.lock().map_err(|error| error.to_string())?; @@ -398,6 +452,9 @@ impl BrowserController { if registration.window_label != window_label { return Err("Browser target belongs to another window".to_string()); } + if generation.is_some_and(|generation| generation != registration.generation) { + return Ok(()); + } let registration = inner.registrations.remove(registration_id).unwrap(); inner.emulation_profiles.remove(registration_id); inner @@ -407,9 +464,8 @@ impl BrowserController { inner.page_load_expectations.remove(registration_id); drop(inner); ready.notify_all(); - if let Some(webview) = app.get_webview(®istration.webview_label) { - webview.close().map_err(|error| error.to_string())?; - } + self.embedded_views + .close(app, window_label, ®istration.webview_label)?; Ok(()) } @@ -467,32 +523,30 @@ impl BrowserController { } pub(crate) fn remove_window(&self, app: &AppHandle, window_label: &str) { - let (labels, retries) = if let Ok(mut inner) = self.inner.0.lock() { + let retries = if let Ok(mut inner) = self.inner.0.lock() { let version = inner .renderer_versions .entry(window_label.to_string()) .or_default(); *version = version.wrapping_add(1); + inner + .published_generations + .retain(|_, (owner, _)| owner != window_label); let ids = inner .registrations .values() .filter(|registration| registration.window_label == window_label) .map(|registration| registration.registration_id.clone()) .collect::>(); - let labels = ids - .into_iter() - .filter_map(|id| { - inner - .page_leases - .retain(|_, lease| lease.registration.registration_id != id); - inner.navigation_versions.remove(&id); - inner.page_load_expectations.remove(&id); - inner - .registrations - .remove(&id) - .map(|item| item.webview_label) - }) - .collect::>(); + for id in ids { + inner + .page_leases + .retain(|_, lease| lease.registration.registration_id != id); + inner.navigation_versions.remove(&id); + inner.page_load_expectations.remove(&id); + inner.registrations.remove(&id); + inner.emulation_profiles.remove(&id); + } let retries = inner .open_claims .iter_mut() @@ -505,15 +559,11 @@ impl BrowserController { Some((request_id.clone(), claim.clone())) }) .collect::>(); - (labels, retries) + retries } else { - (Vec::new(), Vec::new()) + Vec::new() }; - for label in labels { - if let Some(webview) = app.get_webview(&label) { - let _ = webview.close(); - } - } + self.embedded_views.remove_owner(app, window_label); for (request_id, claim) in retries { Self::emit_open_request(app, &request_id, &claim); } @@ -740,22 +790,6 @@ impl BrowserController { } } - pub(crate) fn navigation_allowed(&self, webview_label: &str, url: &tauri::Url) -> Option { - if webview_label - .strip_prefix("browser-") - .is_some_and(|id| validate_id(id, 128).is_ok()) - { - return Some(is_allowed_url(url)); - } - self.inner.0.lock().ok().and_then(|inner| { - inner - .registrations - .values() - .any(|registration| registration.webview_label == webview_label) - .then(|| is_allowed_url(url)) - }) - } - #[cfg(windows)] fn navigate_and_wait( &self, @@ -1026,13 +1060,6 @@ fn request_deadline(deadline_ms: u64) -> Result { .ok_or_else(|| "Invalid native request deadline".to_string()) } -fn validate_bounds(bounds: BrowserTargetBounds) -> Result<(), String> { - if bounds.width == 0 || bounds.height == 0 || bounds.width > 16_384 || bounds.height > 16_384 { - return Err("Invalid browser target bounds".to_string()); - } - Ok(()) -} - fn allowed_url(raw: &str) -> Result { let url = tauri::Url::parse(raw).map_err(|_| navigation_error())?; is_allowed_url(&url) @@ -1040,13 +1067,6 @@ fn allowed_url(raw: &str) -> Result { .ok_or_else(navigation_error) } -fn is_allowed_url(url: &tauri::Url) -> bool { - matches!(url.scheme(), "http" | "https") - && url.host().is_some() - && url.username().is_empty() - && url.password().is_none() -} - fn navigation_error() -> String { "Browser navigation requires a credential-free HTTP(S) URL".to_string() } @@ -1078,9 +1098,8 @@ fn install_webview2_handlers( ) -> Result<(), String> { use std::sync::mpsc; use webview2_com::{ - CoTaskMemPWSTR, Microsoft::Web::WebView2::Win32::COREWEBVIEW2_PERMISSION_STATE_DENY, - NavigationCompletedEventHandler, NavigationStartingEventHandler, - PermissionRequestedEventHandler, SourceChangedEventHandler, + CoTaskMemPWSTR, NavigationCompletedEventHandler, NavigationStartingEventHandler, + SourceChangedEventHandler, }; let app = webview.app_handle().clone(); @@ -1089,15 +1108,6 @@ fn install_webview2_handlers( .with_webview(move |platform| { let result = (|| { let core = unsafe { platform.controller().CoreWebView2() }?; - let permission = PermissionRequestedEventHandler::create(Box::new(|_, args| { - if let Some(args) = args { - unsafe { args.SetState(COREWEBVIEW2_PERMISSION_STATE_DENY)? }; - } - Ok(()) - })); - let mut permission_token = 0; - unsafe { core.add_PermissionRequested(&permission, &mut permission_token)? }; - let started_controller = controller.clone(); let started_registration_id = registration_id.clone(); let started = NavigationStartingEventHandler::create(Box::new(move |_, args| { diff --git a/packages/tauri-app/src-tauri/src/browser_controller_regressions.rs b/packages/tauri-app/src-tauri/src/browser_controller_regressions.rs index 3c83312b2f..04b1da5322 100644 --- a/packages/tauri-app/src-tauri/src/browser_controller_regressions.rs +++ b/packages/tauri-app/src-tauri/src/browser_controller_regressions.rs @@ -139,8 +139,9 @@ fn registration() -> Registration { } fn controller_with_registration() -> (BrowserController, Registration) { - let controller = BrowserController::new(std::path::PathBuf::new()); + let mut controller = BrowserController::new(std::path::PathBuf::new()); let registration = registration(); + controller.embedded_views = EmbeddedViews::for_test(OWNER, ®istration.webview_label); { let mut inner = controller.inner.0.lock().unwrap(); inner @@ -218,6 +219,75 @@ fn only_primary_renderer_reload_disposes_its_native_browser_children() { .is_ok()); } +#[test] +fn older_creation_and_foreign_window_cannot_replace_current_registration() { + let (controller, mut current) = controller_with_registration(); + current.generation = 3; + controller + .publish_registration(current.clone(), 0, "https://example.com/") + .unwrap(); + let mut stale = current.clone(); + stale.generation = 2; + assert!(controller + .publish_registration(stale, 0, "https://example.com/") + .is_err()); + let mut foreign = current.clone(); + foreign.window_label = OTHER.into(); + foreign.generation = 4; + assert!(controller + .publish_registration(foreign, 0, "https://example.com/") + .is_err()); + assert_eq!( + controller + .owned_registration(OWNER, "preview") + .unwrap() + .generation, + 3 + ); + controller + .inner + .0 + .lock() + .unwrap() + .registrations + .remove("preview"); + current.generation = 2; + assert!(controller + .publish_registration(current, 0, "https://example.com/") + .is_err()); +} + +#[test] +fn hiding_revokes_page_authority_even_when_native_hide_fails() { + let (app, _, child) = app_with_preview(); + let (controller, registration) = controller_with_registration(); + let lease = controller + .reserve_page(registration, &uuid::Uuid::new_v4().to_string()) + .unwrap(); + child.close().unwrap(); + assert!(controller + .update( + app.handle(), + OWNER, + BrowserTargetUpdate { + registration_id: "preview".into(), + bounds: None, + visible: Some(false), + } + ) + .is_err()); + assert!( + !controller + .owned_registration(OWNER, "preview") + .unwrap() + .visible + ); + assert!(controller + .check_page_state(&lease, Instant::now() + Duration::from_secs(1)) + .is_err()); + assert!(controller.inner.0.lock().unwrap().page_leases.is_empty()); +} + #[test] fn fragment_navigation_completes_without_webview2_document_events() { let (controller, registration) = controller_with_registration(); diff --git a/packages/tauri-app/src-tauri/src/embedded_view.rs b/packages/tauri-app/src-tauri/src/embedded_view.rs new file mode 100644 index 0000000000..7be7004277 --- /dev/null +++ b/packages/tauri-app/src-tauri/src/embedded_view.rs @@ -0,0 +1,337 @@ +//! Owner-fenced native child views. Business/session state belongs to consumers. +use serde::Deserialize; +use std::collections::HashMap; +use std::path::{Path, PathBuf}; +use std::sync::{Arc, Mutex}; +use tauri::{AppHandle, Manager, PhysicalPosition, PhysicalSize, Runtime}; + +#[cfg(windows)] +mod windows; + +#[derive(Clone, Copy, Debug, Deserialize)] +pub(crate) struct Bounds { + pub(crate) x: i32, + pub(crate) y: i32, + pub(crate) width: u32, + pub(crate) height: u32, +} + +pub(crate) fn validate_bounds(bounds: Bounds) -> Result<(), String> { + if bounds.width == 0 || bounds.height == 0 || bounds.width > 16_384 || bounds.height > 16_384 { + return Err("Invalid browser target bounds".to_string()); + } + Ok(()) +} + +pub(crate) fn is_allowed_url(url: &tauri::Url) -> bool { + matches!(url.scheme(), "http" | "https") + && url.host().is_some() + && url.username().is_empty() + && url.password().is_none() +} + +pub(crate) fn browser_storage(profile: &Path) -> PathBuf { + profile.join("shared-v1") +} + +fn reserved_label(label: &str) -> bool { + label.starts_with("browser-") || label.starts_with("remote-view-") +} + +#[derive(Default)] +struct Inner { + records: HashMap, + sequence: u64, +} + +#[derive(Clone, PartialEq, Eq)] +struct Record { + owner: String, + token: u64, + preparing: bool, +} + +#[derive(Clone, Default)] +pub(crate) struct EmbeddedViews(Arc>); + +impl EmbeddedViews { + #[cfg(test)] + pub(crate) fn for_test(owner: &str, label: &str) -> Self { + let views = Self::default(); + let record = views.reserve(owner, label).unwrap(); + views.finish_creation(label, &record).unwrap(); + views + } + + fn reserve(&self, owner: &str, label: &str) -> Result { + crate::identity::local_window_id(owner)?; + if !reserved_label(label) || label.ends_with('-') { + return Err("Invalid embedded view label".into()); + } + let mut inner = self.0.lock().map_err(|error| error.to_string())?; + if inner.records.contains_key(label) { + return Err("Embedded view already exists".into()); + } + inner.sequence = inner.sequence.wrapping_add(1); + let record = Record { + owner: owner.into(), + token: inner.sequence, + preparing: true, + }; + inner.records.insert(label.into(), record.clone()); + Ok(record) + } + + fn owned(&self, owner: &str, label: &str) -> Result { + crate::identity::local_window_id(owner)?; + let inner = self.0.lock().map_err(|error| error.to_string())?; + let record = inner + .records + .get(label) + .ok_or("Embedded view is no longer available")?; + if record.owner != owner { + return Err("Embedded view belongs to another window".into()); + } + Ok(record.clone()) + } + + fn remove_exact(&self, label: &str, record: &Record) -> bool { + let Ok(mut inner) = self.0.lock() else { + return false; + }; + if inner + .records + .get(label) + .is_some_and(|current| current.token == record.token) + { + inner.records.remove(label); + return true; + } + false + } + + fn finish_creation(&self, label: &str, record: &Record) -> Result<(), String> { + let mut inner = self.0.lock().map_err(|error| error.to_string())?; + let current = inner + .records + .get_mut(label) + .filter(|current| current.token == record.token) + .ok_or("Embedded view changed during creation")?; + current.preparing = false; + Ok(()) + } + + /// A reserved child always produces a decision, including when its record is missing. + /// Only the initial neutral document is allowed while native protections are installed. + pub(crate) fn navigation_allowed(&self, label: &str, url: &tauri::Url) -> Option { + let inner = self.0.lock().ok(); + if let Some(record) = inner.as_ref().and_then(|inner| inner.records.get(label)) { + return Some( + is_allowed_url(url) || (record.preparing && url.as_str() == "about:blank"), + ); + } + reserved_label(label).then_some(false) + } + + #[cfg(windows)] + pub(crate) fn create( + &self, + window: &tauri::Window, + label: &str, + storage: PathBuf, + bounds: Bounds, + on_page_load: impl Fn(tauri::Webview, tauri::webview::PageLoadPayload<'_>) + + Send + + Sync + + 'static, + on_navigation: impl Fn(&tauri::Url) -> bool + Send + Sync + 'static, + ) -> Result { + self.create_with( + window, + label, + storage, + bounds, + on_page_load, + on_navigation, + windows::install, + ) + } + + #[cfg(any(windows, test))] + fn create_with( + &self, + window: &tauri::Window, + label: &str, + storage: PathBuf, + bounds: Bounds, + on_page_load: impl Fn(tauri::Webview, tauri::webview::PageLoadPayload<'_>) + + Send + + Sync + + 'static, + on_navigation: impl Fn(&tauri::Url) -> bool + Send + Sync + 'static, + install: impl FnOnce(&tauri::Webview) -> Result<(), String>, + ) -> Result, String> { + use tauri::webview::{NewWindowResponse, WebviewBuilder}; + validate_bounds(bounds)?; + if !window + .app_handle() + .get_webview(window.label()) + .is_some_and(|primary| primary.window().label() == window.label()) + { + return Err("Embedded view requires a local primary renderer".into()); + } + // Register before add_child: the host navigation interceptor runs during creation. + let record = self.reserve(window.label(), label)?; + let policy = self.clone(); + let navigation_label = label.to_string(); + let builder = WebviewBuilder::new( + label, + tauri::WebviewUrl::External("about:blank".parse().expect("static neutral URL")), + ) + .data_directory(storage) + .focused(false) + .on_page_load(on_page_load) + .on_navigation(move |url| { + let allowed = policy.navigation_allowed(&navigation_label, url) == Some(true); + allowed && on_navigation(url) + }) + .on_new_window(|_, _| NewWindowResponse::Deny) + .on_download(|_, _| false); + // Tauri has no hidden-child builder flag. Keep the neutral child off-canvas + // until hide completes, then apply its real physical bounds while hidden. + let result = window + .add_child( + builder, + PhysicalPosition::new(-32_768, -32_768), + PhysicalSize::new(1, 1), + ) + .map_err(|error| format!("failed to create browser preview: {error}")); + let webview = match result { + Ok(webview) => webview, + Err(error) => { + self.remove_exact(label, &record); + return Err(error); + } + }; + let configured = webview + .hide() + .map_err(|error| error.to_string()) + .and_then(|()| install(&webview)) + .and_then(|()| self.set_bounds(window.app_handle(), window.label(), label, bounds)) + .and_then(|()| self.finish_creation(label, &record)); + if let Err(error) = configured { + self.remove_exact(label, &record); + let _ = webview.close(); + return Err(error); + } + Ok(webview) + } + + pub(crate) fn set_bounds( + &self, + app: &AppHandle, + owner: &str, + label: &str, + bounds: Bounds, + ) -> Result<(), String> { + validate_bounds(bounds)?; + let webview = self.webview(app, owner, label)?; + webview + .set_position(PhysicalPosition::new(bounds.x, bounds.y)) + .and_then(|()| webview.set_size(PhysicalSize::new(bounds.width, bounds.height))) + .map_err(|error| error.to_string()) + } + + pub(crate) fn set_visible( + &self, + app: &AppHandle, + owner: &str, + label: &str, + visible: bool, + ) -> Result<(), String> { + let webview = self.webview(app, owner, label)?; + if visible { + webview.show() + } else { + webview.hide() + } + .map_err(|error| error.to_string()) + } + + fn webview( + &self, + app: &AppHandle, + owner: &str, + label: &str, + ) -> Result, String> { + self.owned(owner, label)?; + let webview = app + .get_webview(label) + .ok_or("Embedded view is no longer available")?; + if webview.window().label() != owner { + return Err("Embedded view belongs to another window".into()); + } + Ok(webview) + } + + pub(crate) fn close( + &self, + app: &AppHandle, + owner: &str, + label: &str, + ) -> Result<(), String> { + crate::identity::local_window_id(owner)?; + // Read once so concurrent closes stay idempotent. + let record = { + let inner = self.0.lock().map_err(|error| error.to_string())?; + let Some(record) = inner.records.get(label) else { + return Ok(()); + }; + if record.owner != owner { + return Err("Embedded view belongs to another window".into()); + } + record.clone() + }; + let webview = app.get_webview(label); + if webview + .as_ref() + .is_some_and(|webview| webview.window().label() != owner) + { + return Err("Embedded view belongs to another window".into()); + } + if self.remove_exact(label, &record) { + if let Some(webview) = webview { + webview.close().map_err(|error| error.to_string())?; + } + } + Ok(()) + } + + pub(crate) fn remove_owner(&self, app: &AppHandle, owner: &str) { + let labels = if let Ok(mut inner) = self.0.lock() { + let labels = inner + .records + .iter() + .filter(|(_, record)| record.owner == owner) + .map(|(label, _)| label.clone()) + .collect::>(); + for label in &labels { + inner.records.remove(label); + } + labels + } else { + Vec::new() + }; + for label in labels { + if let Some(webview) = app.get_webview(&label) { + if webview.window().label() == owner { + let _ = webview.close(); + } + } + } + } +} + +#[cfg(test)] +#[path = "embedded_view_tests.rs"] +mod tests; diff --git a/packages/tauri-app/src-tauri/src/embedded_view/windows.rs b/packages/tauri-app/src-tauri/src/embedded_view/windows.rs new file mode 100644 index 0000000000..b45b5fb11a --- /dev/null +++ b/packages/tauri-app/src-tauri/src/embedded_view/windows.rs @@ -0,0 +1,31 @@ +use std::sync::mpsc; +use std::time::Duration; + +pub(super) fn install(webview: &tauri::Webview) -> Result<(), String> { + use webview2_com::{ + Microsoft::Web::WebView2::Win32::COREWEBVIEW2_PERMISSION_STATE_DENY, + PermissionRequestedEventHandler, + }; + crate::windows_browser_accelerators::bind(webview); + let (sender, receiver) = mpsc::sync_channel(1); + webview + .with_webview(move |platform| { + let result = (|| { + let core = unsafe { platform.controller().CoreWebView2() }?; + let permission = PermissionRequestedEventHandler::create(Box::new(|_, args| { + if let Some(args) = args { + unsafe { args.SetState(COREWEBVIEW2_PERMISSION_STATE_DENY)? }; + } + Ok(()) + })); + let mut token = 0; + unsafe { core.add_PermissionRequested(&permission, &mut token)? }; + Ok::<(), webview2_com::Error>(()) + })(); + let _ = sender.send(result.map_err(|error| error.to_string())); + }) + .map_err(|error| error.to_string())?; + receiver + .recv_timeout(Duration::from_secs(5)) + .map_err(|_| "Timed out configuring WebView2 browser security".to_string())? +} diff --git a/packages/tauri-app/src-tauri/src/embedded_view_tests.rs b/packages/tauri-app/src-tauri/src/embedded_view_tests.rs new file mode 100644 index 0000000000..137e785d6c --- /dev/null +++ b/packages/tauri-app/src-tauri/src/embedded_view_tests.rs @@ -0,0 +1,204 @@ +use super::*; +use tauri::test::{mock_builder, mock_context, noop_assets}; +use tauri::{WebviewUrl, WebviewWindowBuilder}; + +const OWNER: &str = "local-11111111-1111-4111-8111-111111111111"; +const OTHER: &str = "local-22222222-2222-4222-8222-222222222222"; + +#[test] +fn child_policy_is_registered_before_creation_and_fails_closed() { + let views = EmbeddedViews::default(); + let http = "https://example.com".parse().unwrap(); + let blank = "about:blank".parse().unwrap(); + assert_eq!( + views.navigation_allowed("browser-missing", &http), + Some(false) + ); + assert_eq!(views.navigation_allowed(OWNER, &http), None); + assert!(views.reserve("remote-guest", "browser-child").is_err()); + let record = views.reserve(OWNER, "browser-child").unwrap(); + assert!(views.owned(OTHER, "browser-child").is_err()); + assert!(views.owned(OWNER, "browser-missing").is_err()); + assert_eq!( + views.navigation_allowed("browser-child", &blank), + Some(true) + ); + assert_eq!(views.navigation_allowed("browser-child", &http), Some(true)); + views.finish_creation("browser-child", &record).unwrap(); + assert_eq!( + views.navigation_allowed("browser-child", &blank), + Some(false) + ); + for raw in [ + "file:///secret", + "https://user:pass@example.com", + "javascript:alert(1)", + "data:text/html,test", + ] { + assert_eq!( + views.navigation_allowed("browser-child", &raw.parse().unwrap()), + Some(false) + ); + } +} + +#[test] +fn failed_creation_rolls_back_only_its_exact_reservation() { + let views = EmbeddedViews::default(); + let failed = views.reserve(OWNER, "browser-child").unwrap(); + assert!(views.remove_exact("browser-child", &failed)); + assert_eq!( + views.navigation_allowed("browser-child", &"https://example.com".parse().unwrap()), + Some(false) + ); + let replacement = views.reserve(OWNER, "browser-child").unwrap(); + let stale = views.clone(); + let worker = std::thread::spawn(move || { + assert!(!stale.remove_exact("browser-child", &failed)); + assert!(stale.finish_creation("browser-child", &failed).is_err()); + }); + worker.join().unwrap(); + views + .finish_creation("browser-child", &replacement) + .unwrap(); + assert_eq!( + views.owned(OWNER, "browser-child").unwrap().token, + replacement.token + ); +} + +#[test] +fn native_creation_installs_protections_before_return_and_rolls_back_failure() { + let app = mock_builder().build(mock_context(noop_assets())).unwrap(); + WebviewWindowBuilder::new(&app, OWNER, WebviewUrl::default()) + .build() + .unwrap(); + let owner = app.get_window(OWNER).unwrap(); + let views = EmbeddedViews::default(); + app.manage(views.clone()); + let bounds = Bounds { + x: 10, + y: 20, + width: 300, + height: 200, + }; + let result = views.create_with( + &owner, + "browser-failed", + PathBuf::new(), + bounds, + |_, _| {}, + |_| true, + |webview| { + assert!(views.owned(OWNER, webview.label()).is_ok()); + assert_eq!( + views.navigation_allowed(webview.label(), &"about:blank".parse().unwrap()), + Some(true) + ); + Err("mandatory protection failed".into()) + }, + ); + assert_eq!(result.err().unwrap(), "mandatory protection failed"); + assert!(views.owned(OWNER, "browser-failed").is_err()); + assert!(app.get_webview("browser-failed").is_none()); + let child = views + .create_with( + &owner, + "browser-ready", + PathBuf::new(), + bounds, + |_, _| {}, + |_| true, + |_| Ok(()), + ) + .unwrap(); + assert!(crate::intercept_navigation( + &child, + &"https://example.com".parse().unwrap() + )); + assert!(!crate::intercept_navigation( + &child, + &"file:///secret".parse().unwrap() + )); + assert_eq!( + views.navigation_allowed(child.label(), &"about:blank".parse().unwrap()), + Some(false) + ); + let record = views.owned(OWNER, child.label()).unwrap(); + views.remove_exact(child.label(), &record); + assert!(!crate::intercept_navigation( + &child, + &"https://example.com".parse().unwrap() + )); + let duplicate = views.create_with( + &owner, + child.label(), + PathBuf::new(), + bounds, + |_, _| {}, + |_| true, + |_| Ok(()), + ); + assert!(duplicate.is_err()); + assert!(views.owned(OWNER, child.label()).is_err()); + child.close().unwrap(); + + let reloaded = views.create_with( + &owner, + "browser-reloading", + PathBuf::new(), + bounds, + |_, _| {}, + |_| true, + |_| { + views.remove_owner(app.handle(), OWNER); + Ok(()) + }, + ); + assert!(reloaded.is_err()); + assert!(views.owned(OWNER, "browser-reloading").is_err()); + assert!(app.get_webview("browser-reloading").is_none()); +} + +#[test] +fn owner_cleanup_removes_ready_and_pending_children_without_touching_other_owners() { + let app = mock_builder().build(mock_context(noop_assets())).unwrap(); + WebviewWindowBuilder::new(&app, OWNER, WebviewUrl::default()) + .build() + .unwrap(); + let window = app.get_window(OWNER).unwrap(); + let child = window + .add_child( + tauri::webview::WebviewBuilder::new("browser-ready", WebviewUrl::default()), + PhysicalPosition::new(0, 0), + PhysicalSize::new(300, 200), + ) + .unwrap(); + let views = EmbeddedViews::for_test(OWNER, child.label()); + let pending = views.reserve(OWNER, "browser-pending").unwrap(); + views.reserve(OTHER, "browser-other").unwrap(); + assert!(views + .set_visible(app.handle(), OTHER, child.label(), true) + .is_err()); + assert!(views + .set_bounds( + app.handle(), + OTHER, + child.label(), + Bounds { + x: 0, + y: 0, + width: 1, + height: 1 + } + ) + .is_err()); + assert!(views.close(app.handle(), OTHER, child.label()).is_err()); + assert!(app.get_webview(child.label()).is_some()); + views.remove_owner(app.handle(), OWNER); + assert!(app.get_webview(child.label()).is_none()); + assert!(views.finish_creation("browser-pending", &pending).is_err()); + assert!(views.owned(OTHER, "browser-other").is_ok()); + views.close(app.handle(), OWNER, "browser-ready").unwrap(); + assert!(app.get_webview(OWNER).is_some()); +} diff --git a/packages/tauri-app/src-tauri/src/main.rs b/packages/tauri-app/src-tauri/src/main.rs index fd3cc3d660..ef6c2c1550 100644 --- a/packages/tauri-app/src-tauri/src/main.rs +++ b/packages/tauri-app/src-tauri/src/main.rs @@ -12,6 +12,7 @@ mod client_state; mod data_profile; mod data_profile_cleanup; mod developer_mode; +mod embedded_view; mod external_open; mod identity; mod launch; @@ -829,9 +830,8 @@ fn open_remote_external_url(url: &Url, open: impl FnOnce(&Url)) -> bool { fn intercept_navigation(webview: &Webview, url: &Url) -> bool { let window_label = webview.label().to_string(); - let state = webview.app_handle().state::(); - if let Some(allowed) = state - .browser_controller + if let Some(allowed) = webview.app_handle() + .state::() .navigation_allowed(&window_label, url) { return allowed; @@ -1835,6 +1835,9 @@ fn main() { let notification_badge_host = Arc::new(Mutex::new(None::>)); let setup_notification_badge_host = Arc::clone(¬ification_badge_host); + let browser_controller = browser_controller::BrowserController::new( + setup_scope.webview_data_directory.join("browser"), + ); desktop_updater::register(tauri::Builder::default(), context.config()) .plugin(single_instance) .plugin(tauri_plugin_dialog::init()) @@ -1865,6 +1868,7 @@ fn main() { ) .plugin(tauri_plugin_notification::init()) .plugin(navigation_guard) + .manage(browser_controller.embedded_views.clone()) .manage(local_windows::LocalWindows::default()) .manage(notification_badge::NotificationBadge::default()) .manage(window_constraints::WindowConstraints::default()) @@ -1894,9 +1898,7 @@ fn main() { backend_config.clone(), ), developer_mode, - browser_controller: browser_controller::BrowserController::new( - setup_scope.webview_data_directory.join("browser"), - ), + browser_controller, wake_lock: Mutex::new(WakeLockState::default()), remote_navigation: Mutex::new(HashMap::new()), remote_navigation_generation: AtomicU64::new(0), From 734314dd54294005483ff1217bc87918e6f88068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Andr=C3=A9?= Date: Thu, 5 Nov 2026 16:49:24 +0100 Subject: [PATCH 02/45] feat(tauri): prepare isolated WebKit child views Add macOS and Linux adapters to the owner-fenced embedded-view layer without enabling the renderer path. Preview stores share a scoped directory on Linux and a domain-separated, full-profile SHA-256 identifier on macOS; Tauri now requires macOS 14 while Electron keeps 13.5. Vendor complete Wry and runtime crates. GTK children use a lazy per-window overlay and persistent fixed geometry; weak IPC references let destroyed views release. WKWebView media capture is denied per reserved instance at construction, leaving app views unchanged. Embedded remote labels avoid the primary remote notification capability pattern, and explicit storage domains support future remote-tab adoption. Windows locked checks, 313 Rust tests, runtime packaging tests and release builds pass. Native GNOME Wayland/Xwayland trials cover geometry, input routing, lifecycle, isolation and permission/download denial, including an unfixed-bounds negative control. macOS compilation and permission defaults require native CI/OS qualification before enabling its renderer path; no global denial or private API is used. --- dev-docs/BROWSER_AUTOMATION.md | 6 +- dev-docs/DESKTOP_DATA_PROFILES.md | 2 + packages/tauri-app/Cargo.lock | 4 - packages/tauri-app/Cargo.toml | 2 + .../src/browser_controller_regressions.rs | 14 +- .../tauri-app/src-tauri/src/embedded_view.rs | 79 +- .../src-tauri/src/embedded_view/linux.rs | 19 + .../src-tauri/src/embedded_view/macos.rs | 5 + .../src-tauri/src/embedded_view_tests.rs | 62 + packages/tauri-app/src-tauri/src/main.rs | 4 + packages/tauri-app/src-tauri/tauri.conf.json | 2 +- .../tests/embedded-webkit-security.test.mjs | 20 + packages/tauri-app/vendor/README.md | 52 +- .../.cargo_vcs_info.json | 6 + .../tauri-runtime-wry-2.10.1/Cargo.lock | 3661 ++++++++++++ .../tauri-runtime-wry-2.10.1/Cargo.toml | 148 + .../tauri-runtime-wry-2.10.1/Cargo.toml.orig | 76 + .../LICENSE_APACHE-2.0 | 177 + .../tauri-runtime-wry-2.10.1/LICENSE_MIT | 21 + .../vendor/tauri-runtime-wry-2.10.1/README.md | 44 + .../vendor/tauri-runtime-wry-2.10.1/build.rs | 19 + .../examples/gtk-child-layout.rs | 223 + .../examples/gtk-child-trial.py | 152 + .../src/dialog/mod.rs | 16 + .../src/dialog/windows.rs | 124 + .../src/gtk_child_layout.rs | 56 + .../tauri-runtime-wry-2.10.1/src/lib.rs | 5238 +++++++++++++++++ .../src/monitor/linux.rs | 18 + .../src/monitor/macos.rs | 34 + .../src/monitor/mod.rs | 37 + .../src/monitor/windows.rs | 32 + .../src/undecorated_resizing.rs | 628 ++ .../tauri-runtime-wry-2.10.1/src/util.rs | 118 + .../tauri-runtime-wry-2.10.1/src/webview.rs | 47 + .../src/window/linux.rs | 31 + .../src/window/macos.rs | 43 + .../src/window/mod.rs | 72 + .../src/window/windows.rs | 68 + .../vendor/wry-0.54.4/.cargo/config.toml | 4 + .../vendor/wry-0.54.4/.cargo_vcs_info.json | 7 + .../tauri-app/vendor/wry-0.54.4/.gitignore | 9 + .../vendor/wry-0.54.4/.license_template | 3 + .../tauri-app/vendor/wry-0.54.4/CHANGELOG.md | 1257 ++++ .../tauri-app/vendor/wry-0.54.4/Cargo.lock | 4159 +++++++++++++ .../tauri-app/vendor/wry-0.54.4/Cargo.toml | 427 ++ .../vendor/wry-0.54.4/Cargo.toml.orig | 223 + .../vendor/wry-0.54.4/LICENSE-APACHE | 201 + .../tauri-app/vendor/wry-0.54.4/LICENSE-MIT | 21 + .../tauri-app/vendor/wry-0.54.4/LICENSE.spdx | 20 + .../tauri-app/vendor/wry-0.54.4/MOBILE.md | 332 ++ .../tauri-app/vendor/wry-0.54.4/README.md | 317 + .../tauri-app/vendor/wry-0.54.4/SECURITY.md | 19 + packages/tauri-app/vendor/wry-0.54.4/build.rs | 118 + .../examples/async_custom_protocol.rs | 117 + .../vendor/wry-0.54.4/examples/cookies.rs | 73 + .../wry-0.54.4/examples/custom_protocol.rs | 117 + .../examples/custom_protocol/index.html | 26 + .../examples/custom_protocol/script.js | 22 + .../examples/custom_protocol/subpage.html | 20 + .../examples/custom_protocol/wasm.wasm | Bin 0 -> 92 bytes .../wry-0.54.4/examples/custom_titlebar.rs | 304 + .../wry-0.54.4/examples/gtk_multiwebview.rs | 133 + .../vendor/wry-0.54.4/examples/gtk_opengl.rs | 241 + .../wry-0.54.4/examples/multiwebview.rs | 168 + .../vendor/wry-0.54.4/examples/multiwindow.rs | 125 + .../vendor/wry-0.54.4/examples/reparent.rs | 111 + .../vendor/wry-0.54.4/examples/simple.rs | 71 + .../vendor/wry-0.54.4/examples/streaming.rs | 277 + .../wry-0.54.4/examples/streaming/index.html | 38 + .../vendor/wry-0.54.4/examples/transparent.rs | 80 + .../vendor/wry-0.54.4/examples/wgpu.rs | 273 + .../wry-0.54.4/examples/window_border.rs | 122 + .../vendor/wry-0.54.4/examples/winit.rs | 100 + .../tauri-app/vendor/wry-0.54.4/renovate.json | 10 + .../tauri-app/vendor/wry-0.54.4/rustfmt.toml | 15 + .../vendor/wry-0.54.4/src/android/binding.rs | 415 ++ .../wry-0.54.4/src/android/kotlin/Ipc.kt | 31 + .../wry-0.54.4/src/android/kotlin/Logger.kt | 87 + .../src/android/kotlin/PermissionHelper.kt | 115 + .../src/android/kotlin/RustWebChromeClient.kt | 493 ++ .../src/android/kotlin/RustWebView.kt | 99 + .../src/android/kotlin/RustWebViewClient.kt | 105 + .../src/android/kotlin/WryActivity.kt | 144 + .../src/android/kotlin/proguard-wry.pro | 33 + .../wry-0.54.4/src/android/main_pipe.rs | 484 ++ .../vendor/wry-0.54.4/src/android/mod.rs | 455 ++ .../src/custom_protocol_workaround.rs | 56 + .../tauri-app/vendor/wry-0.54.4/src/error.rs | 77 + .../src/inject_initialization_scripts.rs | 225 + .../tauri-app/vendor/wry-0.54.4/src/lib.rs | 2570 ++++++++ .../tauri-app/vendor/wry-0.54.4/src/proxy.rs | 15 + .../tauri-app/vendor/wry-0.54.4/src/util.rs | 13 + .../vendor/wry-0.54.4/src/web_context.rs | 113 + .../wry-0.54.4/src/webkitgtk/drag_drop.rs | 143 + .../vendor/wry-0.54.4/src/webkitgtk/mod.rs | 1273 ++++ .../src/webkitgtk/synthetic_mouse_events.rs | 187 + .../wry-0.54.4/src/webkitgtk/web_context.rs | 404 ++ .../wry-0.54.4/src/webview2/drag_drop.rs | 251 + .../vendor/wry-0.54.4/src/webview2/mod.rs | 1858 ++++++ .../vendor/wry-0.54.4/src/webview2/util.rs | 101 + .../class/document_title_changed_observer.rs | 90 + .../wry-0.54.4/src/wkwebview/class/mod.rs | 12 + .../src/wkwebview/class/url_scheme_handler.rs | 346 ++ .../wkwebview/class/wry_download_delegate.rs | 67 + .../class/wry_navigation_delegate.rs | 158 + .../src/wkwebview/class/wry_web_view.rs | 153 + .../wkwebview/class/wry_web_view_delegate.rs | 105 + .../wkwebview/class/wry_web_view_parent.rs | 110 + .../class/wry_web_view_ui_delegate.rs | 291 + .../wry-0.54.4/src/wkwebview/download.rs | 122 + .../wry-0.54.4/src/wkwebview/drag_drop.rs | 104 + .../wry-0.54.4/src/wkwebview/ios/WKWebView.rs | 625 ++ .../wry-0.54.4/src/wkwebview/ios/mod.rs | 1 + .../vendor/wry-0.54.4/src/wkwebview/mod.rs | 1477 +++++ .../wry-0.54.4/src/wkwebview/navigation.rs | 116 + .../vendor/wry-0.54.4/src/wkwebview/proxy.rs | 44 + .../src/wkwebview/synthetic_mouse_events.rs | 123 + .../vendor/wry-0.54.4/src/wkwebview/util.rs | 15 + scripts/prepare-node-runtime.test.cjs | 9 +- 119 files changed, 34611 insertions(+), 24 deletions(-) create mode 100644 packages/tauri-app/src-tauri/src/embedded_view/linux.rs create mode 100644 packages/tauri-app/src-tauri/src/embedded_view/macos.rs create mode 100644 packages/tauri-app/tests/embedded-webkit-security.test.mjs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/.cargo_vcs_info.json create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/Cargo.lock create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/Cargo.toml create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/Cargo.toml.orig create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/LICENSE_APACHE-2.0 create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/LICENSE_MIT create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/README.md create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/build.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/examples/gtk-child-layout.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/examples/gtk-child-trial.py create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/dialog/mod.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/dialog/windows.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/gtk_child_layout.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/lib.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/linux.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/macos.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/mod.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/windows.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/undecorated_resizing.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/util.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/webview.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/linux.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/macos.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/mod.rs create mode 100644 packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/windows.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/.cargo/config.toml create mode 100644 packages/tauri-app/vendor/wry-0.54.4/.cargo_vcs_info.json create mode 100644 packages/tauri-app/vendor/wry-0.54.4/.gitignore create mode 100644 packages/tauri-app/vendor/wry-0.54.4/.license_template create mode 100644 packages/tauri-app/vendor/wry-0.54.4/CHANGELOG.md create mode 100644 packages/tauri-app/vendor/wry-0.54.4/Cargo.lock create mode 100644 packages/tauri-app/vendor/wry-0.54.4/Cargo.toml create mode 100644 packages/tauri-app/vendor/wry-0.54.4/Cargo.toml.orig create mode 100644 packages/tauri-app/vendor/wry-0.54.4/LICENSE-APACHE create mode 100644 packages/tauri-app/vendor/wry-0.54.4/LICENSE-MIT create mode 100644 packages/tauri-app/vendor/wry-0.54.4/LICENSE.spdx create mode 100644 packages/tauri-app/vendor/wry-0.54.4/MOBILE.md create mode 100644 packages/tauri-app/vendor/wry-0.54.4/README.md create mode 100644 packages/tauri-app/vendor/wry-0.54.4/SECURITY.md create mode 100644 packages/tauri-app/vendor/wry-0.54.4/build.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/async_custom_protocol.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/cookies.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/custom_protocol.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/custom_protocol/index.html create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/custom_protocol/script.js create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/custom_protocol/subpage.html create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/custom_protocol/wasm.wasm create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/custom_titlebar.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/gtk_multiwebview.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/gtk_opengl.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/multiwebview.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/multiwindow.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/reparent.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/simple.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/streaming.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/streaming/index.html create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/transparent.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/wgpu.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/window_border.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/examples/winit.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/renovate.json create mode 100644 packages/tauri-app/vendor/wry-0.54.4/rustfmt.toml create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/android/binding.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/Ipc.kt create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/Logger.kt create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/PermissionHelper.kt create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/RustWebChromeClient.kt create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/RustWebView.kt create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/RustWebViewClient.kt create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/WryActivity.kt create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/proguard-wry.pro create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/android/main_pipe.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/android/mod.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/custom_protocol_workaround.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/error.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/inject_initialization_scripts.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/lib.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/proxy.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/util.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/web_context.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/webkitgtk/drag_drop.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/webkitgtk/mod.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/webkitgtk/synthetic_mouse_events.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/webkitgtk/web_context.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/webview2/drag_drop.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/webview2/mod.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/webview2/util.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/class/document_title_changed_observer.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/class/mod.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/class/url_scheme_handler.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/class/wry_download_delegate.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/class/wry_navigation_delegate.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/class/wry_web_view.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/class/wry_web_view_delegate.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/class/wry_web_view_parent.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/class/wry_web_view_ui_delegate.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/download.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/drag_drop.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/ios/WKWebView.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/ios/mod.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/mod.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/navigation.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/proxy.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/synthetic_mouse_events.rs create mode 100644 packages/tauri-app/vendor/wry-0.54.4/src/wkwebview/util.rs diff --git a/dev-docs/BROWSER_AUTOMATION.md b/dev-docs/BROWSER_AUTOMATION.md index 8164d4ff02..8e449df513 100644 --- a/dev-docs/BROWSER_AUTOMATION.md +++ b/dev-docs/BROWSER_AUTOMATION.md @@ -84,10 +84,12 @@ Windows Tauri uses a child webview owned by the local application window. `embed ### Tauri embedded-view contract - Consumers choose a unique native label for each creation, including replacements, and a persistent storage directory separate from the application renderer. Preview storage is `browser/shared-v1` inside the scoped profile. The common registry binds each child to a validated local-window owner before native construction. Every bounds, visibility and close operation rechecks ownership; native calls run outside registry locks. +- WebKit adapters use the same registry and construction guards. Linux installs a consuming `permission-request` denial before target navigation. macOS installs per-instance media denial in the vendored Wry delegate during construction. Keep its renderer path gated pending native qualification of version-dependent display-capture defaults and storage-access consent; retain the iframe fallback if these allow native permission requests. Its persistent data-store identifier is the first 16 SHA-256 bytes of length-prefixed UTF-8 domain, profile key and normalized configuration identity, with domain `browser/shared-v1`. Tauri requires macOS 14 for identified stores. The renderer's WebKit preview path remains gated separately from these native adapters. +- The GTK runtime installs one lazy overlay per owning window: primary content remains in a box, native children occupy a fixed overlay below the menu bar, and uncovered pointer input reaches the primary renderer. Wry persists child geometry in GTK layout properties across reallocations and resolves bounds/reparenting against the actual parent. The native regression under `vendor/tauri-runtime-wry-2.10.1/examples/` covers both display backends and independent owning windows. - Creation uses an off-canvas neutral document, hides the child, installs mandatory protections and applies physical bounds while hidden. Creation failures remove only their exact reservation and close the created child. Consumers install business page-load hooks and may further restrict navigation; the common credential-free HTTP(S), new-window and download guards remain mandatory. `about:blank` is accepted only while preparing the neutral child. -- The host navigation interceptor consults the shared `EmbeddedViews` application state first. Reserved `browser-` and `remote-view-` labels with missing records are denied. A child decision returns immediately, before window-origin rules and external-link opening. +- The host navigation interceptor consults the shared `EmbeddedViews` application state first. Reserved `browser-` and `embedded-remote-` labels with missing records are denied. These labels stay outside primary `local-*` and `remote-*` capability patterns. A child decision returns immediately, before window-origin rules and external-link opening. - The controller publishes its registration with renderer/generation fencing, navigates, then applies current visibility. Hiding revokes automation leases before native I/O, including when the native hide fails. Owner cleanup also invalidates children still being constructed; an old creation cannot publish after primary-renderer reload. -- Remote project tabs can adopt this layer by replacing direct child creation, geometry, visibility and closure with `EmbeddedViews`, using unique `remote-view-` labels and a server-profile storage directory. Keep origin/profile identity, project entry, login/pairing, titles, events and notifications in the remote consumer. Add its same-origin restriction to the mandatory URL policy, keep Entry/Help effects single-shot and allow only the approved help site to open externally. Qualify remote TLS exceptions and notification permissions separately. +- Remote project tabs can adopt this layer by replacing direct child creation, geometry, visibility and closure with `EmbeddedViews`, using unique `embedded-remote-` labels and a `Storage` descriptor with a server-profile directory and domain. A bare `PathBuf` selects the preview domain; remote consumers must specify their distinct server-profile domain. Keep origin/profile identity, project entry, login/pairing, titles, events and notifications in the remote consumer. Add its same-origin restriction to the mandatory URL policy, keep Entry/Help effects single-shot and allow only the approved help site to open externally. Qualify remote TLS exceptions and notification permissions separately. The UI routes an autonomous open request to the one loaded instance containing the session, claims the request for one local window, selects that session, and opens its preview. Hidden or duplicate targets are rejected rather than selected implicitly. diff --git a/dev-docs/DESKTOP_DATA_PROFILES.md b/dev-docs/DESKTOP_DATA_PROFILES.md index 8d3f09fdef..65fc5769e1 100644 --- a/dev-docs/DESKTOP_DATA_PROFILES.md +++ b/dev-docs/DESKTOP_DATA_PROFILES.md @@ -84,6 +84,8 @@ The default profile's folders are parents of other roots, so they are never remo **macOS WebKit storage is kept.** On macOS, Tauri windows of every scoped profile use the same WebKit data-store identifier (`profile_identifier("local")`) inside the app's single WebKit container, and the default profile uses WebKit's default store. No profile owns that store, so it is never deleted: removing it would also clear other profiles, including the open one. Electron keeps its web storage inside the profile folder, which is deleted. The listing reports `sharedWebKitStorage` on macOS and the confirmation says that Tauri's WebKit web storage, sign-ins and cache are shared and not deleted. +The native preview adapter uses a separate macOS store: SHA-256 over the length-prefixed `browser/shared-v1` domain, resolved profile key and normalized configuration identity, truncated to 16 bytes. Views of one identity share that store across sessions and projects. Different profiles/configurations, application renderers and remote-window stores have distinct identifiers. WebKit manages identified stores in its container; profile-folder deletion keeps these stores. Linux preview storage uses the scoped `browser/shared-v1` directory. + **In use.** A profile can be open in either host, so both hosts check the same evidence: Electron running markers and primary/registration locks; Chromium's process singleton, which Electron's `requestSingleInstanceLock()` takes while userData is still the profile folder itself (Chromium storage moves to `developer-mode-browser-v2` only afterwards), so it is read directly in `scopes//` or, for the default profile, in `/CodeNomad`: Windows `lockfile` (delete-on-close, so present only while held) and POSIX `SingletonLock`, a symlink to `-` (a lock of this host with a live PID is in use, with a dead PID is stale, another host's or an unparsable one is unknown; `SingletonSocket`/`SingletonCookie` carry no ownership); the cross-host client-state election (owner and participants); Tauri running markers and WebView2 `EBWebView/lockfile`. A live PID counts as in use even if it was reused; an unreadable marker or lock means "state unknown". In-use and unknown profiles are listed but skipped. The host rechecks immediately before removing each folder and stops at the first sign of activity; locked files make removal fail rather than succeed partially in silence. The result lists, per profile, deleted / in use / unknown / no longer found / incomplete with the exact paths that remain, and the list refreshes. **Remembered choices.** After deleting a named profile of the open configuration, that configuration's entry in `profile-selection/choices.json` is removed if it names the profile (its choice key is known). Other configurations' keys cannot be mapped back to a scope, so their entries naming it are removed only when no folder of that profile remains for any configuration (a scope entry that is a symlink or junction, present or dangling, counts as remaining here, because a configuration may open its profile through it; links are still never listed or deleted); a remaining stale entry is still caught at launch, which ignores remembered profiles whose folder is gone. The update takes the selection lock; if a launch currently holds it, or the file is corrupt or newer, nothing is rewritten. Choices naming `default` are never removed. diff --git a/packages/tauri-app/Cargo.lock b/packages/tauri-app/Cargo.lock index 05c25aaba5..094f655d61 100644 --- a/packages/tauri-app/Cargo.lock +++ b/packages/tauri-app/Cargo.lock @@ -4715,8 +4715,6 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" version = "2.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e11ea2e6f801d275fdd890d6c9603736012742a1c33b96d0db788c9cdebf7f9e" dependencies = [ "gtk", "http", @@ -6343,8 +6341,6 @@ checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" [[package]] name = "wry" version = "0.54.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a8135d8676225e5744de000d4dff5a082501bf7db6a1c1495034f8c314edbc" dependencies = [ "base64 0.22.1", "block2", diff --git a/packages/tauri-app/Cargo.toml b/packages/tauri-app/Cargo.toml index d58f0bd229..305e86b8e3 100644 --- a/packages/tauri-app/Cargo.toml +++ b/packages/tauri-app/Cargo.toml @@ -9,3 +9,5 @@ resolver = "2" [patch.crates-io] tao = { path = "vendor/tao-0.34.6" } tauri-plugin-updater = { path = "vendor/tauri-plugin-updater-2.12.0" } +tauri-runtime-wry = { path = "vendor/tauri-runtime-wry-2.10.1" } +wry = { path = "vendor/wry-0.54.4" } diff --git a/packages/tauri-app/src-tauri/src/browser_controller_regressions.rs b/packages/tauri-app/src-tauri/src/browser_controller_regressions.rs index 04b1da5322..da40b9ed1d 100644 --- a/packages/tauri-app/src-tauri/src/browser_controller_regressions.rs +++ b/packages/tauri-app/src-tauri/src/browser_controller_regressions.rs @@ -47,12 +47,14 @@ fn tauri_authority_does_not_grant_parent_capabilities_to_preview_children() { url: url.parse().unwrap(), }; for command in &commands { - assert!( - authority - .resolve_access(command, OWNER, "browser-preview", &origin) - .is_none(), - "preview inherited {command} at {url}" - ); + for child in ["browser-preview", "embedded-remote-preview"] { + assert!( + authority + .resolve_access(command, OWNER, child, &origin) + .is_none(), + "{child} inherited {command} at {url}" + ); + } } } let origin = tauri::ipc::Origin::Remote { diff --git a/packages/tauri-app/src-tauri/src/embedded_view.rs b/packages/tauri-app/src-tauri/src/embedded_view.rs index 7be7004277..0b14d89d83 100644 --- a/packages/tauri-app/src-tauri/src/embedded_view.rs +++ b/packages/tauri-app/src-tauri/src/embedded_view.rs @@ -5,9 +5,37 @@ use std::path::{Path, PathBuf}; use std::sync::{Arc, Mutex}; use tauri::{AppHandle, Manager, PhysicalPosition, PhysicalSize, Runtime}; +#[cfg(target_os = "linux")] +mod linux; +#[cfg(target_os = "macos")] +mod macos; #[cfg(windows)] mod windows; +/// Full, normalized desktop identity. The caller resolves config aliases before startup. +pub(crate) struct StorageIdentity { + profile: String, + config: String, +} + +impl StorageIdentity { + pub(crate) fn new(profile: String, config: String) -> Self { + Self { profile, config } + } + + pub(crate) fn identifier(&self, domain: &str) -> [u8; 16] { + use sha2::{Digest, Sha256}; + let mut hash = Sha256::new(); + for part in [domain, self.profile.as_str(), self.config.as_str()] { + hash.update((part.len() as u64).to_be_bytes()); + hash.update(part.as_bytes()); + } + hash.finalize()[..16] + .try_into() + .expect("16-byte store identifier") + } +} + #[derive(Clone, Copy, Debug, Deserialize)] pub(crate) struct Bounds { pub(crate) x: i32, @@ -34,8 +62,23 @@ pub(crate) fn browser_storage(profile: &Path) -> PathBuf { profile.join("shared-v1") } +/// The directory selects file-backed stores; the domain separates macOS stores. +pub(crate) struct Storage { + pub(crate) directory: PathBuf, + pub(crate) domain: String, +} + +impl From for Storage { + fn from(directory: PathBuf) -> Self { + Self { + directory, + domain: "browser/shared-v1".into(), + } + } +} + fn reserved_label(label: &str) -> bool { - label.starts_with("browser-") || label.starts_with("remote-view-") + label.starts_with("browser-") || label.starts_with("embedded-remote-") } #[derive(Default)] @@ -133,12 +176,12 @@ impl EmbeddedViews { reserved_label(label).then_some(false) } - #[cfg(windows)] + #[cfg(any(windows, target_os = "linux", target_os = "macos"))] pub(crate) fn create( &self, window: &tauri::Window, label: &str, - storage: PathBuf, + storage: impl Into, bounds: Bounds, on_page_load: impl Fn(tauri::Webview, tauri::webview::PageLoadPayload<'_>) + Send @@ -153,16 +196,29 @@ impl EmbeddedViews { bounds, on_page_load, on_navigation, - windows::install, + { + #[cfg(windows)] + { + windows::install + } + #[cfg(target_os = "linux")] + { + linux::install + } + #[cfg(target_os = "macos")] + { + macos::install + } + }, ) } - #[cfg(any(windows, test))] + #[cfg(any(windows, target_os = "linux", target_os = "macos", test))] fn create_with( &self, window: &tauri::Window, label: &str, - storage: PathBuf, + storage: impl Into, bounds: Bounds, on_page_load: impl Fn(tauri::Webview, tauri::webview::PageLoadPayload<'_>) + Send @@ -172,7 +228,14 @@ impl EmbeddedViews { install: impl FnOnce(&tauri::Webview) -> Result<(), String>, ) -> Result, String> { use tauri::webview::{NewWindowResponse, WebviewBuilder}; + let storage = storage.into(); validate_bounds(bounds)?; + #[cfg(target_os = "macos")] + let storage_identifier = window + .app_handle() + .try_state::() + .ok_or("Embedded view storage identity is unavailable")? + .identifier(&storage.domain); if !window .app_handle() .get_webview(window.label()) @@ -188,7 +251,7 @@ impl EmbeddedViews { label, tauri::WebviewUrl::External("about:blank".parse().expect("static neutral URL")), ) - .data_directory(storage) + .data_directory(storage.directory) .focused(false) .on_page_load(on_page_load) .on_navigation(move |url| { @@ -197,6 +260,8 @@ impl EmbeddedViews { }) .on_new_window(|_, _| NewWindowResponse::Deny) .on_download(|_, _| false); + #[cfg(target_os = "macos")] + let builder = builder.data_store_identifier(storage_identifier); // Tauri has no hidden-child builder flag. Keep the neutral child off-canvas // until hide completes, then apply its real physical bounds while hidden. let result = window diff --git a/packages/tauri-app/src-tauri/src/embedded_view/linux.rs b/packages/tauri-app/src-tauri/src/embedded_view/linux.rs new file mode 100644 index 0000000000..5edb4daa3c --- /dev/null +++ b/packages/tauri-app/src-tauri/src/embedded_view/linux.rs @@ -0,0 +1,19 @@ +pub(super) fn install(webview: &tauri::Webview) -> Result<(), String> { + use std::sync::mpsc; + use std::time::Duration; + use webkit2gtk::prelude::*; + + let (sender, receiver) = mpsc::sync_channel(1); + webview + .with_webview(move |platform| { + platform.inner().connect_permission_request(|_, request| { + request.deny(); + true + }); + let _ = sender.send(()); + }) + .map_err(|error| error.to_string())?; + receiver + .recv_timeout(Duration::from_secs(5)) + .map_err(|_| "Timed out configuring WebKitGTK browser security".to_string()) +} diff --git a/packages/tauri-app/src-tauri/src/embedded_view/macos.rs b/packages/tauri-app/src-tauri/src/embedded_view/macos.rs new file mode 100644 index 0000000000..360f7735b0 --- /dev/null +++ b/packages/tauri-app/src-tauri/src/embedded_view/macos.rs @@ -0,0 +1,5 @@ +pub(super) fn install(_: &tauri::Webview) -> Result<(), String> { + // The vendored Wry delegate installs per-instance media denial at construction. + // Qualify WebKit's other permission defaults before enabling the renderer path. + Ok(()) +} diff --git a/packages/tauri-app/src-tauri/src/embedded_view_tests.rs b/packages/tauri-app/src-tauri/src/embedded_view_tests.rs index 137e785d6c..989e5d9e76 100644 --- a/packages/tauri-app/src-tauri/src/embedded_view_tests.rs +++ b/packages/tauri-app/src-tauri/src/embedded_view_tests.rs @@ -16,6 +16,16 @@ fn child_policy_is_registered_before_creation_and_fails_closed() { ); assert_eq!(views.navigation_allowed(OWNER, &http), None); assert!(views.reserve("remote-guest", "browser-child").is_err()); + let remote = views.reserve(OWNER, "embedded-remote-child").unwrap(); + assert_eq!( + views.navigation_allowed("embedded-remote-child", &http), + Some(true) + ); + views.remove_exact("embedded-remote-child", &remote); + assert_eq!( + views.navigation_allowed("embedded-remote-child", &http), + Some(false) + ); let record = views.reserve(OWNER, "browser-child").unwrap(); assert!(views.owned(OTHER, "browser-child").is_err()); assert!(views.owned(OWNER, "browser-missing").is_err()); @@ -70,6 +80,10 @@ fn failed_creation_rolls_back_only_its_exact_reservation() { #[test] fn native_creation_installs_protections_before_return_and_rolls_back_failure() { let app = mock_builder().build(mock_context(noop_assets())).unwrap(); + app.manage(StorageIdentity::new( + "dev".into(), + "/home/me/config.yaml".into(), + )); WebviewWindowBuilder::new(&app, OWNER, WebviewUrl::default()) .build() .unwrap(); @@ -202,3 +216,51 @@ fn owner_cleanup_removes_ready_and_pending_children_without_touching_other_owner views.close(app.handle(), OWNER, "browser-ready").unwrap(); assert!(app.get_webview(OWNER).is_some()); } +#[test] +fn storage_identifiers_share_only_the_same_full_identity_and_domain() { + let storage = Storage::from(browser_storage(std::path::Path::new("profile/browser"))); + assert_eq!( + storage.directory, + std::path::Path::new("profile/browser/shared-v1") + ); + assert_eq!(storage.domain, "browser/shared-v1"); + let identity = super::StorageIdentity::new("dev".into(), "/home/me/config.yaml".into()); + let id = identity.identifier("browser/shared-v1"); + assert_eq!( + id, + [ + 0xf8, 0x14, 0x9e, 0x7f, 0x1a, 0x96, 0x3c, 0x98, 0xdd, 0x87, 0xcc, 0xfa, 0x46, 0x6b, + 0x6f, 0xad + ] + ); + assert_eq!(id, identity.identifier("browser/shared-v1")); + assert_ne!(id, identity.identifier("local")); + assert_ne!(id, identity.identifier("remote/server")); + assert_ne!( + id, + super::StorageIdentity::new("stable".into(), "/home/me/config.yaml".into()) + .identifier("browser/shared-v1") + ); + assert_ne!( + id, + super::StorageIdentity::new("dev".into(), "/home/other/config.yaml".into()) + .identifier("browser/shared-v1") + ); + // Length framing also separates identities containing the delimiter used by older stores. + assert_ne!( + super::StorageIdentity::new("a\0b".into(), "c".into()).identifier("browser/shared-v1"), + super::StorageIdentity::new("a".into(), "b\0c".into()).identifier("browser/shared-v1"), + ); + use sha2::{Digest, Sha256}; + let app_store: [u8; 16] = Sha256::digest(b"local")[..16].try_into().unwrap(); + assert_ne!(id, app_store); + let cwd = std::path::Path::new("/home/me"); + let home = std::path::Path::new("/home/me"); + let normalized = |path| crate::identity::normalize_config_identity(Some(path), cwd, home); + assert_eq!( + super::StorageIdentity::new("dev".into(), normalized("config.json")) + .identifier("browser/shared-v1"), + super::StorageIdentity::new("dev".into(), normalized("./config.yaml")) + .identifier("browser/shared-v1"), + ); +} diff --git a/packages/tauri-app/src-tauri/src/main.rs b/packages/tauri-app/src-tauri/src/main.rs index ef6c2c1550..5dd4bb203d 100644 --- a/packages/tauri-app/src-tauri/src/main.rs +++ b/packages/tauri-app/src-tauri/src/main.rs @@ -1869,6 +1869,10 @@ fn main() { .plugin(tauri_plugin_notification::init()) .plugin(navigation_guard) .manage(browser_controller.embedded_views.clone()) + .manage(embedded_view::StorageIdentity::new( + scope.profile.clone(), + scope.config_identity.clone(), + )) .manage(local_windows::LocalWindows::default()) .manage(notification_badge::NotificationBadge::default()) .manage(window_constraints::WindowConstraints::default()) diff --git a/packages/tauri-app/src-tauri/tauri.conf.json b/packages/tauri-app/src-tauri/tauri.conf.json index 18ebc998c4..24a57b1afb 100644 --- a/packages/tauri-app/src-tauri/tauri.conf.json +++ b/packages/tauri-app/src-tauri/tauri.conf.json @@ -25,7 +25,7 @@ "active": true, "copyright": "Copyright © 2025-2026 CodeNomad contributors", "macOS": { - "minimumSystemVersion": "13.5" + "minimumSystemVersion": "14.0" }, "linux": { "deb": { diff --git a/packages/tauri-app/tests/embedded-webkit-security.test.mjs b/packages/tauri-app/tests/embedded-webkit-security.test.mjs new file mode 100644 index 0000000000..5e72214a80 --- /dev/null +++ b/packages/tauri-app/tests/embedded-webkit-security.test.mjs @@ -0,0 +1,20 @@ +import assert from "node:assert/strict" +import { readFileSync } from "node:fs" +import test from "node:test" + +const read = (file) => readFileSync(new URL(file, import.meta.url), "utf8") + +test("WKWebView permission denial is installed from the reserved instance label", () => { + const runtime = read("../vendor/tauri-runtime-wry-2.10.1/src/lib.rs") + const webview = read("../vendor/wry-0.54.4/src/wkwebview/mod.rs") + const delegate = read("../vendor/wry-0.54.4/src/wkwebview/class/wry_web_view_ui_delegate.rs") + assert.match(runtime, /\.with_id\(&label\)/) + assert.match(webview, /WryWebViewUIDelegate::new\([\s\S]*?webview_id.starts_with\("browser-"\) \|\| webview_id.starts_with\("embedded-remote-"\)/) + assert.match(delegate, /deny_permissions: bool/) + assert.match(delegate, /request_media_capture_permission[\s\S]*?self.ivars\(\).deny_permissions[\s\S]*?WKPermissionDecision::Deny[\s\S]*?WKPermissionDecision::Grant/) +}) + +test("Linux installs an unconditional native permission denial", () => { + const adapter = read("../src-tauri/src/embedded_view/linux.rs") + assert.match(adapter, /connect_permission_request\(\|_, request\|\s*\{\s*request.deny\(\);\s*true/) +}) diff --git a/packages/tauri-app/vendor/README.md b/packages/tauri-app/vendor/README.md index 9adbca182b..94aaefd21c 100644 --- a/packages/tauri-app/vendor/README.md +++ b/packages/tauri-app/vendor/README.md @@ -1,4 +1,54 @@ -# Tao native window backports +# Native runtime patches + +## Embedded WebKit views + +`tauri-runtime-wry-2.10.1/` and `wry-0.54.4/` are complete published +MIT/Apache-2.0 crates, including licenses, selected through `[patch.crates-io]`. + +- Crates: https://static.crates.io/crates/tauri-runtime-wry/tauri-runtime-wry-2.10.1.crate + and https://static.crates.io/crates/wry/wry-0.54.4.crate. +- Published SHA-256: runtime `e11ea2e6f801d275fdd890d6c9603736012742a1c33b96d0db788c9cdebf7f9e`; + Wry `e5a8135d8676225e5744de000d4dff5a082501bf7db6a1c1495034f8c314edbc`. +- GTK: the runtime lazily installs a window-owned `GtkOverlay` inside Tao's + content box, below its menu bar. Primary content stays boxed; child webviews use + `GtkFixed`. The overlay passes uncovered input through to the primary view. + Primary-only windows keep their ordinary box. Reparenting uses the destination + window's own child container. +- Wry stores child positions in `GtkFixed` and sizes in GTK size requests, alongside + immediate allocation, so resize/menu/hide-show allocations keep the rectangle. + Bounds follow the actual parent after reparenting. IPC callbacks keep weak + WebView references so destruction releases both the view and its IPC manager. +- WKWebView: the runtime supplies `with_id(&label)` to Wry. During construction, + Wry derives a delegate-local `deny_permissions` flag for `browser-` and + `embedded-remote-` labels. Camera/microphone requests are + denied. File-upload panels retain their user-driven selection. Application views retain + media grants and upload behavior. +- Permission inventory: Wry's WKUIDelegate implements media capture and + upload decisions. New-window and download decisions use consumer callbacks. + The public motion permission callback is unavailable on macOS. Location and web + notifications have no grant handler in this delegate. Display-capture permission + depends on the engine's default handling. Storage Access API + consent depends on tracking-prevention settings; storage-access grants also have + an automatic cookie-policy path. These routes bypass the public media callback. + Keep the macOS renderer path gated pending native qualification of supported OS + versions; use the iframe fallback if those defaults permit native requests. + Never substitute JavaScript rejection shims for native permission enforcement, + add a global permission denial or replace the delegate after construction. + +Keep these overrides until the resolved upstream runtime supports the same child +layout, persistent geometry and per-instance permission policy. Requalify both GTK +backends and macOS permission behavior before removing either override. + +The Linux native regression is +`python3 tauri-runtime-wry-2.10.1/examples/gtk-child-trial.py` from this directory, +with the GNOME session environment, Cargo dependencies cached and `python3-dbus` +installed. It compiles through a temporary manifest using the actual runtime layout +module and vendored Wry, then exercises Wayland and X11 with Mutter-seat input: +rectangles, relayout, menus, reparenting, hide/show, independent owning windows, +destruction, permission/download denial and distinct persistent data managers. +Full application checks additionally exercise Tauri's dispatch integration. + +## Tao native window backports `tao-0.34.6/` is the published Apache-2.0 crate (license included), with the Windows input backport from upstream [tao#1215], the macOS diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/.cargo_vcs_info.json b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/.cargo_vcs_info.json new file mode 100644 index 0000000000..95be1ed5fa --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "9b17a7aeae9a83222ffe829aa4e2d8a5ba6bed8c" + }, + "path_in_vcs": "crates/tauri-runtime-wry" +} \ No newline at end of file diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/Cargo.lock b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/Cargo.lock new file mode 100644 index 0000000000..42f4882279 --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/Cargo.lock @@ -0,0 +1,3661 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" + +[[package]] +name = "atk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" +dependencies = [ + "atk-sys", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2 0.5.2", +] + +[[package]] +name = "block2" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d59b4c170e16f0405a2e95aff44432a0d41aa97675f3d52623effe95792a037" +dependencies = [ + "objc2 0.6.0", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytemuck" +version = "1.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "cairo-rs" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" +dependencies = [ + "bitflags 2.7.0", + "cairo-sys-rs", + "glib", + "libc", + "once_cell", + "thiserror 1.0.69", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "cc" +version = "1.2.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a0aeaff4ff1a90589618835a598e545176939b97874f7abc7851caa0618f203" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" +dependencies = [ + "byteorder", + "fnv", + "uuid", +] + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "serde", + "windows-link", +] + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "time", + "version_check", +] + +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" +dependencies = [ + "bitflags 2.7.0", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" +dependencies = [ + "bitflags 2.7.0", + "core-foundation", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cssparser" +version = "0.29.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93d03419cb5950ccfd3daf3ff1c7a36ace64609a1a8746d493df1ca0afde0fa" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "matches", + "phf 0.10.1", + "proc-macro2", + "quote", + "smallvec", + "syn 1.0.109", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +dependencies = [ + "quote", + "syn 2.0.117", +] + +[[package]] +name = "ctor" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" +dependencies = [ + "quote", + "syn 2.0.117", +] + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.117", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derive_more" +version = "0.99.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.117", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.60.2", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "dlopen2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b54f373ccf864bf587a89e880fb7610f8d73f3045f13580948ccbcaff26febff" +dependencies = [ + "dlopen2_derive", + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "dlopen2_derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "dpi" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" +dependencies = [ + "serde", +] + +[[package]] +name = "dtoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" + +[[package]] +name = "dtoa-short" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "erased-serde" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89e8918065695684b2b0702da20382d5ae6065cf3327bc2d6436bd49a71ce9f3" +dependencies = [ + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset", + "rustc_version", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645cbb3a84e60b7531617d5ae4e57f7e27308f6445f5abf653209ea76dec8dff" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "gdk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" +dependencies = [ + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", + "once_cell", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gdk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkwayland-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140071d506d223f7572b9f09b5e155afbd77428cd5cc7af8f2694c41d98dfe69" +dependencies = [ + "gdk-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkx11" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3caa00e14351bebbc8183b3c36690327eb77c49abc2268dd4bd36b856db3fbfe" +dependencies = [ + "gdk", + "gdkx11-sys", + "gio", + "glib", + "libc", + "x11", +] + +[[package]] +name = "gdkx11-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e7445fe01ac26f11601db260dd8608fe172514eb63b3b5e261ea6b0f4428d" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps", + "x11", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gio" +version = "0.18.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys", + "glib", + "libc", + "once_cell", + "pin-project-lite", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "gio-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "winapi", +] + +[[package]] +name = "glib" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" +dependencies = [ + "bitflags 2.7.0", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "memchr", + "once_cell", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "glib-macros" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate 2.0.0", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "glib-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "gobject-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gtk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" +dependencies = [ + "atk", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "gtk3-macros" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "html5ever" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b7410cae13cbc75623c98ac4cbfd1f0bedddf3227afc24f370cf0f50a44a11c" +dependencies = [ + "log", + "mac", + "markup5ever", + "match_token", +] + +[[package]] +name = "http" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core 0.52.0", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", + "serde", + "serde_core", +] + +[[package]] +name = "infer" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a588916bfdfd92e71cacef98a63d9b1f0d74d6599980d11894290e7ddefffcf7" +dependencies = [ + "cfb", +] + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "javascriptcore-rs" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" +dependencies = [ + "bitflags 1.3.2", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "js-sys" +version = "0.3.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "863726d7afb6bc2590eeff7135d923545e5e964f004c2ccf8716c25e70a86f08" +dependencies = [ + "jsonptr", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "jsonptr" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dea2b27dd239b2556ed7a25ba842fe47fd602e7fc7433c2a8d6106d4d9edd70" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "kuchikiki" +version = "0.8.8-speedreader" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02cb977175687f33fa4afa0c95c112b987ea1443e5a51c8f8ff27dc618270cc2" +dependencies = [ + "cssparser", + "html5ever", + "indexmap 2.11.4", + "selectors", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.7.0", + "libc", +] + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "markup5ever" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a7213d12e1864c0f002f52c2923d4556935a43dec5e71355c2760e0f6e7a18" +dependencies = [ + "log", + "phf 0.11.3", + "phf_codegen 0.11.3", + "string_cache", + "string_cache_codegen", + "tendril", +] + +[[package]] +name = "match_token" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a9689d8d44bf9964484516275f5cd4c9b59457a6940c1d5d0ecbb94510a36b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.7.0", + "jni-sys", + "log", + "ndk-sys", + "num_enum", + "raw-window-handle", + "thiserror 1.0.69", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3531f65190d9cff863b77a99857e74c314dd16bf56c538c4b57c7cbc3f3a6e59" +dependencies = [ + "objc2-encode", + "objc2-exception-helper", +] + +[[package]] +name = "objc2-app-kit" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5906f93257178e2f7ae069efb89fbd6ee94f0592740b5f8a1512ca498814d0fb" +dependencies = [ + "bitflags 2.7.0", + "block2 0.6.0", + "objc2 0.6.0", + "objc2-core-foundation", + "objc2-foundation 0.3.0", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daeaf60f25471d26948a1c2f840e3f7d86f4109e3af4e8e4b5cd70c39690d925" +dependencies = [ + "bitflags 2.7.0", + "objc2 0.6.0", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-exception-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a1c5fbb72d7735b076bb47b578523aedc40f3c439bea6dfd595c089d79d98a" +dependencies = [ + "cc", +] + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.7.0", + "block2 0.5.1", + "libc", + "objc2 0.5.2", +] + +[[package]] +name = "objc2-foundation" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a21c6c9014b82c39515db5b396f91645182611c97d24637cf56ac01e5f8d998" +dependencies = [ + "bitflags 2.7.0", + "objc2 0.6.0", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.7.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.7.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", + "objc2-metal", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "777a571be14a42a3990d4ebedaeb8b54cd17377ec21b92e8200ac03797b3bee1" +dependencies = [ + "bitflags 2.7.0", + "objc2 0.6.0", + "objc2-core-foundation", + "objc2-foundation 0.3.0", +] + +[[package]] +name = "objc2-web-kit" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b717127e4014b0f9f3e8bba3d3f2acec81f1bde01f656823036e823ed2c94dce" +dependencies = [ + "bitflags 2.7.0", + "block2 0.6.0", + "objc2 0.6.0", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation 0.3.0", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "pango" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" +dependencies = [ + "gio", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +dependencies = [ + "phf_shared 0.8.0", +] + +[[package]] +name = "phf" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +dependencies = [ + "phf_macros 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", +] + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros 0.11.3", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", +] + +[[package]] +name = "phf_codegen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +dependencies = [ + "phf_shared 0.8.0", + "rand 0.7.3", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared 0.10.0", + "rand 0.8.5", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared 0.11.3", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +dependencies = [ + "siphasher 0.3.11", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher 0.3.11", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher 1.0.1", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +dependencies = [ + "toml_edit 0.20.7", +] + +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit 0.22.24", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "1.0.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + +[[package]] +name = "redox_syscall" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +dependencies = [ + "bitflags 2.7.0", +] + +[[package]] +name = "redox_users" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" +dependencies = [ + "getrandom 0.2.15", + "libredox", + "thiserror 2.0.12", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "selectors" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c37578180969d00692904465fb7f6b3d50b9a2b952b87c23d0e2e5cb5013416" +dependencies = [ + "bitflags 1.3.2", + "cssparser", + "derive_more", + "fxhash", + "log", + "phf 0.8.0", + "phf_codegen 0.8.0", + "precomputed-hash", + "servo_arc", + "smallvec", +] + +[[package]] +name = "semver" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-untagged" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2676ba99bd82f75cae5cbd2c8eda6fa0b8760f18978ea840e980dd5567b5c5b6" +dependencies = [ + "erased-serde", + "serde", + "typeid", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serde_json" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", + "serde_core", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_spanned" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_with" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" +dependencies = [ + "base64", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.11.4", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "servo_arc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52aa42f8fdf0fed91e5ce7f23d8138441002fa31dca008acf47e6fd4721f741" +dependencies = [ + "nodrop", + "stable_deref_trait", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "softbuffer" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18051cdd562e792cad055119e0cdb2cfc137e44e3987532e0f9659a77931bb08" +dependencies = [ + "bytemuck", + "cfg_aliases", + "core-graphics", + "foreign-types", + "js-sys", + "log", + "objc2 0.5.2", + "objc2-foundation 0.2.2", + "objc2-quartz-core", + "raw-window-handle", + "redox_syscall", + "wasm-bindgen", + "web-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "soup3" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" +dependencies = [ + "futures-channel", + "gio", + "glib", + "libc", + "soup3-sys", +] + +[[package]] +name = "soup3-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared 0.10.0", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro2", + "quote", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck 0.5.0", + "pkg-config", + "toml 0.8.20", + "version-compare", +] + +[[package]] +name = "tao" +version = "0.34.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a753bdc39c07b192151523a3f77cd0394aa75413802c883a0f6f6a0e5ee2e7" +dependencies = [ + "bitflags 2.7.0", + "block2 0.6.0", + "core-foundation", + "core-graphics", + "crossbeam-channel", + "dispatch", + "dlopen2", + "dpi", + "gdkwayland-sys", + "gdkx11-sys", + "gtk", + "jni", + "lazy_static", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "objc2 0.6.0", + "objc2-app-kit", + "objc2-foundation 0.3.0", + "once_cell", + "parking_lot", + "raw-window-handle", + "scopeguard", + "tao-macros", + "unicode-segmentation", + "url", + "windows", + "windows-core 0.61.0", + "windows-version", + "x11-dl", +] + +[[package]] +name = "tao-macros" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "tauri-runtime" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2826d79a3297ed08cd6ea7f412644ef58e32969504bc4fbd8d7dbeabc4445ea2" +dependencies = [ + "cookie", + "dpi", + "gtk", + "http", + "jni", + "objc2 0.6.0", + "objc2-ui-kit", + "objc2-web-kit", + "raw-window-handle", + "serde", + "serde_json", + "tauri-utils", + "thiserror 2.0.12", + "url", + "webkit2gtk", + "webview2-com", + "windows", +] + +[[package]] +name = "tauri-runtime-wry" +version = "2.10.1" +dependencies = [ + "gtk", + "http", + "jni", + "log", + "objc2 0.6.0", + "objc2-app-kit", + "once_cell", + "percent-encoding", + "raw-window-handle", + "softbuffer", + "tao", + "tauri-runtime", + "tauri-utils", + "tracing", + "url", + "webkit2gtk", + "webview2-com", + "windows", + "wry", +] + +[[package]] +name = "tauri-utils" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219a1f983a2af3653f75b5747f76733b0da7ff03069c7a41901a5eb3ace4557d" +dependencies = [ + "anyhow", + "ctor", + "dunce", + "glob", + "http", + "infer", + "json-patch", + "log", + "memchr", + "phf 0.11.3", + "regex", + "semver", + "serde", + "serde-untagged", + "serde_json", + "serde_with", + "thiserror 2.0.12", + "toml 0.9.10+spec-1.1.0", + "url", + "urlpattern", + "uuid", +] + +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "time" +version = "0.3.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "toml" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" +dependencies = [ + "serde", + "serde_spanned 0.6.8", + "toml_datetime 0.6.8", + "toml_edit 0.22.24", +] + +[[package]] +name = "toml" +version = "0.9.10+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0825052159284a1a8b4d6c0c86cbc801f2da5afd2b225fa548c72f2e74002f48" +dependencies = [ + "indexmap 2.11.4", + "serde_core", + "serde_spanned 1.0.4", + "toml_datetime 0.7.5+spec-1.1.0", + "toml_parser", + "toml_writer", + "winnow 0.7.14", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.11.4", + "toml_datetime 0.6.8", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap 2.11.4", + "toml_datetime 0.6.8", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +dependencies = [ + "indexmap 2.11.4", + "serde", + "serde_spanned 0.6.8", + "toml_datetime 0.6.8", + "winnow 0.7.14", +] + +[[package]] +name = "toml_parser" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" +dependencies = [ + "winnow 0.7.14", +] + +[[package]] +name = "toml_writer" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", +] + +[[package]] +name = "typeid" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unic-char-property" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" +dependencies = [ + "unic-char-range", +] + +[[package]] +name = "unic-char-range" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" + +[[package]] +name = "unic-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" + +[[package]] +name = "unic-ucd-ident" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" +dependencies = [ + "unic-char-property", + "unic-char-range", + "unic-ucd-version", +] + +[[package]] +name = "unic-ucd-version" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" +dependencies = [ + "unic-common", +] + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "urlpattern" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70acd30e3aa1450bc2eece896ce2ad0d178e9c079493819301573dae3c37ba6d" +dependencies = [ + "regex", + "serde", + "unic-ucd-ident", + "url", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +dependencies = [ + "serde", +] + +[[package]] +name = "version-compare" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.117", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webkit2gtk" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1027150013530fb2eaf806408df88461ae4815a45c541c8975e61d6f2fc4793" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup3", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "916a5f65c2ef0dfe12fff695960a2ec3d4565359fdbb2e9943c974e06c734ea5" +dependencies = [ + "bitflags 1.3.2", + "cairo-sys-rs", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pkg-config", + "soup3-sys", + "system-deps", +] + +[[package]] +name = "webview2-com" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ba622a989277ef3886dd5afb3e280e3dd6d974b766118950a08f8f678ad6a4" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows", + "windows-core 0.61.0", + "windows-implement", + "windows-interface", +] + +[[package]] +name = "webview2-com-macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d228f15bba3b9d56dde8bddbee66fa24545bd17b48d5128ccf4a8742b18e431" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "webview2-com-sys" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36695906a1b53a3bf5c4289621efedac12b73eeb0b89e7e1a89b517302d5d75c" +dependencies = [ + "thiserror 2.0.12", + "windows", + "windows-core 0.61.0", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.61.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419" +dependencies = [ + "windows-collections", + "windows-core 0.61.0", + "windows-future", + "windows-link", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.0", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a1d6bbefcb7b60acd19828e1bc965da6fcf18a7e39490c5f8be71e54a19ba32" +dependencies = [ + "windows-core 0.61.0", + "windows-link", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.0", + "windows-link", +] + +[[package]] +name = "windows-result" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows-version" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c12476c23a74725c539b24eae8bfc0dac4029c39cdb561d9f23616accd4ae26d" +dependencies = [ + "windows-targets 0.53.2", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" +dependencies = [ + "memchr", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "wry" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e456eeaf7f09413fdc16799782879b2b9f1d264dfdbce4cf7e924df0ef36afb9" +dependencies = [ + "base64", + "block2 0.6.0", + "cookie", + "crossbeam-channel", + "dirs", + "dpi", + "dunce", + "gdkx11", + "gtk", + "html5ever", + "http", + "javascriptcore-rs", + "jni", + "kuchikiki", + "libc", + "ndk", + "objc2 0.6.0", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation 0.3.0", + "objc2-ui-kit", + "objc2-web-kit", + "once_cell", + "percent-encoding", + "raw-window-handle", + "sha2", + "soup3", + "tao-macros", + "thiserror 2.0.12", + "tracing", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows", + "windows-core 0.61.0", + "windows-version", + "x11-dl", +] + +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/Cargo.toml b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/Cargo.toml new file mode 100644 index 0000000000..e09e23aa09 --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/Cargo.toml @@ -0,0 +1,148 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2021" +rust-version = "1.77.2" +name = "tauri-runtime-wry" +version = "2.10.1" +authors = ["Tauri Programme within The Commons Conservancy"] +build = "build.rs" +exclude = [ + "CHANGELOG.md", + "/target", +] +autolib = false +autobins = false +autoexamples = false +autotests = false +autobenches = false +description = "Wry bindings to the Tauri runtime" +homepage = "https://tauri.app/" +readme = "README.md" +categories = [ + "gui", + "web-programming", +] +license = "Apache-2.0 OR MIT" +repository = "https://github.com/tauri-apps/tauri" + +[features] +common-controls-v6 = [] +default = ["x11"] +devtools = [ + "wry/devtools", + "tauri-runtime/devtools", +] +macos-private-api = [ + "wry/fullscreen", + "wry/transparent", + "tauri-runtime/macos-private-api", +] +macos-proxy = ["wry/mac-proxy"] +objc-exception = [] +tracing = [ + "dep:tracing", + "wry/tracing", +] +unstable = [] +x11 = [ + "tao/x11", + "wry/x11", +] + +[lib] +name = "tauri_runtime_wry" +path = "src/lib.rs" + +[dependencies.http] +version = "1" + +[dependencies.log] +version = "0.4.21" + +[dependencies.raw-window-handle] +version = "0.6" + +[dependencies.tao] +version = "0.34.5" +features = ["rwh_06"] +default-features = false + +[dependencies.tauri-runtime] +version = "2.10.1" + +[dependencies.tauri-utils] +version = "2.8.3" + +[dependencies.tracing] +version = "0.1" +optional = true + +[dependencies.url] +version = "2" + +[dependencies.wry] +version = "0.54.0" +features = [ + "drag-drop", + "protocol", + "os-webview", + "linux-body", +] +default-features = false + +[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies.gtk] +version = "0.18" +features = ["v3_24"] + +[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies.percent-encoding] +version = "2" + +[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies.webkit2gtk] +version = "=2.0" +features = ["v2_40"] + +[target.'cfg(target_os = "android")'.dependencies.jni] +version = "0.21" + +[target.'cfg(target_os = "macos")'.dependencies.objc2-app-kit] +version = "0.3" +features = [ + "block2", + "NSApplication", + "NSResponder", + "NSView", + "NSWindow", + "NSScreen", + "NSGraphics", +] +default-features = false + +[target.'cfg(target_vendor = "apple")'.dependencies.objc2] +version = "0.6" + +[target."cfg(windows)".dependencies.once_cell] +version = "1.20" + +[target."cfg(windows)".dependencies.softbuffer] +version = "0.4" +default-features = false + +[target."cfg(windows)".dependencies.webview2-com] +version = "0.38" + +[target."cfg(windows)".dependencies.windows] +version = "0.61" +features = [ + "Win32_Foundation", + "Win32_Graphics_Dwm", +] diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/Cargo.toml.orig b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/Cargo.toml.orig new file mode 100644 index 0000000000..10ad16be18 --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/Cargo.toml.orig @@ -0,0 +1,76 @@ +[package] +name = "tauri-runtime-wry" +version = "2.10.1" +description = "Wry bindings to the Tauri runtime" +exclude = ["CHANGELOG.md", "/target"] +readme = "README.md" +authors.workspace = true +homepage.workspace = true +repository.workspace = true +categories.workspace = true +license.workspace = true +edition.workspace = true +rust-version.workspace = true + +[dependencies] +wry = { version = "0.54.0", default-features = false, features = [ + "drag-drop", + "protocol", + "os-webview", + "linux-body", +] } +tao = { version = "0.34.5", default-features = false, features = ["rwh_06"] } +tauri-runtime = { version = "2.10.1", path = "../tauri-runtime" } +tauri-utils = { version = "2.8.3", path = "../tauri-utils" } +raw-window-handle = "0.6" +http = "1" +url = "2" +tracing = { version = "0.1", optional = true } +log = "0.4.21" + +[target."cfg(windows)".dependencies] +webview2-com = "0.38" +softbuffer = { version = "0.4", default-features = false } +once_cell = "1.20" + +[target."cfg(windows)".dependencies.windows] +version = "0.61" +features = ["Win32_Foundation", "Win32_Graphics_Dwm"] + +[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] +gtk = { version = "0.18", features = ["v3_24"] } +webkit2gtk = { version = "=2.0", features = ["v2_40"] } +percent-encoding = "2" + +[target.'cfg(target_vendor = "apple")'.dependencies] +objc2 = "0.6" + +[target.'cfg(target_os = "macos")'.dependencies] +objc2-app-kit = { version = "0.3", default-features = false, features = [ + "block2", + "NSApplication", + "NSResponder", + "NSView", + "NSWindow", + "NSScreen", + "NSGraphics", +] } + +[target."cfg(target_os = \"android\")".dependencies] +jni = "0.21" + +[features] +default = ["x11"] +devtools = ["wry/devtools", "tauri-runtime/devtools"] +x11 = ["tao/x11", "wry/x11"] +macos-private-api = [ + "wry/fullscreen", + "wry/transparent", + "tauri-runtime/macos-private-api", +] +# TODO: Remove in v3 - wry does not have this feature anymore +objc-exception = [] +tracing = ["dep:tracing", "wry/tracing"] +macos-proxy = ["wry/mac-proxy"] +unstable = [] +common-controls-v6 = [] diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/LICENSE_APACHE-2.0 b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/LICENSE_APACHE-2.0 new file mode 100644 index 0000000000..f433b1a53f --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/LICENSE_APACHE-2.0 @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/LICENSE_MIT b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/LICENSE_MIT new file mode 100644 index 0000000000..b08530d594 --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/LICENSE_MIT @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 - Present Tauri Apps Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/README.md b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/README.md new file mode 100644 index 0000000000..a452527bc3 --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/README.md @@ -0,0 +1,44 @@ +# tauri-runtime-wry + + + +[![status](https://img.shields.io/badge/Status-Beta-green.svg)](https://github.com/tauri-apps/tauri) +[![Chat Server](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/SpmNs4S) + +[![test core](https://img.shields.io/github/actions/workflow/status/tauri-apps/tauri/test-core.yml?label=test%20core&logo=github)](https://github.com/tauri-apps/tauri/actions/workflows/test-core.yml) +[![website](https://img.shields.io/badge/website-tauri.app-purple.svg)](https://tauri.app) + +[![https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg](https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg)](https://good-labs.github.io/greater-good-affirmation) +[![support](https://img.shields.io/badge/sponsor-Opencollective-blue.svg)](https://opencollective.com/tauri) + +| Component | Version | +| ----------------- | ---------------------------------------------------------------------------------------------------------------------- | +| tauri-runtime-wry | [![](https://img.shields.io/crates/v/tauri-runtime-wry?style=flat-square)](https://crates.io/crates/tauri-runtime-wry) | + +## About Tauri + +Tauri is a polyglot and generic system that is very composable and allows engineers to make a wide variety of applications. It is used for building applications for Desktop Computers using a combination of Rust tools and HTML rendered in a Webview. Apps built with Tauri can ship with any number of pieces of an optional JS API / Rust API so that webviews can control the system via message passing. In fact, developers can extend the default API with their own functionality and bridge the Webview and Rust-based backend easily. + +Tauri apps can have custom menus and have tray-type interfaces. They can be updated, and are managed by the user's operating system as expected. They are very small, because they use the system's webview. They do not ship a runtime, since the final binary is compiled from rust. This makes the reversing of Tauri apps not a trivial task. + +## This module + +This crate opens up direct systems-level interactions specifically for WRY, such as printing, monitor detection, and other windowing related tasks. `tauri-runtime` implementation for WRY. +None of the exposed API of this crate is stable, and it may break semver +compatibility in the future. The major version only signifies the intended Tauri version. + +To learn more about the details of how all of these pieces fit together, please consult this [ARCHITECTURE.md](https://github.com/tauri-apps/tauri/blob/dev/ARCHITECTURE.md) document. + +## Semver + +**tauri** is following [Semantic Versioning 2.0](https://semver.org/). + +## Licenses + +Code: (c) 2021 - The Tauri Programme within The Commons Conservancy. + +MIT or MIT/Apache 2.0 where applicable. + +Logo: CC-BY-NC-ND + +- Original Tauri Logo Designs by [Daniel Thompson-Yvetot](https://github.com/nothingismagick) and [Guillaume Chau](https://github.com/akryum) diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/build.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/build.rs new file mode 100644 index 0000000000..9974c5040b --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/build.rs @@ -0,0 +1,19 @@ +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +// creates a cfg alias if `has_feature` is true. +// `alias` must be a snake case string. +fn alias(alias: &str, has_feature: bool) { + println!("cargo:rustc-check-cfg=cfg({alias})"); + if has_feature { + println!("cargo:rustc-cfg={alias}"); + } +} + +fn main() { + let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); + let mobile = target_os == "ios" || target_os == "android"; + alias("desktop", !mobile); + alias("mobile", mobile); +} diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/examples/gtk-child-layout.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/examples/gtk-child-layout.rs new file mode 100644 index 0000000000..3206904949 --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/examples/gtk-child-layout.rs @@ -0,0 +1,223 @@ +// Native Linux regression. Run in a graphical session with GDK_BACKEND=x11 and +// GDK_BACKEND=wayland. This example uses the runtime's actual layout helper. +use gtk::prelude::*; +use std::{cell::Cell, time::Duration}; +use webkit2gtk::{PermissionRequestExt, WebContextExt, WebViewExt, WebsiteDataManagerExt}; +use wry::{ + dpi::{LogicalPosition, LogicalSize}, + Rect, WebContext, WebViewBuilder, WebViewBuilderExtUnix, WebViewExtUnix, +}; +#[path = "../src/gtk_child_layout.rs"] +mod gtk_child_layout; + +fn main() { + gtk::init().unwrap(); + let data = std::path::PathBuf::from(std::env::var("XDG_DATA_HOME").unwrap()); + let app_data = data.join("config-A/app"); + let preview_data = data.join("config-A/browser/shared-v1"); + let other_data = data.join("config-B/browser/shared-v1"); + for path in [&app_data, &preview_data, &other_data] { + std::fs::create_dir_all(path).unwrap(); + } + let mut app_context = WebContext::new(Some(app_data.clone())); + let mut preview_context = WebContext::new(Some(preview_data.clone())); + let mut other_context = WebContext::new(Some(other_data.clone())); + let window = gtk::Window::new(gtk::WindowType::Toplevel); + window.set_title("CodeNomad GTK child trial"); + window.set_default_size(800, 600); + let vbox = gtk::Box::new(gtk::Orientation::Vertical, 0); + let menu = gtk::Label::new(Some("Menu outside content")); + menu.set_size_request(-1, 40); + vbox.pack_start(&menu, false, false, 0); + window.add(&vbox); + let page = |name: &str| { + format!( + r#"

{name}

"#, + if name == "main" { "#ddeeff" } else { "#ffddaa" } + ) + }; + let main = WebViewBuilder::new_with_web_context(&mut app_context) + .with_html(page("main")) + .with_ipc_handler(|r| println!("{}", r.body())) + .build_gtk(>k_child_layout::content(&vbox)) + .unwrap(); + assert_eq!(vbox.children().len(), 2); + window.show_all(); + // Exercise installation after the primary view has been realized and loaded. + gtk::glib::timeout_add_local_once(Duration::from_secs(2), gtk::main_quit); + gtk::main(); + let (content, fixed) = gtk_child_layout::containers(&vbox); + assert_eq!(fixed, gtk_child_layout::containers(&vbox).1); + let child = WebViewBuilder::new_with_web_context(&mut preview_context) + .with_html(page("child")) + .with_bounds(Rect { + position: LogicalPosition::new(100, 80).into(), + size: LogicalSize::new(300, 200).into(), + }) + .with_ipc_handler(|r| println!("{}", r.body())) + .with_download_started_handler(|url, path| { + println!("DOWNLOAD_DENIED {url}"); + println!("DOWNLOAD_DESTINATION {}", path.display()); + false + }) + .build_gtk(&fixed) + .unwrap(); + child.webview().connect_permission_request(|_, request| { + println!("PERMISSION_DENIED {}", request.type_().name()); + request.deny(); + true + }); + let other_box = gtk::Box::new(gtk::Orientation::Vertical, 0); + let other = WebViewBuilder::new_with_web_context(&mut other_context) + .build_gtk(&other_box) + .unwrap(); + for (view, path) in [ + (&main, &app_data), + (&child, &preview_data), + (&other, &other_data), + ] { + let manager = view + .webview() + .context() + .unwrap() + .website_data_manager() + .unwrap(); + assert_eq!( + manager.base_data_directory().unwrap().as_str(), + path.to_str().unwrap() + ); + assert!(!manager.is_ephemeral()); + println!("PERSISTENT_STORE {}", path.display()); + } + if let Ok(url) = std::env::var("GTK_TRIAL_URL") { + child.load_url(&url).unwrap(); + } + window.show_all(); + let b_window = gtk::Window::new(gtk::WindowType::Toplevel); + b_window.set_title("CodeNomad GTK independent owner B"); + b_window.set_default_size(700, 500); + let b_vbox = gtk::Box::new(gtk::Orientation::Vertical, 0); + let b_menu = gtk::Label::new(Some("Owner B menu")); + b_menu.set_size_request(-1, 60); + b_vbox.pack_start(&b_menu, false, false, 0); + b_window.add(&b_vbox); + let b_main = WebViewBuilder::new_with_web_context(&mut app_context) + .with_html(page("main-B")) + .with_ipc_handler(|r| println!("{}", r.body())) + .build_gtk(>k_child_layout::content(&b_vbox)) + .unwrap(); + let (_, b_fixed) = gtk_child_layout::containers(&b_vbox); + assert_ne!(fixed, b_fixed); + let b_child = WebViewBuilder::new_with_web_context(&mut preview_context) + .with_bounds(Rect { + position: LogicalPosition::new(400, 200).into(), + size: LogicalSize::new(100, 80).into(), + }) + .with_html(page("child-B")) + .build_gtk(&b_fixed) + .unwrap(); + b_window.show_all(); + let weak_child = child.webview().downgrade(); + let weak_manager = child.webview().user_content_manager().unwrap().downgrade(); + let mut child = Some(child); + let step = Cell::new(0); + gtk::glib::timeout_add_local(Duration::from_secs(2), move || { + let n = step.get(); + let b_bounds = b_child.bounds().unwrap(); + assert_eq!( + b_bounds.position.to_logical::(1.0), + LogicalPosition::new(400, 200) + ); + assert_eq!( + b_bounds.size.to_logical::(1.0), + LogicalSize::new(100, 80) + ); + assert!(b_child.webview().is_visible()); + assert!(b_window.is_visible()); + println!("OWNER_B_STABLE phase={n} {b_bounds:?}"); + if let Some(child) = child.as_ref() { + let bounds = child.bounds().unwrap(); + println!( + "phase={n} child={bounds:?} content={:?} fixed={:?}", + content.allocation(), + fixed.allocation() + ); + if n < 6 { + let expected = if n == 0 { + (100, 80, 300, 200) + } else { + (140, 90, 280, 180) + }; + assert_eq!( + bounds.position.to_logical::(1.0), + LogicalPosition::new(expected.0, expected.1) + ); + assert_eq!( + bounds.size.to_logical::(1.0), + LogicalSize::new(expected.2, expected.3) + ); + } + match n { + 0 => { + child + .set_bounds(Rect { + position: LogicalPosition::new(140, 90).into(), + size: LogicalSize::new(280, 180).into(), + }) + .unwrap(); + assert_eq!( + child.bounds().unwrap().position.to_logical::(1.0), + LogicalPosition::new(140, 90) + ); + } + 1 => { + window.resize(900, 650); + child.set_visible(false).unwrap(); + } + 2 => { + child.reparent(&fixed).unwrap(); + child.set_visible(true).unwrap(); + menu.set_size_request(-1, 60); + } + 3 => { + window.present(); + window.fullscreen(); + println!("DISPLAY_SCALE {}", child.webview().scale_factor()); + println!("READY_FOR_CLICKS: main=(20,100), child=(180,200)"); + } + 5 => { + child.set_visible(false).unwrap(); + println!("HIDDEN_FOR_CLICKS"); + } + _ => {} + } + } + if n == 6 { + drop(child.take()); + b_window.present(); + b_window.fullscreen(); + println!("WINDOW_B_READY_FOR_CLICKS"); + } + if n == 7 { + window.close(); + assert!( + weak_child.upgrade().is_none(), + "child WebView retained after destruction" + ); + assert!( + weak_manager.upgrade().is_none(), + "child IPC manager retained after destruction" + ); + println!("OWNER_A_CHILD_RELEASED"); + } + if n == 9 { + let _ = (&main, &b_main); + b_window.close(); + gtk::main_quit(); + return gtk::glib::ControlFlow::Break; + } + step.set(n + 1); + gtk::glib::ControlFlow::Continue + }); + gtk::main(); +} diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/examples/gtk-child-trial.py b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/examples/gtk-child-trial.py new file mode 100644 index 0000000000..39554bafe3 --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/examples/gtk-child-trial.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python3 +"""Ubuntu GNOME native input trial: python3 gtk-child-trial.py [prebuilt-binary]. + +Requires python3-dbus and a logged-in GNOME session. Runs X11 and Wayland; +keeps logs in the current directory. Input goes through Mutter's native seat. +""" +import dbus +import http.server +import os +from pathlib import Path +import subprocess +import sys +import tempfile +import threading +import time + +if len(sys.argv) > 1: + binary = sys.argv[1] +else: + build = tempfile.TemporaryDirectory(prefix="gtk-child-build-") + root = Path(__file__).resolve().parents[2] + manifest = Path(build.name) / "Cargo.toml" + manifest.write_text(f'''[package] +name = "gtk-native-trial" +version = "0.1.0" +edition = "2021" +[[bin]] +name = "gtk-native-trial" +path = "{Path(__file__).with_name('gtk-child-layout.rs').resolve()}" +[dependencies] +gtk = "0.18" +webkit2gtk = "2.0.2" +wry = {{ path = "{root / 'wry-0.54.4'}" }} +''') + target = Path(os.environ.get("CARGO_TARGET_DIR", str(Path(build.name) / "target"))) + subprocess.run(["cargo", "build", "--offline", "--manifest-path", str(manifest), + "--target-dir", str(target)], check=True) + binary = str(target / "debug" / "gtk-native-trial") + + +class Handler(http.server.BaseHTTPRequestHandler): + def do_GET(self): + self.send_response(200) + if self.path == "/download": + self.send_header("Content-Disposition", 'attachment; filename="denied.txt"') + body = b"must never be saved" + else: + body = b'''

child

+''' + self.send_header("Content-Length", str(len(body))) + self.end_headers() + self.wfile.write(body) + + def log_message(self, *_): + pass + + +server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), Handler) +threading.Thread(target=server.serve_forever, daemon=True).start() +bus = dbus.SessionBus() +service = "org.gnome.Mutter.RemoteDesktop" +path = dbus.Interface(bus.get_object(service, "/org/gnome/Mutter/RemoteDesktop"), service).CreateSession() +seat = dbus.Interface(bus.get_object(service, path), service + ".Session") +seat.Start() +scale = 1 + + +def click(x, y): + seat.NotifyPointerMotionRelative(-10000., -10000.) + time.sleep(.1) + seat.NotifyPointerMotionRelative(float(x * scale), float(y * scale)) + time.sleep(.1) + # The first click can activate the new window; the second must reach HTML. + for _ in range(2): + seat.NotifyPointerButton(272, True) + seat.NotifyPointerButton(272, False) + time.sleep(.15) + + +try: + for backend in ("wayland", "x11"): + with tempfile.TemporaryDirectory(prefix="gtk-trial-") as storage: + env = dict(os.environ, GDK_BACKEND=backend, + WAYLAND_DISPLAY=os.environ.get("WAYLAND_DISPLAY", "wayland-0"), + DISPLAY=os.environ.get("DISPLAY", ":0"), + XDG_DATA_HOME=storage, XDG_CACHE_HOME=storage, + GTK_TRIAL_URL=f"http://127.0.0.1:{server.server_port}/") + # Use the current desktop's Xauthority instead of relying on a name. + authorities = list(Path(os.environ["XDG_RUNTIME_DIR"]).glob(".mutter-Xwaylandauth.*")) + if authorities: + env["XAUTHORITY"] = str(authorities[0]) + process = subprocess.Popen([binary], stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, text=True, env=env) + def kill_child(child=process): + try: + child.kill() + except ProcessLookupError: + pass + + watchdog = threading.Timer(60, kill_child) + watchdog.daemon = True + watchdog.start() + lines = [] + hidden_index = None + try: + for line in process.stdout: + print(backend, line, end="", flush=True) + lines.append(line) + if "DISPLAY_SCALE " in line: + scale = int(line.split("DISPLAY_SCALE ", 1)[1]) + if line.startswith("READY_FOR_CLICKS:"): + time.sleep(.8) + click(20, 100) + click(180, 200) + if "WINDOW_B_READY_FOR_CLICKS" in line: + time.sleep(.8) + click(20, 100) + if "HIDDEN_FOR_CLICKS" in line: + hidden_index = len(lines) + time.sleep(.3) + click(180, 200) + assert process.wait() == 0, backend + finally: + watchdog.cancel() + if process.poll() is None: + kill_child() + process.wait() + watchdog.join() + process.stdout.close() + text = "".join(lines) + Path(backend + ".log").write_text(text) + for expected in ("click main", "click child", "PERMISSION_DENIED", "geolocation denied 1", "DOWNLOAD_DENIED", "OWNER_A_CHILD_RELEASED", "OWNER_B_STABLE phase=9", "click main-B 20,40"): + assert expected in text, (backend, expected) + assert hidden_index is not None + assert "click main 180,140" in "".join(lines[hidden_index:]), backend + assert "UNEXPECTED_PERMISSION" not in text + stores = [line.split("PERSISTENT_STORE ", 1)[1].strip() + for line in lines if "PERSISTENT_STORE " in line] + assert len(stores) == len(set(stores)) == 3, (backend, stores) + destinations = [line.split("DOWNLOAD_DESTINATION ", 1)[1].strip() + for line in lines if "DOWNLOAD_DESTINATION " in line] + assert destinations and all(not Path(path).exists() for path in destinations), backend + assert not list(Path(storage).rglob("denied.txt")), backend + print(backend, "PASS: allocation, native input, hidden input, permission and download denial") +finally: + seat.Stop() + server.shutdown() diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/dialog/mod.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/dialog/mod.rs new file mode 100644 index 0000000000..156d6a6d2a --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/dialog/mod.rs @@ -0,0 +1,16 @@ +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +#[cfg(windows)] +mod windows; + +pub fn error>(err: S) { + #[cfg(windows)] + windows::error(err); + + #[cfg(not(windows))] + { + unimplemented!("Error dialog is not implemented for this platform"); + } +} diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/dialog/windows.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/dialog/windows.rs new file mode 100644 index 0000000000..2f520c5637 --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/dialog/windows.rs @@ -0,0 +1,124 @@ +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use windows::core::{w, HSTRING}; + +enum Level { + Error, + #[allow(unused)] + Warning, + #[allow(unused)] + Info, +} + +pub fn error>(err: S) { + dialog_inner(err.as_ref(), Level::Error); +} + +fn dialog_inner(err: &str, level: Level) { + let title = match level { + Level::Warning => w!("Warning"), + Level::Error => w!("Error"), + Level::Info => w!("Info"), + }; + + #[cfg(not(feature = "common-controls-v6"))] + { + use windows::Win32::UI::WindowsAndMessaging::*; + + let err = remove_hyperlink(err); + let err = HSTRING::from(err); + + unsafe { + MessageBoxW( + None, + &err, + title, + match level { + Level::Warning => MB_ICONWARNING, + Level::Error => MB_ICONERROR, + Level::Info => MB_ICONINFORMATION, + }, + ) + }; + } + + #[cfg(feature = "common-controls-v6")] + { + use windows::core::{HRESULT, PCWSTR}; + use windows::Win32::Foundation::*; + use windows::Win32::UI::Controls::*; + use windows::Win32::UI::Shell::*; + use windows::Win32::UI::WindowsAndMessaging::*; + + extern "system" fn task_dialog_callback( + _hwnd: HWND, + msg: TASKDIALOG_NOTIFICATIONS, + _wparam: WPARAM, + lparam: LPARAM, + _data: isize, + ) -> HRESULT { + if msg == TDN_HYPERLINK_CLICKED { + let link = PCWSTR(lparam.0 as _); + let _ = unsafe { ShellExecuteW(None, None, link, None, None, SW_SHOWNORMAL) }; + } + + S_OK + } + + let err = HSTRING::from(err); + let err = PCWSTR(err.as_ptr()); + + let task_dialog_config = TASKDIALOGCONFIG { + cbSize: std::mem::size_of::() as u32, + dwFlags: TDF_ALLOW_DIALOG_CANCELLATION | TDF_ENABLE_HYPERLINKS, + pszWindowTitle: title, + pszContent: err, + Anonymous1: TASKDIALOGCONFIG_0 { + pszMainIcon: match level { + Level::Warning => TD_WARNING_ICON, + Level::Error => TD_ERROR_ICON, + Level::Info => TD_INFORMATION_ICON, + }, + }, + dwCommonButtons: TDCBF_OK_BUTTON, + pfCallback: Some(task_dialog_callback), + ..Default::default() + }; + + let _ = unsafe { TaskDialogIndirect(&task_dialog_config, None, None, None) }; + } +} + +#[cfg(not(feature = "common-controls-v6"))] +fn remove_hyperlink(str: &str) -> String { + let mut result = String::new(); + let mut in_hyperlink = false; + + for c in str.chars() { + if c == '<' { + in_hyperlink = true; + } else if c == '>' { + in_hyperlink = false; + } else if !in_hyperlink { + result.push(c); + } + } + + result +} + +#[cfg(test)] +#[cfg(not(feature = "common-controls-v6"))] +mod tests { + use super::*; + + #[test] + fn test_remove_hyperlink() { + let input = "This is a test string."; + let expected = "This is a test string."; + let result = remove_hyperlink(input); + assert_eq!(result, expected); + } +} diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/gtk_child_layout.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/gtk_child_layout.rs new file mode 100644 index 0000000000..4a6985f422 --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/gtk_child_layout.rs @@ -0,0 +1,56 @@ +// Copyright 2026 CodeNomad contributors +// SPDX-License-Identifier: Apache-2.0 OR MIT + +use gtk::prelude::*; + +const NAME: &str = "tauri-webview-overlay"; + +pub(crate) fn content(vbox: >k::Box) -> gtk::Box { + vbox + .children() + .into_iter() + .find(|widget| widget.widget_name() == NAME) + .and_then(|widget| widget.downcast::().ok()) + .and_then(|overlay| overlay.child()) + .and_then(|widget| widget.downcast::().ok()) + .unwrap_or_else(|| vbox.clone()) +} + +// GTK owns the layout for exactly the lifetime of its window. Keeping the +// overlay inside Tao's vbox leaves the menu bar outside content coordinates. +pub(crate) fn containers(vbox: >k::Box) -> (gtk::Box, gtk::Fixed) { + if let Some(overlay) = vbox.children().into_iter().find_map(|widget| { + (widget.widget_name() == NAME) + .then(|| widget.downcast::().ok()) + .flatten() + }) { + let content = overlay.child().unwrap().downcast::().unwrap(); + let children = overlay + .children() + .into_iter() + .find_map(|widget| widget.downcast::().ok()) + .unwrap(); + return (content, children); + } + + let overlay = gtk::Overlay::new(); + overlay.set_widget_name(NAME); + let content = gtk::Box::new(gtk::Orientation::Vertical, 0); + let children = gtk::Fixed::new(); + overlay.add(&content); + // The primary-only path keeps Tao's original box. Install the overlay lazily + // on first child creation and move only its existing WebKit content. + for widget in vbox.children() { + if widget.is::() { + vbox.remove(&widget); + content.pack_start(&widget, true, true, 0); + } + } + overlay.add_overlay(&children); + // GtkFixed has no native input window; WebKit's child windows receive input + // inside their rectangles, while the uncovered area reaches the main view. + overlay.set_overlay_pass_through(&children, true); + vbox.pack_start(&overlay, true, true, 0); + overlay.show_all(); + (content, children) +} diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/lib.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/lib.rs new file mode 100644 index 0000000000..616a2a89ff --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/lib.rs @@ -0,0 +1,5238 @@ +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +//! The [`wry`] Tauri [`Runtime`]. +//! +//! None of the exposed API of this crate is stable, and it may break semver +//! compatibility in the future. The major version only signifies the intended Tauri version. + +#![doc( + html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/.github/icon.png", + html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/.github/icon.png" +)] + +use self::monitor::MonitorExt; +use http::Request; +#[cfg(target_os = "macos")] +use objc2::ClassType; +use raw_window_handle::{DisplayHandle, HasDisplayHandle, HasWindowHandle}; + +#[cfg(windows)] +use tauri_runtime::webview::ScrollBarStyle; +use tauri_runtime::{ + dpi::{LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize, Position, Size}, + monitor::Monitor, + webview::{DetachedWebview, DownloadEvent, PendingWebview, WebviewIpcHandler}, + window::{ + CursorIcon, DetachedWindow, DetachedWindowWebview, DragDropEvent, PendingWindow, RawWindow, + WebviewEvent, WindowBuilder, WindowBuilderBase, WindowEvent, WindowId, WindowSizeConstraints, + }, + Cookie, DeviceEventFilter, Error, EventLoopProxy, ExitRequestedEventAction, Icon, + ProgressBarState, ProgressBarStatus, Result, RunEvent, Runtime, RuntimeHandle, RuntimeInitArgs, + UserAttentionType, UserEvent, WebviewDispatch, WebviewEventId, WindowDispatch, WindowEventId, +}; + +#[cfg(target_vendor = "apple")] +use objc2::rc::Retained; +#[cfg(target_os = "macos")] +use tao::platform::macos::{EventLoopWindowTargetExtMacOS, WindowBuilderExtMacOS}; +#[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" +))] +use tao::platform::unix::{WindowBuilderExtUnix, WindowExtUnix}; +#[cfg(windows)] +use tao::platform::windows::{WindowBuilderExtWindows, WindowExtWindows}; +#[cfg(windows)] +use webview2_com::{ContainsFullScreenElementChangedEventHandler, FocusChangedEventHandler}; +#[cfg(windows)] +use windows::Win32::Foundation::HWND; +#[cfg(target_os = "ios")] +use wry::WebViewBuilderExtIos; +#[cfg(target_os = "macos")] +use wry::WebViewBuilderExtMacos; +#[cfg(windows)] +use wry::WebViewBuilderExtWindows; +#[cfg(target_vendor = "apple")] +use wry::{WebViewBuilderExtDarwin, WebViewExtDarwin}; + +use tao::{ + dpi::{ + LogicalPosition as TaoLogicalPosition, LogicalSize as TaoLogicalSize, + PhysicalPosition as TaoPhysicalPosition, PhysicalSize as TaoPhysicalSize, + Position as TaoPosition, Size as TaoSize, + }, + event::{Event, StartCause, WindowEvent as TaoWindowEvent}, + event_loop::{ + ControlFlow, DeviceEventFilter as TaoDeviceEventFilter, EventLoop, EventLoopBuilder, + EventLoopProxy as TaoEventLoopProxy, EventLoopWindowTarget, + }, + monitor::MonitorHandle, + window::{ + CursorIcon as TaoCursorIcon, Fullscreen, Icon as TaoWindowIcon, + ProgressBarState as TaoProgressBarState, ProgressState as TaoProgressState, Theme as TaoTheme, + UserAttentionType as TaoUserAttentionType, + }, +}; +#[cfg(desktop)] +use tauri_utils::config::PreventOverflowConfig; +#[cfg(target_os = "macos")] +use tauri_utils::TitleBarStyle; +use tauri_utils::{ + config::{Color, WindowConfig}, + Theme, +}; +use url::Url; +#[cfg(windows)] +use wry::ScrollBarStyle as WryScrollBarStyle; +use wry::{ + DragDropEvent as WryDragDropEvent, ProxyConfig, ProxyEndpoint, WebContext as WryWebContext, + WebView, WebViewBuilder, +}; + +pub use tao; +pub use tao::window::{Window, WindowBuilder as TaoWindowBuilder, WindowId as TaoWindowId}; +pub use wry; +pub use wry::webview_version; + +#[cfg(windows)] +use wry::WebViewExtWindows; +#[cfg(target_os = "android")] +use wry::{ + prelude::{dispatch, find_class}, + WebViewBuilderExtAndroid, WebViewExtAndroid, +}; +#[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" +)))] +use wry::{WebViewBuilderExtUnix, WebViewExtUnix}; + +#[cfg(target_os = "ios")] +pub use tao::platform::ios::WindowExtIOS; +#[cfg(target_os = "macos")] +pub use tao::platform::macos::{ + ActivationPolicy as TaoActivationPolicy, EventLoopExtMacOS, WindowExtMacOS, +}; +#[cfg(target_os = "macos")] +use tauri_runtime::ActivationPolicy; + +use std::{ + cell::RefCell, + collections::{ + hash_map::Entry::{Occupied, Vacant}, + BTreeMap, HashMap, HashSet, + }, + fmt, + ops::Deref, + path::PathBuf, + rc::Rc, + sync::{ + atomic::{AtomicBool, AtomicU32, Ordering}, + mpsc::{channel, Sender}, + Arc, Mutex, Weak, + }, + thread::{current as current_thread, ThreadId}, +}; + +pub type WebviewId = u32; +type IpcHandler = dyn Fn(Request) + 'static; + +#[cfg(not(debug_assertions))] +mod dialog; +#[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" +))] +mod gtk_child_layout; +mod monitor; +#[cfg(any( + windows, + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" +))] +mod undecorated_resizing; +mod util; +mod webview; +mod window; + +pub use webview::Webview; +use window::WindowExt as _; + +#[derive(Debug)] +pub struct WebContext { + pub inner: WryWebContext, + pub referenced_by_webviews: HashSet, + // on Linux the custom protocols are associated with the context + // and you cannot register a URI scheme more than once + pub registered_custom_protocols: HashSet, +} + +pub type WebContextStore = Arc, WebContext>>>; +// window +pub type WindowEventHandler = Box; +pub type WindowEventListeners = Arc>>; +pub type WebviewEventHandler = Box; +pub type WebviewEventListeners = Arc>>; + +#[derive(Debug, Clone, Default)] +pub struct WindowIdStore(Arc>>); + +impl WindowIdStore { + pub fn insert(&self, w: TaoWindowId, id: WindowId) { + self.0.lock().unwrap().insert(w, id); + } + + pub fn get(&self, w: &TaoWindowId) -> Option { + self.0.lock().unwrap().get(w).copied() + } +} + +#[macro_export] +macro_rules! getter { + ($self: ident, $rx: expr, $message: expr) => {{ + $crate::send_user_message(&$self.context, $message)?; + $rx + .recv() + .map_err(|_| $crate::Error::FailedToReceiveMessage) + }}; +} + +macro_rules! window_getter { + ($self: ident, $message: expr) => {{ + let (tx, rx) = channel(); + getter!($self, rx, Message::Window($self.window_id, $message(tx))) + }}; +} + +macro_rules! event_loop_window_getter { + ($self: ident, $message: expr) => {{ + let (tx, rx) = channel(); + getter!($self, rx, Message::EventLoopWindowTarget($message(tx))) + }}; +} + +macro_rules! webview_getter { + ($self: ident, $message: expr) => {{ + let (tx, rx) = channel(); + getter!( + $self, + rx, + Message::Webview( + *$self.window_id.lock().unwrap(), + $self.webview_id, + $message(tx) + ) + ) + }}; +} + +pub(crate) fn send_user_message( + context: &Context, + message: Message, +) -> Result<()> { + if current_thread().id() == context.main_thread_id { + handle_user_message( + &context.main_thread.window_target, + message, + UserMessageContext { + window_id_map: context.window_id_map.clone(), + windows: context.main_thread.windows.clone(), + }, + ); + Ok(()) + } else { + context + .proxy + .send_event(message) + .map_err(|_| Error::FailedToSendMessage) + } +} + +#[derive(Clone)] +pub struct Context { + pub window_id_map: WindowIdStore, + main_thread_id: ThreadId, + pub proxy: TaoEventLoopProxy>, + main_thread: DispatcherMainThreadContext, + plugins: Arc + Send>>>>, + next_window_id: Arc, + next_webview_id: Arc, + next_window_event_id: Arc, + next_webview_event_id: Arc, + webview_runtime_installed: bool, +} + +impl Context { + pub fn run_threaded(&self, f: F) -> R + where + F: FnOnce(Option<&DispatcherMainThreadContext>) -> R, + { + f(if current_thread().id() == self.main_thread_id { + Some(&self.main_thread) + } else { + None + }) + } + + fn next_window_id(&self) -> WindowId { + self.next_window_id.fetch_add(1, Ordering::Relaxed).into() + } + + fn next_webview_id(&self) -> WebviewId { + self.next_webview_id.fetch_add(1, Ordering::Relaxed) + } + + fn next_window_event_id(&self) -> u32 { + self.next_window_event_id.fetch_add(1, Ordering::Relaxed) + } + + fn next_webview_event_id(&self) -> u32 { + self.next_webview_event_id.fetch_add(1, Ordering::Relaxed) + } +} + +impl Context { + fn create_window( + &self, + pending: PendingWindow>, + after_window_creation: Option, + ) -> Result>> { + let label = pending.label.clone(); + let context = self.clone(); + let window_id = self.next_window_id(); + let (webview_id, use_https_scheme) = pending + .webview + .as_ref() + .map(|w| { + ( + Some(context.next_webview_id()), + w.webview_attributes.use_https_scheme, + ) + }) + .unwrap_or((None, false)); + + send_user_message( + self, + Message::CreateWindow( + window_id, + Box::new(move |event_loop| { + create_window( + window_id, + webview_id.unwrap_or_default(), + event_loop, + &context, + pending, + after_window_creation, + ) + }), + ), + )?; + + let dispatcher = WryWindowDispatcher { + window_id, + context: self.clone(), + }; + + let detached_webview = webview_id.map(|id| { + let webview = DetachedWebview { + label: label.clone(), + dispatcher: WryWebviewDispatcher { + window_id: Arc::new(Mutex::new(window_id)), + webview_id: id, + context: self.clone(), + }, + }; + DetachedWindowWebview { + webview, + use_https_scheme, + } + }); + + Ok(DetachedWindow { + id: window_id, + label, + dispatcher, + webview: detached_webview, + }) + } + + fn create_webview( + &self, + window_id: WindowId, + pending: PendingWebview>, + ) -> Result>> { + let label = pending.label.clone(); + let context = self.clone(); + + let webview_id = self.next_webview_id(); + + let window_id_wrapper = Arc::new(Mutex::new(window_id)); + let window_id_wrapper_ = window_id_wrapper.clone(); + + send_user_message( + self, + Message::CreateWebview( + window_id, + Box::new(move |window, options| { + create_webview( + WebviewKind::WindowChild, + window, + window_id_wrapper_, + webview_id, + &context, + pending, + options.focused_webview, + ) + }), + ), + )?; + + let dispatcher = WryWebviewDispatcher { + window_id: window_id_wrapper, + webview_id, + context: self.clone(), + }; + + Ok(DetachedWebview { label, dispatcher }) + } +} + +#[cfg(feature = "tracing")] +#[derive(Debug, Clone, Default)] +pub struct ActiveTraceSpanStore(Rc>>); + +#[cfg(feature = "tracing")] +impl ActiveTraceSpanStore { + pub fn remove_window_draw(&self) { + self + .0 + .borrow_mut() + .retain(|t| !matches!(t, ActiveTracingSpan::WindowDraw { id: _, span: _ })); + } +} + +#[cfg(feature = "tracing")] +#[derive(Debug)] +pub enum ActiveTracingSpan { + WindowDraw { + id: TaoWindowId, + span: tracing::span::EnteredSpan, + }, +} + +#[derive(Debug)] +pub struct WindowsStore(pub RefCell>); + +// SAFETY: we ensure this type is only used on the main thread. +#[allow(clippy::non_send_fields_in_send_ty)] +unsafe impl Send for WindowsStore {} + +// SAFETY: we ensure this type is only used on the main thread. +#[allow(clippy::non_send_fields_in_send_ty)] +unsafe impl Sync for WindowsStore {} + +#[derive(Debug, Clone)] +pub struct DispatcherMainThreadContext { + pub window_target: EventLoopWindowTarget>, + pub web_context: WebContextStore, + // changing this to an Rc will cause frequent app crashes. + pub windows: Arc, + #[cfg(feature = "tracing")] + pub active_tracing_spans: ActiveTraceSpanStore, +} + +// SAFETY: we ensure this type is only used on the main thread. +#[allow(clippy::non_send_fields_in_send_ty)] +unsafe impl Send for DispatcherMainThreadContext {} + +// SAFETY: we ensure this type is only used on the main thread. +#[allow(clippy::non_send_fields_in_send_ty)] +unsafe impl Sync for DispatcherMainThreadContext {} + +impl fmt::Debug for Context { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Context") + .field("main_thread_id", &self.main_thread_id) + .field("proxy", &self.proxy) + .field("main_thread", &self.main_thread) + .finish() + } +} + +pub struct DeviceEventFilterWrapper(pub TaoDeviceEventFilter); + +impl From for DeviceEventFilterWrapper { + fn from(item: DeviceEventFilter) -> Self { + match item { + DeviceEventFilter::Always => Self(TaoDeviceEventFilter::Always), + DeviceEventFilter::Never => Self(TaoDeviceEventFilter::Never), + DeviceEventFilter::Unfocused => Self(TaoDeviceEventFilter::Unfocused), + } + } +} + +pub struct RectWrapper(pub wry::Rect); +impl From for RectWrapper { + fn from(value: tauri_runtime::dpi::Rect) -> Self { + RectWrapper(wry::Rect { + position: value.position, + size: value.size, + }) + } +} + +/// Wrapper around a [`tao::window::Icon`] that can be created from an [`Icon`]. +pub struct TaoIcon(pub TaoWindowIcon); + +impl TryFrom> for TaoIcon { + type Error = Error; + fn try_from(icon: Icon<'_>) -> std::result::Result { + TaoWindowIcon::from_rgba(icon.rgba.to_vec(), icon.width, icon.height) + .map(Self) + .map_err(|e| Error::InvalidIcon(Box::new(e))) + } +} + +pub struct WindowEventWrapper(pub Option); + +impl WindowEventWrapper { + fn map_from_tao( + event: &TaoWindowEvent<'_>, + #[allow(unused_variables)] window: &WindowWrapper, + ) -> Self { + let event = match event { + TaoWindowEvent::Resized(size) => WindowEvent::Resized(PhysicalSizeWrapper(*size).into()), + TaoWindowEvent::Moved(position) => { + WindowEvent::Moved(PhysicalPositionWrapper(*position).into()) + } + TaoWindowEvent::Destroyed => WindowEvent::Destroyed, + TaoWindowEvent::ScaleFactorChanged { + scale_factor, + new_inner_size, + } => WindowEvent::ScaleFactorChanged { + scale_factor: *scale_factor, + new_inner_size: PhysicalSizeWrapper(**new_inner_size).into(), + }, + TaoWindowEvent::Focused(focused) => { + #[cfg(not(windows))] + return Self(Some(WindowEvent::Focused(*focused))); + // on multiwebview mode, if there's no focused webview, it means we're receiving a direct window focus change + // (without receiving a webview focus, such as when clicking the taskbar app icon or using Alt + Tab) + // in this case we must send the focus change event here + #[cfg(windows)] + if window.has_children.load(Ordering::Relaxed) { + const FOCUSED_WEBVIEW_MARKER: &str = "__tauriWindow?"; + let mut focused_webview = window.focused_webview.lock().unwrap(); + // when we focus a webview and the window was previously focused, we get a blur event here + // so on blur we should only send events if the current focus is owned by the window + if !*focused + && focused_webview + .as_deref() + .is_some_and(|w| w != FOCUSED_WEBVIEW_MARKER) + { + return Self(None); + } + + // reset focused_webview on blur, or set to a dummy value on focus + // (to prevent double focus event when we click a webview after focusing a window) + *focused_webview = (*focused).then(|| FOCUSED_WEBVIEW_MARKER.to_string()); + + return Self(Some(WindowEvent::Focused(*focused))); + } else { + // when not on multiwebview mode, we handle focus change events on the webview (add_GotFocus and add_LostFocus) + return Self(None); + } + } + TaoWindowEvent::ThemeChanged(theme) => WindowEvent::ThemeChanged(map_theme(theme)), + _ => return Self(None), + }; + Self(Some(event)) + } + + fn parse(window: &WindowWrapper, event: &TaoWindowEvent<'_>) -> Self { + match event { + // resized event from tao doesn't include a reliable size on macOS + // because wry replaces the NSView + TaoWindowEvent::Resized(_) => { + if let Some(w) = &window.inner { + let size = inner_size( + w, + &window.webviews, + window.has_children.load(Ordering::Relaxed), + ); + Self(Some(WindowEvent::Resized(PhysicalSizeWrapper(size).into()))) + } else { + Self(None) + } + } + e => Self::map_from_tao(e, window), + } + } +} + +pub fn map_theme(theme: &TaoTheme) -> Theme { + match theme { + TaoTheme::Light => Theme::Light, + TaoTheme::Dark => Theme::Dark, + _ => Theme::Light, + } +} + +#[cfg(target_os = "macos")] +fn tao_activation_policy(activation_policy: ActivationPolicy) -> TaoActivationPolicy { + match activation_policy { + ActivationPolicy::Regular => TaoActivationPolicy::Regular, + ActivationPolicy::Accessory => TaoActivationPolicy::Accessory, + ActivationPolicy::Prohibited => TaoActivationPolicy::Prohibited, + _ => unimplemented!(), + } +} + +pub struct MonitorHandleWrapper(pub MonitorHandle); + +impl From for Monitor { + fn from(monitor: MonitorHandleWrapper) -> Monitor { + Self { + name: monitor.0.name(), + position: PhysicalPositionWrapper(monitor.0.position()).into(), + size: PhysicalSizeWrapper(monitor.0.size()).into(), + work_area: monitor.0.work_area(), + scale_factor: monitor.0.scale_factor(), + } + } +} + +pub struct PhysicalPositionWrapper(pub TaoPhysicalPosition); + +impl From> for PhysicalPosition { + fn from(position: PhysicalPositionWrapper) -> Self { + Self { + x: position.0.x, + y: position.0.y, + } + } +} + +impl From> for PhysicalPositionWrapper { + fn from(position: PhysicalPosition) -> Self { + Self(TaoPhysicalPosition { + x: position.x, + y: position.y, + }) + } +} + +struct LogicalPositionWrapper(TaoLogicalPosition); + +impl From> for LogicalPositionWrapper { + fn from(position: LogicalPosition) -> Self { + Self(TaoLogicalPosition { + x: position.x, + y: position.y, + }) + } +} + +pub struct PhysicalSizeWrapper(pub TaoPhysicalSize); + +impl From> for PhysicalSize { + fn from(size: PhysicalSizeWrapper) -> Self { + Self { + width: size.0.width, + height: size.0.height, + } + } +} + +impl From> for PhysicalSizeWrapper { + fn from(size: PhysicalSize) -> Self { + Self(TaoPhysicalSize { + width: size.width, + height: size.height, + }) + } +} + +struct LogicalSizeWrapper(TaoLogicalSize); + +impl From> for LogicalSizeWrapper { + fn from(size: LogicalSize) -> Self { + Self(TaoLogicalSize { + width: size.width, + height: size.height, + }) + } +} + +pub struct SizeWrapper(pub TaoSize); + +impl From for SizeWrapper { + fn from(size: Size) -> Self { + match size { + Size::Logical(s) => Self(TaoSize::Logical(LogicalSizeWrapper::from(s).0)), + Size::Physical(s) => Self(TaoSize::Physical(PhysicalSizeWrapper::from(s).0)), + } + } +} + +pub struct PositionWrapper(pub TaoPosition); + +impl From for PositionWrapper { + fn from(position: Position) -> Self { + match position { + Position::Logical(s) => Self(TaoPosition::Logical(LogicalPositionWrapper::from(s).0)), + Position::Physical(s) => Self(TaoPosition::Physical(PhysicalPositionWrapper::from(s).0)), + } + } +} + +#[derive(Debug, Clone)] +pub struct UserAttentionTypeWrapper(pub TaoUserAttentionType); + +impl From for UserAttentionTypeWrapper { + fn from(request_type: UserAttentionType) -> Self { + let o = match request_type { + UserAttentionType::Critical => TaoUserAttentionType::Critical, + UserAttentionType::Informational => TaoUserAttentionType::Informational, + }; + Self(o) + } +} + +#[derive(Debug)] +pub struct CursorIconWrapper(pub TaoCursorIcon); + +impl From for CursorIconWrapper { + fn from(icon: CursorIcon) -> Self { + use CursorIcon::*; + let i = match icon { + Default => TaoCursorIcon::Default, + Crosshair => TaoCursorIcon::Crosshair, + Hand => TaoCursorIcon::Hand, + Arrow => TaoCursorIcon::Arrow, + Move => TaoCursorIcon::Move, + Text => TaoCursorIcon::Text, + Wait => TaoCursorIcon::Wait, + Help => TaoCursorIcon::Help, + Progress => TaoCursorIcon::Progress, + NotAllowed => TaoCursorIcon::NotAllowed, + ContextMenu => TaoCursorIcon::ContextMenu, + Cell => TaoCursorIcon::Cell, + VerticalText => TaoCursorIcon::VerticalText, + Alias => TaoCursorIcon::Alias, + Copy => TaoCursorIcon::Copy, + NoDrop => TaoCursorIcon::NoDrop, + Grab => TaoCursorIcon::Grab, + Grabbing => TaoCursorIcon::Grabbing, + AllScroll => TaoCursorIcon::AllScroll, + ZoomIn => TaoCursorIcon::ZoomIn, + ZoomOut => TaoCursorIcon::ZoomOut, + EResize => TaoCursorIcon::EResize, + NResize => TaoCursorIcon::NResize, + NeResize => TaoCursorIcon::NeResize, + NwResize => TaoCursorIcon::NwResize, + SResize => TaoCursorIcon::SResize, + SeResize => TaoCursorIcon::SeResize, + SwResize => TaoCursorIcon::SwResize, + WResize => TaoCursorIcon::WResize, + EwResize => TaoCursorIcon::EwResize, + NsResize => TaoCursorIcon::NsResize, + NeswResize => TaoCursorIcon::NeswResize, + NwseResize => TaoCursorIcon::NwseResize, + ColResize => TaoCursorIcon::ColResize, + RowResize => TaoCursorIcon::RowResize, + _ => TaoCursorIcon::Default, + }; + Self(i) + } +} + +pub struct ProgressStateWrapper(pub TaoProgressState); + +impl From for ProgressStateWrapper { + fn from(status: ProgressBarStatus) -> Self { + let state = match status { + ProgressBarStatus::None => TaoProgressState::None, + ProgressBarStatus::Normal => TaoProgressState::Normal, + ProgressBarStatus::Indeterminate => TaoProgressState::Indeterminate, + ProgressBarStatus::Paused => TaoProgressState::Paused, + ProgressBarStatus::Error => TaoProgressState::Error, + }; + Self(state) + } +} + +pub struct ProgressBarStateWrapper(pub TaoProgressBarState); + +impl From for ProgressBarStateWrapper { + fn from(progress_state: ProgressBarState) -> Self { + Self(TaoProgressBarState { + progress: progress_state.progress, + state: progress_state + .status + .map(|state| ProgressStateWrapper::from(state).0), + desktop_filename: progress_state.desktop_filename, + }) + } +} + +#[derive(Clone, Default)] +pub struct WindowBuilderWrapper { + inner: TaoWindowBuilder, + center: bool, + prevent_overflow: Option, + #[cfg(target_os = "macos")] + tabbing_identifier: Option, +} + +impl std::fmt::Debug for WindowBuilderWrapper { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let mut s = f.debug_struct("WindowBuilderWrapper"); + s.field("inner", &self.inner) + .field("center", &self.center) + .field("prevent_overflow", &self.prevent_overflow); + #[cfg(target_os = "macos")] + { + s.field("tabbing_identifier", &self.tabbing_identifier); + } + s.finish() + } +} + +// SAFETY: this type is `Send` since `menu_items` are read only here +#[allow(clippy::non_send_fields_in_send_ty)] +unsafe impl Send for WindowBuilderWrapper {} + +impl WindowBuilderBase for WindowBuilderWrapper {} +impl WindowBuilder for WindowBuilderWrapper { + fn new() -> Self { + #[allow(unused_mut)] + let mut builder = Self::default().focused(true); + + #[cfg(target_os = "macos")] + { + // TODO: find a proper way to prevent webview being pushed out of the window. + // Workround for issue: https://github.com/tauri-apps/tauri/issues/10225 + // The window requires `NSFullSizeContentViewWindowMask` flag to prevent devtools + // pushing the content view out of the window. + // By setting the default style to `TitleBarStyle::Visible` should fix the issue for most of the users. + builder = builder.title_bar_style(TitleBarStyle::Visible); + } + + builder = builder.title("Tauri App"); + + #[cfg(windows)] + { + builder = builder.window_classname("Tauri Window"); + } + + builder + } + + fn with_config(config: &WindowConfig) -> Self { + let mut window = WindowBuilderWrapper::new(); + + #[cfg(target_os = "macos")] + { + window = window + .hidden_title(config.hidden_title) + .title_bar_style(config.title_bar_style); + if let Some(identifier) = &config.tabbing_identifier { + window = window.tabbing_identifier(identifier); + } + if let Some(position) = &config.traffic_light_position { + window = window.traffic_light_position(tauri_runtime::dpi::LogicalPosition::new( + position.x, position.y, + )); + } + } + + #[cfg(any(not(target_os = "macos"), feature = "macos-private-api"))] + { + window = window.transparent(config.transparent); + } + #[cfg(all( + target_os = "macos", + not(feature = "macos-private-api"), + debug_assertions + ))] + if config.transparent { + eprintln!( + "The window is set to be transparent but the `macos-private-api` is not enabled. + This can be enabled via the `tauri.macOSPrivateApi` configuration property + "); + } + + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + { + // Mouse event is disabled on Linux since sudden event bursts could block event loop. + window.inner = window.inner.with_cursor_moved_event(false); + } + + #[cfg(desktop)] + { + window = window + .title(config.title.to_string()) + .inner_size(config.width, config.height) + .focused(config.focus) + .focusable(config.focusable) + .visible(config.visible) + .resizable(config.resizable) + .fullscreen(config.fullscreen) + .decorations(config.decorations) + .maximized(config.maximized) + .always_on_bottom(config.always_on_bottom) + .always_on_top(config.always_on_top) + .visible_on_all_workspaces(config.visible_on_all_workspaces) + .content_protected(config.content_protected) + .skip_taskbar(config.skip_taskbar) + .theme(config.theme) + .closable(config.closable) + .maximizable(config.maximizable) + .minimizable(config.minimizable) + .shadow(config.shadow); + + let mut constraints = WindowSizeConstraints::default(); + + if let Some(min_width) = config.min_width { + constraints.min_width = Some(tao::dpi::LogicalUnit::new(min_width).into()); + } + if let Some(min_height) = config.min_height { + constraints.min_height = Some(tao::dpi::LogicalUnit::new(min_height).into()); + } + if let Some(max_width) = config.max_width { + constraints.max_width = Some(tao::dpi::LogicalUnit::new(max_width).into()); + } + if let Some(max_height) = config.max_height { + constraints.max_height = Some(tao::dpi::LogicalUnit::new(max_height).into()); + } + if let Some(color) = config.background_color { + window = window.background_color(color); + } + window = window.inner_size_constraints(constraints); + + if let (Some(x), Some(y)) = (config.x, config.y) { + window = window.position(x, y); + } + + if config.center { + window = window.center(); + } + + if let Some(window_classname) = &config.window_classname { + window = window.window_classname(window_classname); + } + + if let Some(prevent_overflow) = &config.prevent_overflow { + window = match prevent_overflow { + PreventOverflowConfig::Enable(true) => window.prevent_overflow(), + PreventOverflowConfig::Margin(margin) => window + .prevent_overflow_with_margin(TaoPhysicalSize::new(margin.width, margin.height).into()), + _ => window, + }; + } + } + + window + } + + fn center(mut self) -> Self { + self.center = true; + self + } + + fn position(mut self, x: f64, y: f64) -> Self { + self.inner = self.inner.with_position(TaoLogicalPosition::new(x, y)); + self + } + + fn inner_size(mut self, width: f64, height: f64) -> Self { + self.inner = self + .inner + .with_inner_size(TaoLogicalSize::new(width, height)); + self + } + + fn min_inner_size(mut self, min_width: f64, min_height: f64) -> Self { + self.inner = self + .inner + .with_min_inner_size(TaoLogicalSize::new(min_width, min_height)); + self + } + + fn max_inner_size(mut self, max_width: f64, max_height: f64) -> Self { + self.inner = self + .inner + .with_max_inner_size(TaoLogicalSize::new(max_width, max_height)); + self + } + + fn inner_size_constraints(mut self, constraints: WindowSizeConstraints) -> Self { + self.inner.window.inner_size_constraints = tao::window::WindowSizeConstraints { + min_width: constraints.min_width, + min_height: constraints.min_height, + max_width: constraints.max_width, + max_height: constraints.max_height, + }; + self + } + + /// Prevent the window from overflowing the working area (e.g. monitor size - taskbar size) on creation + /// + /// ## Platform-specific + /// + /// - **iOS / Android:** Unsupported. + fn prevent_overflow(mut self) -> Self { + self + .prevent_overflow + .replace(PhysicalSize::new(0, 0).into()); + self + } + + /// Prevent the window from overflowing the working area (e.g. monitor size - taskbar size) + /// on creation with a margin + /// + /// ## Platform-specific + /// + /// - **iOS / Android:** Unsupported. + fn prevent_overflow_with_margin(mut self, margin: Size) -> Self { + self.prevent_overflow.replace(margin); + self + } + + fn resizable(mut self, resizable: bool) -> Self { + self.inner = self.inner.with_resizable(resizable); + self + } + + fn maximizable(mut self, maximizable: bool) -> Self { + self.inner = self.inner.with_maximizable(maximizable); + self + } + + fn minimizable(mut self, minimizable: bool) -> Self { + self.inner = self.inner.with_minimizable(minimizable); + self + } + + fn closable(mut self, closable: bool) -> Self { + self.inner = self.inner.with_closable(closable); + self + } + + fn title>(mut self, title: S) -> Self { + self.inner = self.inner.with_title(title.into()); + self + } + + fn fullscreen(mut self, fullscreen: bool) -> Self { + self.inner = if fullscreen { + self + .inner + .with_fullscreen(Some(Fullscreen::Borderless(None))) + } else { + self.inner.with_fullscreen(None) + }; + self + } + + fn focused(mut self, focused: bool) -> Self { + self.inner = self.inner.with_focused(focused); + self + } + + fn focusable(mut self, focusable: bool) -> Self { + self.inner = self.inner.with_focusable(focusable); + self + } + + fn maximized(mut self, maximized: bool) -> Self { + self.inner = self.inner.with_maximized(maximized); + self + } + + fn visible(mut self, visible: bool) -> Self { + self.inner = self.inner.with_visible(visible); + self + } + + #[cfg(any(not(target_os = "macos"), feature = "macos-private-api"))] + fn transparent(mut self, transparent: bool) -> Self { + self.inner = self.inner.with_transparent(transparent); + self + } + + fn decorations(mut self, decorations: bool) -> Self { + self.inner = self.inner.with_decorations(decorations); + self + } + + fn always_on_bottom(mut self, always_on_bottom: bool) -> Self { + self.inner = self.inner.with_always_on_bottom(always_on_bottom); + self + } + + fn always_on_top(mut self, always_on_top: bool) -> Self { + self.inner = self.inner.with_always_on_top(always_on_top); + self + } + + fn visible_on_all_workspaces(mut self, visible_on_all_workspaces: bool) -> Self { + self.inner = self + .inner + .with_visible_on_all_workspaces(visible_on_all_workspaces); + self + } + + fn content_protected(mut self, protected: bool) -> Self { + self.inner = self.inner.with_content_protection(protected); + self + } + + fn shadow(#[allow(unused_mut)] mut self, _enable: bool) -> Self { + #[cfg(windows)] + { + self.inner = self.inner.with_undecorated_shadow(_enable); + } + #[cfg(target_os = "macos")] + { + self.inner = self.inner.with_has_shadow(_enable); + } + self + } + + #[cfg(windows)] + fn owner(mut self, owner: HWND) -> Self { + self.inner = self.inner.with_owner_window(owner.0 as _); + self + } + + #[cfg(windows)] + fn parent(mut self, parent: HWND) -> Self { + self.inner = self.inner.with_parent_window(parent.0 as _); + self + } + + #[cfg(target_os = "macos")] + fn parent(mut self, parent: *mut std::ffi::c_void) -> Self { + self.inner = self.inner.with_parent_window(parent); + self + } + + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + fn transient_for(mut self, parent: &impl gtk::glib::IsA) -> Self { + self.inner = self.inner.with_transient_for(parent); + self + } + + #[cfg(windows)] + fn drag_and_drop(mut self, enabled: bool) -> Self { + self.inner = self.inner.with_drag_and_drop(enabled); + self + } + + #[cfg(target_os = "macos")] + fn title_bar_style(mut self, style: TitleBarStyle) -> Self { + match style { + TitleBarStyle::Visible => { + self.inner = self.inner.with_titlebar_transparent(false); + // Fixes rendering issue when resizing window with devtools open (https://github.com/tauri-apps/tauri/issues/3914) + self.inner = self.inner.with_fullsize_content_view(true); + } + TitleBarStyle::Transparent => { + self.inner = self.inner.with_titlebar_transparent(true); + self.inner = self.inner.with_fullsize_content_view(false); + } + TitleBarStyle::Overlay => { + self.inner = self.inner.with_titlebar_transparent(true); + self.inner = self.inner.with_fullsize_content_view(true); + } + unknown => { + #[cfg(feature = "tracing")] + tracing::warn!("unknown title bar style applied: {unknown}"); + + #[cfg(not(feature = "tracing"))] + eprintln!("unknown title bar style applied: {unknown}"); + } + } + self + } + + #[cfg(target_os = "macos")] + fn traffic_light_position>(mut self, position: P) -> Self { + self.inner = self.inner.with_traffic_light_inset(position.into()); + self + } + + #[cfg(target_os = "macos")] + fn hidden_title(mut self, hidden: bool) -> Self { + self.inner = self.inner.with_title_hidden(hidden); + self + } + + #[cfg(target_os = "macos")] + fn tabbing_identifier(mut self, identifier: &str) -> Self { + self.inner = self.inner.with_tabbing_identifier(identifier); + self.tabbing_identifier.replace(identifier.into()); + self + } + + fn icon(mut self, icon: Icon) -> Result { + self.inner = self + .inner + .with_window_icon(Some(TaoIcon::try_from(icon)?.0)); + Ok(self) + } + + fn background_color(mut self, color: Color) -> Self { + self.inner = self.inner.with_background_color(color.into()); + self + } + + #[cfg(any( + windows, + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + fn skip_taskbar(mut self, skip: bool) -> Self { + self.inner = self.inner.with_skip_taskbar(skip); + self + } + + #[cfg(any(target_os = "macos", target_os = "ios", target_os = "android"))] + fn skip_taskbar(self, _skip: bool) -> Self { + self + } + + fn theme(mut self, theme: Option) -> Self { + self.inner = self.inner.with_theme(if let Some(t) = theme { + match t { + Theme::Dark => Some(TaoTheme::Dark), + _ => Some(TaoTheme::Light), + } + } else { + None + }); + + self + } + + fn has_icon(&self) -> bool { + self.inner.window.window_icon.is_some() + } + + fn get_theme(&self) -> Option { + self.inner.window.preferred_theme.map(|theme| match theme { + TaoTheme::Dark => Theme::Dark, + _ => Theme::Light, + }) + } + + #[cfg(windows)] + fn window_classname>(mut self, window_classname: S) -> Self { + self.inner = self.inner.with_window_classname(window_classname); + self + } + #[cfg(not(windows))] + fn window_classname>(self, _window_classname: S) -> Self { + self + } +} + +#[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" +))] +pub struct GtkWindow(pub gtk::ApplicationWindow); +#[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" +))] +#[allow(clippy::non_send_fields_in_send_ty)] +unsafe impl Send for GtkWindow {} + +#[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" +))] +pub struct GtkBox(pub gtk::Box); +#[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" +))] +#[allow(clippy::non_send_fields_in_send_ty)] +unsafe impl Send for GtkBox {} + +pub struct SendRawWindowHandle(pub raw_window_handle::RawWindowHandle); +unsafe impl Send for SendRawWindowHandle {} + +pub enum ApplicationMessage { + #[cfg(target_os = "macos")] + Show, + #[cfg(target_os = "macos")] + Hide, + #[cfg(any(target_os = "macos", target_os = "ios"))] + FetchDataStoreIdentifiers(Box) + Send + 'static>), + #[cfg(any(target_os = "macos", target_os = "ios"))] + RemoveDataStore([u8; 16], Box) + Send + 'static>), +} + +pub enum WindowMessage { + AddEventListener(WindowEventId, Box), + // Getters + ScaleFactor(Sender), + InnerPosition(Sender>>), + OuterPosition(Sender>>), + InnerSize(Sender>), + OuterSize(Sender>), + IsFullscreen(Sender), + IsMinimized(Sender), + IsMaximized(Sender), + IsFocused(Sender), + IsDecorated(Sender), + IsResizable(Sender), + IsMaximizable(Sender), + IsMinimizable(Sender), + IsClosable(Sender), + IsVisible(Sender), + Title(Sender), + CurrentMonitor(Sender>), + PrimaryMonitor(Sender>), + MonitorFromPoint(Sender>, (f64, f64)), + AvailableMonitors(Sender>), + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + GtkWindow(Sender), + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + GtkBox(Sender), + RawWindowHandle(Sender>), + Theme(Sender), + IsEnabled(Sender), + IsAlwaysOnTop(Sender), + // Setters + Center, + RequestUserAttention(Option), + SetEnabled(bool), + SetResizable(bool), + SetMaximizable(bool), + SetMinimizable(bool), + SetClosable(bool), + SetTitle(String), + Maximize, + Unmaximize, + Minimize, + Unminimize, + Show, + Hide, + Close, + Destroy, + SetDecorations(bool), + SetShadow(bool), + SetAlwaysOnBottom(bool), + SetAlwaysOnTop(bool), + SetVisibleOnAllWorkspaces(bool), + SetContentProtected(bool), + SetSize(Size), + SetMinSize(Option), + SetMaxSize(Option), + SetSizeConstraints(WindowSizeConstraints), + SetPosition(Position), + SetFullscreen(bool), + #[cfg(target_os = "macos")] + SetSimpleFullscreen(bool), + SetFocus, + SetFocusable(bool), + SetIcon(TaoWindowIcon), + SetSkipTaskbar(bool), + SetCursorGrab(bool), + SetCursorVisible(bool), + SetCursorIcon(CursorIcon), + SetCursorPosition(Position), + SetIgnoreCursorEvents(bool), + SetBadgeCount(Option, Option), + SetBadgeLabel(Option), + SetOverlayIcon(Option), + SetProgressBar(ProgressBarState), + SetTitleBarStyle(tauri_utils::TitleBarStyle), + SetTrafficLightPosition(Position), + SetTheme(Option), + SetBackgroundColor(Option), + DragWindow, + ResizeDragWindow(tauri_runtime::ResizeDirection), + RequestRedraw, +} + +#[derive(Debug, Clone)] +pub enum SynthesizedWindowEvent { + Focused(bool), + DragDrop(DragDropEvent), +} + +impl From for WindowEventWrapper { + fn from(event: SynthesizedWindowEvent) -> Self { + let event = match event { + SynthesizedWindowEvent::Focused(focused) => WindowEvent::Focused(focused), + SynthesizedWindowEvent::DragDrop(event) => WindowEvent::DragDrop(event), + }; + Self(Some(event)) + } +} + +pub enum WebviewMessage { + AddEventListener(WebviewEventId, Box), + #[cfg(not(all(feature = "tracing", not(target_os = "android"))))] + EvaluateScript(String), + #[cfg(all(feature = "tracing", not(target_os = "android")))] + EvaluateScript(String, Sender<()>, tracing::Span), + CookiesForUrl(Url, Sender>>>), + Cookies(Sender>>>), + SetCookie(tauri_runtime::Cookie<'static>), + DeleteCookie(tauri_runtime::Cookie<'static>), + WebviewEvent(WebviewEvent), + SynthesizedWindowEvent(SynthesizedWindowEvent), + Navigate(Url), + Reload, + Print, + Close, + Show, + Hide, + SetPosition(Position), + SetSize(Size), + SetBounds(tauri_runtime::dpi::Rect), + SetFocus, + Reparent(WindowId, Sender>), + SetAutoResize(bool), + SetZoom(f64), + SetBackgroundColor(Option), + ClearAllBrowsingData, + // Getters + Url(Sender>), + Bounds(Sender>), + Position(Sender>>), + Size(Sender>>), + WithWebview(Box), + // Devtools + #[cfg(any(debug_assertions, feature = "devtools"))] + OpenDevTools, + #[cfg(any(debug_assertions, feature = "devtools"))] + CloseDevTools, + #[cfg(any(debug_assertions, feature = "devtools"))] + IsDevToolsOpen(Sender), +} + +pub enum EventLoopWindowTargetMessage { + CursorPosition(Sender>>), + SetTheme(Option), + SetDeviceEventFilter(DeviceEventFilter), +} + +pub type CreateWindowClosure = + Box>) -> Result + Send>; + +pub type CreateWebviewClosure = + Box Result + Send>; + +pub struct CreateWebviewOptions { + pub focused_webview: Arc>>, +} + +pub enum Message { + Task(Box), + #[cfg(target_os = "macos")] + SetActivationPolicy(ActivationPolicy), + #[cfg(target_os = "macos")] + SetDockVisibility(bool), + RequestExit(i32), + Application(ApplicationMessage), + Window(WindowId, WindowMessage), + Webview(WindowId, WebviewId, WebviewMessage), + EventLoopWindowTarget(EventLoopWindowTargetMessage), + CreateWebview(WindowId, CreateWebviewClosure), + CreateWindow(WindowId, CreateWindowClosure), + CreateRawWindow( + WindowId, + Box (String, TaoWindowBuilder) + Send>, + Sender>>, + ), + UserEvent(T), +} + +impl Clone for Message { + fn clone(&self) -> Self { + match self { + Self::UserEvent(t) => Self::UserEvent(t.clone()), + _ => unimplemented!(), + } + } +} + +/// The Tauri [`WebviewDispatch`] for [`Wry`]. +#[derive(Debug, Clone)] +pub struct WryWebviewDispatcher { + window_id: Arc>, + webview_id: WebviewId, + context: Context, +} + +impl WebviewDispatch for WryWebviewDispatcher { + type Runtime = Wry; + + fn run_on_main_thread(&self, f: F) -> Result<()> { + send_user_message(&self.context, Message::Task(Box::new(f))) + } + + fn on_webview_event(&self, f: F) -> WindowEventId { + let id = self.context.next_webview_event_id(); + let _ = self.context.proxy.send_event(Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::AddEventListener(id, Box::new(f)), + )); + id + } + + fn with_webview) + Send + 'static>(&self, f: F) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::WithWebview(Box::new(move |webview| f(Box::new(webview)))), + ), + ) + } + + #[cfg(any(debug_assertions, feature = "devtools"))] + fn open_devtools(&self) { + let _ = send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::OpenDevTools, + ), + ); + } + + #[cfg(any(debug_assertions, feature = "devtools"))] + fn close_devtools(&self) { + let _ = send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::CloseDevTools, + ), + ); + } + + /// Gets the devtools window's current open state. + #[cfg(any(debug_assertions, feature = "devtools"))] + fn is_devtools_open(&self) -> Result { + webview_getter!(self, WebviewMessage::IsDevToolsOpen) + } + + // Getters + + fn url(&self) -> Result { + webview_getter!(self, WebviewMessage::Url)? + } + + fn bounds(&self) -> Result { + webview_getter!(self, WebviewMessage::Bounds)? + } + + fn position(&self) -> Result> { + webview_getter!(self, WebviewMessage::Position)? + } + + fn size(&self) -> Result> { + webview_getter!(self, WebviewMessage::Size)? + } + + // Setters + + fn navigate(&self, url: Url) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::Navigate(url), + ), + ) + } + + fn reload(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::Reload, + ), + ) + } + + fn print(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::Print, + ), + ) + } + + fn close(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::Close, + ), + ) + } + + fn set_bounds(&self, bounds: tauri_runtime::dpi::Rect) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::SetBounds(bounds), + ), + ) + } + + fn set_size(&self, size: Size) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::SetSize(size), + ), + ) + } + + fn set_position(&self, position: Position) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::SetPosition(position), + ), + ) + } + + fn set_focus(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::SetFocus, + ), + ) + } + + fn reparent(&self, window_id: WindowId) -> Result<()> { + let mut current_window_id = self.window_id.lock().unwrap(); + let (tx, rx) = channel(); + send_user_message( + &self.context, + Message::Webview( + *current_window_id, + self.webview_id, + WebviewMessage::Reparent(window_id, tx), + ), + )?; + + rx.recv().unwrap()?; + + *current_window_id = window_id; + Ok(()) + } + + fn cookies_for_url(&self, url: Url) -> Result>> { + let current_window_id = self.window_id.lock().unwrap(); + let (tx, rx) = channel(); + send_user_message( + &self.context, + Message::Webview( + *current_window_id, + self.webview_id, + WebviewMessage::CookiesForUrl(url, tx), + ), + )?; + + rx.recv().unwrap() + } + + fn cookies(&self) -> Result>> { + webview_getter!(self, WebviewMessage::Cookies)? + } + + fn set_cookie(&self, cookie: Cookie<'_>) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::SetCookie(cookie.into_owned()), + ), + )?; + Ok(()) + } + + fn delete_cookie(&self, cookie: Cookie<'_>) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::DeleteCookie(cookie.into_owned()), + ), + )?; + Ok(()) + } + + fn set_auto_resize(&self, auto_resize: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::SetAutoResize(auto_resize), + ), + ) + } + + #[cfg(all(feature = "tracing", not(target_os = "android")))] + fn eval_script>(&self, script: S) -> Result<()> { + // use a channel so the EvaluateScript task uses the current span as parent + let (tx, rx) = channel(); + getter!( + self, + rx, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::EvaluateScript(script.into(), tx, tracing::Span::current()), + ) + ) + } + + #[cfg(not(all(feature = "tracing", not(target_os = "android"))))] + fn eval_script>(&self, script: S) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::EvaluateScript(script.into()), + ), + ) + } + + fn set_zoom(&self, scale_factor: f64) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::SetZoom(scale_factor), + ), + ) + } + + fn clear_all_browsing_data(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::ClearAllBrowsingData, + ), + ) + } + + fn hide(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::Hide, + ), + ) + } + + fn show(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::Show, + ), + ) + } + + fn set_background_color(&self, color: Option) -> Result<()> { + send_user_message( + &self.context, + Message::Webview( + *self.window_id.lock().unwrap(), + self.webview_id, + WebviewMessage::SetBackgroundColor(color), + ), + ) + } +} + +/// The Tauri [`WindowDispatch`] for [`Wry`]. +#[derive(Debug, Clone)] +pub struct WryWindowDispatcher { + window_id: WindowId, + context: Context, +} + +// SAFETY: this is safe since the `Context` usage is guarded on `send_user_message`. +#[allow(clippy::non_send_fields_in_send_ty)] +unsafe impl Sync for WryWindowDispatcher {} + +fn get_raw_window_handle( + dispatcher: &WryWindowDispatcher, +) -> Result> { + window_getter!(dispatcher, WindowMessage::RawWindowHandle) +} + +impl WindowDispatch for WryWindowDispatcher { + type Runtime = Wry; + type WindowBuilder = WindowBuilderWrapper; + + fn run_on_main_thread(&self, f: F) -> Result<()> { + send_user_message(&self.context, Message::Task(Box::new(f))) + } + + fn on_window_event(&self, f: F) -> WindowEventId { + let id = self.context.next_window_event_id(); + let _ = self.context.proxy.send_event(Message::Window( + self.window_id, + WindowMessage::AddEventListener(id, Box::new(f)), + )); + id + } + + // Getters + + fn scale_factor(&self) -> Result { + window_getter!(self, WindowMessage::ScaleFactor) + } + + fn inner_position(&self) -> Result> { + window_getter!(self, WindowMessage::InnerPosition)? + } + + fn outer_position(&self) -> Result> { + window_getter!(self, WindowMessage::OuterPosition)? + } + + fn inner_size(&self) -> Result> { + window_getter!(self, WindowMessage::InnerSize) + } + + fn outer_size(&self) -> Result> { + window_getter!(self, WindowMessage::OuterSize) + } + + fn is_fullscreen(&self) -> Result { + window_getter!(self, WindowMessage::IsFullscreen) + } + + fn is_minimized(&self) -> Result { + window_getter!(self, WindowMessage::IsMinimized) + } + + fn is_maximized(&self) -> Result { + window_getter!(self, WindowMessage::IsMaximized) + } + + fn is_focused(&self) -> Result { + window_getter!(self, WindowMessage::IsFocused) + } + + /// Gets the window's current decoration state. + fn is_decorated(&self) -> Result { + window_getter!(self, WindowMessage::IsDecorated) + } + + /// Gets the window's current resizable state. + fn is_resizable(&self) -> Result { + window_getter!(self, WindowMessage::IsResizable) + } + + /// Gets the current native window's maximize button state + fn is_maximizable(&self) -> Result { + window_getter!(self, WindowMessage::IsMaximizable) + } + + /// Gets the current native window's minimize button state + fn is_minimizable(&self) -> Result { + window_getter!(self, WindowMessage::IsMinimizable) + } + + /// Gets the current native window's close button state + fn is_closable(&self) -> Result { + window_getter!(self, WindowMessage::IsClosable) + } + + fn is_visible(&self) -> Result { + window_getter!(self, WindowMessage::IsVisible) + } + + fn title(&self) -> Result { + window_getter!(self, WindowMessage::Title) + } + + fn current_monitor(&self) -> Result> { + Ok(window_getter!(self, WindowMessage::CurrentMonitor)?.map(|m| MonitorHandleWrapper(m).into())) + } + + fn primary_monitor(&self) -> Result> { + Ok(window_getter!(self, WindowMessage::PrimaryMonitor)?.map(|m| MonitorHandleWrapper(m).into())) + } + + fn monitor_from_point(&self, x: f64, y: f64) -> Result> { + let (tx, rx) = channel(); + + let _ = send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::MonitorFromPoint(tx, (x, y))), + ); + + Ok( + rx.recv() + .map_err(|_| crate::Error::FailedToReceiveMessage)? + .map(|m| MonitorHandleWrapper(m).into()), + ) + } + + fn available_monitors(&self) -> Result> { + Ok( + window_getter!(self, WindowMessage::AvailableMonitors)? + .into_iter() + .map(|m| MonitorHandleWrapper(m).into()) + .collect(), + ) + } + + fn theme(&self) -> Result { + window_getter!(self, WindowMessage::Theme) + } + + fn is_enabled(&self) -> Result { + window_getter!(self, WindowMessage::IsEnabled) + } + + fn is_always_on_top(&self) -> Result { + window_getter!(self, WindowMessage::IsAlwaysOnTop) + } + + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + fn gtk_window(&self) -> Result { + window_getter!(self, WindowMessage::GtkWindow).map(|w| w.0) + } + + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + fn default_vbox(&self) -> Result { + window_getter!(self, WindowMessage::GtkBox).map(|w| w.0) + } + + fn window_handle( + &self, + ) -> std::result::Result, raw_window_handle::HandleError> { + get_raw_window_handle(self) + .map_err(|_| raw_window_handle::HandleError::Unavailable) + .and_then(|r| r.map(|h| unsafe { raw_window_handle::WindowHandle::borrow_raw(h.0) })) + } + + // Setters + + fn center(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::Center), + ) + } + + fn request_user_attention(&self, request_type: Option) -> Result<()> { + send_user_message( + &self.context, + Message::Window( + self.window_id, + WindowMessage::RequestUserAttention(request_type.map(Into::into)), + ), + ) + } + + // Creates a window by dispatching a message to the event loop. + // Note that this must be called from a separate thread, otherwise the channel will introduce a deadlock. + fn create_window( + &mut self, + pending: PendingWindow, + after_window_creation: Option, + ) -> Result> { + self.context.create_window(pending, after_window_creation) + } + + // Creates a webview by dispatching a message to the event loop. + // Note that this must be called from a separate thread, otherwise the channel will introduce a deadlock. + fn create_webview( + &mut self, + pending: PendingWebview, + ) -> Result> { + self.context.create_webview(self.window_id, pending) + } + + fn set_resizable(&self, resizable: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetResizable(resizable)), + ) + } + + fn set_enabled(&self, enabled: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetEnabled(enabled)), + ) + } + + fn set_maximizable(&self, maximizable: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetMaximizable(maximizable)), + ) + } + + fn set_minimizable(&self, minimizable: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetMinimizable(minimizable)), + ) + } + + fn set_closable(&self, closable: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetClosable(closable)), + ) + } + + fn set_title>(&self, title: S) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetTitle(title.into())), + ) + } + + fn maximize(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::Maximize), + ) + } + + fn unmaximize(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::Unmaximize), + ) + } + + fn minimize(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::Minimize), + ) + } + + fn unminimize(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::Unminimize), + ) + } + + fn show(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::Show), + ) + } + + fn hide(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::Hide), + ) + } + + fn close(&self) -> Result<()> { + // NOTE: close cannot use the `send_user_message` function because it accesses the event loop callback + self + .context + .proxy + .send_event(Message::Window(self.window_id, WindowMessage::Close)) + .map_err(|_| Error::FailedToSendMessage) + } + + fn destroy(&self) -> Result<()> { + // NOTE: destroy cannot use the `send_user_message` function because it accesses the event loop callback + self + .context + .proxy + .send_event(Message::Window(self.window_id, WindowMessage::Destroy)) + .map_err(|_| Error::FailedToSendMessage) + } + + fn set_decorations(&self, decorations: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetDecorations(decorations)), + ) + } + + fn set_shadow(&self, enable: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetShadow(enable)), + ) + } + + fn set_always_on_bottom(&self, always_on_bottom: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window( + self.window_id, + WindowMessage::SetAlwaysOnBottom(always_on_bottom), + ), + ) + } + + fn set_always_on_top(&self, always_on_top: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetAlwaysOnTop(always_on_top)), + ) + } + + fn set_visible_on_all_workspaces(&self, visible_on_all_workspaces: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window( + self.window_id, + WindowMessage::SetVisibleOnAllWorkspaces(visible_on_all_workspaces), + ), + ) + } + + fn set_content_protected(&self, protected: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window( + self.window_id, + WindowMessage::SetContentProtected(protected), + ), + ) + } + + fn set_size(&self, size: Size) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetSize(size)), + ) + } + + fn set_min_size(&self, size: Option) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetMinSize(size)), + ) + } + + fn set_max_size(&self, size: Option) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetMaxSize(size)), + ) + } + + fn set_size_constraints(&self, constraints: WindowSizeConstraints) -> Result<()> { + send_user_message( + &self.context, + Message::Window( + self.window_id, + WindowMessage::SetSizeConstraints(constraints), + ), + ) + } + + fn set_position(&self, position: Position) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetPosition(position)), + ) + } + + fn set_fullscreen(&self, fullscreen: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetFullscreen(fullscreen)), + ) + } + + #[cfg(target_os = "macos")] + fn set_simple_fullscreen(&self, enable: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetSimpleFullscreen(enable)), + ) + } + + fn set_focus(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetFocus), + ) + } + + fn set_focusable(&self, focusable: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetFocusable(focusable)), + ) + } + + fn set_icon(&self, icon: Icon) -> Result<()> { + send_user_message( + &self.context, + Message::Window( + self.window_id, + WindowMessage::SetIcon(TaoIcon::try_from(icon)?.0), + ), + ) + } + + fn set_skip_taskbar(&self, skip: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetSkipTaskbar(skip)), + ) + } + + fn set_cursor_grab(&self, grab: bool) -> crate::Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetCursorGrab(grab)), + ) + } + + fn set_cursor_visible(&self, visible: bool) -> crate::Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetCursorVisible(visible)), + ) + } + + fn set_cursor_icon(&self, icon: CursorIcon) -> crate::Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetCursorIcon(icon)), + ) + } + + fn set_cursor_position>(&self, position: Pos) -> crate::Result<()> { + send_user_message( + &self.context, + Message::Window( + self.window_id, + WindowMessage::SetCursorPosition(position.into()), + ), + ) + } + + fn set_ignore_cursor_events(&self, ignore: bool) -> crate::Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetIgnoreCursorEvents(ignore)), + ) + } + + fn start_dragging(&self) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::DragWindow), + ) + } + + fn start_resize_dragging(&self, direction: tauri_runtime::ResizeDirection) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::ResizeDragWindow(direction)), + ) + } + + fn set_badge_count(&self, count: Option, desktop_filename: Option) -> Result<()> { + send_user_message( + &self.context, + Message::Window( + self.window_id, + WindowMessage::SetBadgeCount(count, desktop_filename), + ), + ) + } + + fn set_badge_label(&self, label: Option) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetBadgeLabel(label)), + ) + } + + fn set_overlay_icon(&self, icon: Option) -> Result<()> { + let icon: Result> = icon.map_or(Ok(None), |x| Ok(Some(TaoIcon::try_from(x)?))); + + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetOverlayIcon(icon?)), + ) + } + + fn set_progress_bar(&self, progress_state: ProgressBarState) -> Result<()> { + send_user_message( + &self.context, + Message::Window( + self.window_id, + WindowMessage::SetProgressBar(progress_state), + ), + ) + } + + fn set_title_bar_style(&self, style: tauri_utils::TitleBarStyle) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetTitleBarStyle(style)), + ) + } + + fn set_traffic_light_position(&self, position: Position) -> Result<()> { + send_user_message( + &self.context, + Message::Window( + self.window_id, + WindowMessage::SetTrafficLightPosition(position), + ), + ) + } + + fn set_theme(&self, theme: Option) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetTheme(theme)), + ) + } + + fn set_background_color(&self, color: Option) -> Result<()> { + send_user_message( + &self.context, + Message::Window(self.window_id, WindowMessage::SetBackgroundColor(color)), + ) + } +} + +#[derive(Clone)] +pub struct WebviewWrapper { + label: String, + id: WebviewId, + inner: Rc, + context_store: WebContextStore, + webview_event_listeners: WebviewEventListeners, + // the key of the WebContext if it's not shared + context_key: Option, + bounds: Arc>>, +} + +impl Deref for WebviewWrapper { + type Target = WebView; + + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.inner + } +} + +impl Drop for WebviewWrapper { + fn drop(&mut self) { + if Rc::get_mut(&mut self.inner).is_some() { + let mut context_store = self.context_store.lock().unwrap(); + + if let Some(web_context) = context_store.get_mut(&self.context_key) { + web_context.referenced_by_webviews.remove(&self.label); + + // https://github.com/tauri-apps/tauri/issues/14626 + // Because WebKit does not close its network process even when no webviews are running, + // we need to ensure to re-use the existing process on Linux by keeping the WebContext + // alive for the lifetime of the app. + // WebKit on macOS handles this itself. + #[cfg(not(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + )))] + if web_context.referenced_by_webviews.is_empty() { + context_store.remove(&self.context_key); + } + } + } + } +} + +pub struct WindowWrapper { + label: String, + inner: Option>, + // whether this window has child webviews + // or it's just a container for a single webview + has_children: AtomicBool, + webviews: Vec, + window_event_listeners: WindowEventListeners, + #[cfg(windows)] + background_color: Option, + #[cfg(windows)] + is_window_transparent: bool, + #[cfg(windows)] + surface: Option, Arc>>, + focused_webview: Arc>>, +} + +impl WindowWrapper { + pub fn label(&self) -> &str { + &self.label + } +} + +impl fmt::Debug for WindowWrapper { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("WindowWrapper") + .field("label", &self.label) + .field("inner", &self.inner) + .finish() + } +} + +#[derive(Debug, Clone)] +pub struct EventProxy(TaoEventLoopProxy>); + +#[cfg(target_os = "ios")] +#[allow(clippy::non_send_fields_in_send_ty)] +unsafe impl Sync for EventProxy {} + +impl EventLoopProxy for EventProxy { + fn send_event(&self, event: T) -> Result<()> { + self + .0 + .send_event(Message::UserEvent(event)) + .map_err(|_| Error::EventLoopClosed) + } +} + +pub trait PluginBuilder { + type Plugin: Plugin; + fn build(self, context: Context) -> Self::Plugin; +} + +pub trait Plugin { + fn on_event( + &mut self, + event: &Event>, + event_loop: &EventLoopWindowTarget>, + proxy: &TaoEventLoopProxy>, + control_flow: &mut ControlFlow, + context: EventLoopIterationContext<'_, T>, + web_context: &WebContextStore, + ) -> bool; +} + +/// A Tauri [`Runtime`] wrapper around wry. +pub struct Wry { + context: Context, + event_loop: EventLoop>, +} + +impl fmt::Debug for Wry { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Wry") + .field("main_thread_id", &self.context.main_thread_id) + .field("event_loop", &self.event_loop) + .field("windows", &self.context.main_thread.windows) + .field("web_context", &self.context.main_thread.web_context) + .finish() + } +} + +/// A handle to the Wry runtime. +#[derive(Debug, Clone)] +pub struct WryHandle { + context: Context, +} + +// SAFETY: this is safe since the `Context` usage is guarded on `send_user_message`. +#[allow(clippy::non_send_fields_in_send_ty)] +unsafe impl Sync for WryHandle {} + +impl WryHandle { + /// Creates a new tao window using a callback, and returns its window id. + pub fn create_tao_window (String, TaoWindowBuilder) + Send + 'static>( + &self, + f: F, + ) -> Result> { + let id = self.context.next_window_id(); + let (tx, rx) = channel(); + send_user_message(&self.context, Message::CreateRawWindow(id, Box::new(f), tx))?; + rx.recv().unwrap() + } + + /// Gets the [`WebviewId'] associated with the given [`WindowId`]. + pub fn window_id(&self, window_id: TaoWindowId) -> WindowId { + *self + .context + .window_id_map + .0 + .lock() + .unwrap() + .get(&window_id) + .unwrap() + } + + /// Send a message to the event loop. + pub fn send_event(&self, message: Message) -> Result<()> { + self + .context + .proxy + .send_event(message) + .map_err(|_| Error::FailedToSendMessage)?; + Ok(()) + } + + pub fn plugin + 'static>(&mut self, plugin: P) + where +

>::Plugin: Send, + { + self + .context + .plugins + .lock() + .unwrap() + .push(Box::new(plugin.build(self.context.clone()))); + } +} + +impl RuntimeHandle for WryHandle { + type Runtime = Wry; + + fn create_proxy(&self) -> EventProxy { + EventProxy(self.context.proxy.clone()) + } + + #[cfg(target_os = "macos")] + fn set_activation_policy(&self, activation_policy: ActivationPolicy) -> Result<()> { + send_user_message( + &self.context, + Message::SetActivationPolicy(activation_policy), + ) + } + + #[cfg(target_os = "macos")] + fn set_dock_visibility(&self, visible: bool) -> Result<()> { + send_user_message(&self.context, Message::SetDockVisibility(visible)) + } + + fn request_exit(&self, code: i32) -> Result<()> { + // NOTE: request_exit cannot use the `send_user_message` function because it accesses the event loop callback + self + .context + .proxy + .send_event(Message::RequestExit(code)) + .map_err(|_| Error::FailedToSendMessage) + } + + // Creates a window by dispatching a message to the event loop. + // Note that this must be called from a separate thread, otherwise the channel will introduce a deadlock. + fn create_window( + &self, + pending: PendingWindow, + after_window_creation: Option, + ) -> Result> { + self.context.create_window(pending, after_window_creation) + } + + // Creates a webview by dispatching a message to the event loop. + // Note that this must be called from a separate thread, otherwise the channel will introduce a deadlock. + fn create_webview( + &self, + window_id: WindowId, + pending: PendingWebview, + ) -> Result> { + self.context.create_webview(window_id, pending) + } + + fn run_on_main_thread(&self, f: F) -> Result<()> { + send_user_message(&self.context, Message::Task(Box::new(f))) + } + + fn display_handle( + &self, + ) -> std::result::Result, raw_window_handle::HandleError> { + self.context.main_thread.window_target.display_handle() + } + + fn primary_monitor(&self) -> Option { + self + .context + .main_thread + .window_target + .primary_monitor() + .map(|m| MonitorHandleWrapper(m).into()) + } + + fn monitor_from_point(&self, x: f64, y: f64) -> Option { + self + .context + .main_thread + .window_target + .monitor_from_point(x, y) + .map(|m| MonitorHandleWrapper(m).into()) + } + + fn available_monitors(&self) -> Vec { + self + .context + .main_thread + .window_target + .available_monitors() + .map(|m| MonitorHandleWrapper(m).into()) + .collect() + } + + fn cursor_position(&self) -> Result> { + event_loop_window_getter!(self, EventLoopWindowTargetMessage::CursorPosition)? + .map(PhysicalPositionWrapper) + .map(Into::into) + .map_err(|_| Error::FailedToGetCursorPosition) + } + + fn set_theme(&self, theme: Option) { + let _ = send_user_message( + &self.context, + Message::EventLoopWindowTarget(EventLoopWindowTargetMessage::SetTheme(theme)), + ); + } + + #[cfg(target_os = "macos")] + fn show(&self) -> tauri_runtime::Result<()> { + send_user_message( + &self.context, + Message::Application(ApplicationMessage::Show), + ) + } + + #[cfg(target_os = "macos")] + fn hide(&self) -> tauri_runtime::Result<()> { + send_user_message( + &self.context, + Message::Application(ApplicationMessage::Hide), + ) + } + + fn set_device_event_filter(&self, filter: DeviceEventFilter) { + let _ = send_user_message( + &self.context, + Message::EventLoopWindowTarget(EventLoopWindowTargetMessage::SetDeviceEventFilter(filter)), + ); + } + + #[cfg(target_os = "android")] + fn find_class<'a>( + &self, + env: &mut jni::JNIEnv<'a>, + activity: &jni::objects::JObject<'_>, + name: impl Into, + ) -> std::result::Result, jni::errors::Error> { + find_class(env, activity, name.into()) + } + + #[cfg(target_os = "android")] + fn run_on_android_context(&self, f: F) + where + F: FnOnce(&mut jni::JNIEnv, &jni::objects::JObject, &jni::objects::JObject) + Send + 'static, + { + dispatch(f) + } + + #[cfg(any(target_os = "macos", target_os = "ios"))] + fn fetch_data_store_identifiers) + Send + 'static>( + &self, + cb: F, + ) -> Result<()> { + send_user_message( + &self.context, + Message::Application(ApplicationMessage::FetchDataStoreIdentifiers(Box::new(cb))), + ) + } + + #[cfg(any(target_os = "macos", target_os = "ios"))] + fn remove_data_store) + Send + 'static>( + &self, + uuid: [u8; 16], + cb: F, + ) -> Result<()> { + send_user_message( + &self.context, + Message::Application(ApplicationMessage::RemoveDataStore(uuid, Box::new(cb))), + ) + } +} + +impl Wry { + fn init_with_builder( + mut event_loop_builder: EventLoopBuilder>, + #[allow(unused_variables)] args: RuntimeInitArgs, + ) -> Result { + #[cfg(windows)] + if let Some(hook) = args.msg_hook { + use tao::platform::windows::EventLoopBuilderExtWindows; + event_loop_builder.with_msg_hook(hook); + } + + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + if let Some(app_id) = args.app_id { + use tao::platform::unix::EventLoopBuilderExtUnix; + event_loop_builder.with_app_id(app_id); + } + Self::init(event_loop_builder.build()) + } + + fn init(event_loop: EventLoop>) -> Result { + let main_thread_id = current_thread().id(); + let web_context = WebContextStore::default(); + + let windows = Arc::new(WindowsStore(RefCell::new(BTreeMap::default()))); + let window_id_map = WindowIdStore::default(); + + let context = Context { + window_id_map, + main_thread_id, + proxy: event_loop.create_proxy(), + main_thread: DispatcherMainThreadContext { + window_target: event_loop.deref().clone(), + web_context, + windows, + #[cfg(feature = "tracing")] + active_tracing_spans: Default::default(), + }, + plugins: Default::default(), + next_window_id: Default::default(), + next_webview_id: Default::default(), + next_window_event_id: Default::default(), + next_webview_event_id: Default::default(), + webview_runtime_installed: wry::webview_version().is_ok(), + }; + + Ok(Self { + context, + event_loop, + }) + } +} + +impl Runtime for Wry { + type WindowDispatcher = WryWindowDispatcher; + type WebviewDispatcher = WryWebviewDispatcher; + type Handle = WryHandle; + + type EventLoopProxy = EventProxy; + + fn new(args: RuntimeInitArgs) -> Result { + Self::init_with_builder(EventLoopBuilder::>::with_user_event(), args) + } + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + fn new_any_thread(args: RuntimeInitArgs) -> Result { + use tao::platform::unix::EventLoopBuilderExtUnix; + let mut event_loop_builder = EventLoopBuilder::>::with_user_event(); + event_loop_builder.with_any_thread(true); + Self::init_with_builder(event_loop_builder, args) + } + + #[cfg(windows)] + fn new_any_thread(args: RuntimeInitArgs) -> Result { + use tao::platform::windows::EventLoopBuilderExtWindows; + let mut event_loop_builder = EventLoopBuilder::>::with_user_event(); + event_loop_builder.with_any_thread(true); + Self::init_with_builder(event_loop_builder, args) + } + + fn create_proxy(&self) -> EventProxy { + EventProxy(self.event_loop.create_proxy()) + } + + fn handle(&self) -> Self::Handle { + WryHandle { + context: self.context.clone(), + } + } + + fn create_window( + &self, + pending: PendingWindow, + after_window_creation: Option, + ) -> Result> { + let label = pending.label.clone(); + let window_id = self.context.next_window_id(); + let (webview_id, use_https_scheme) = pending + .webview + .as_ref() + .map(|w| { + ( + Some(self.context.next_webview_id()), + w.webview_attributes.use_https_scheme, + ) + }) + .unwrap_or((None, false)); + + let window = create_window( + window_id, + webview_id.unwrap_or_default(), + &self.event_loop, + &self.context, + pending, + after_window_creation, + )?; + + let dispatcher = WryWindowDispatcher { + window_id, + context: self.context.clone(), + }; + + self + .context + .main_thread + .windows + .0 + .borrow_mut() + .insert(window_id, window); + + let detached_webview = webview_id.map(|id| { + let webview = DetachedWebview { + label: label.clone(), + dispatcher: WryWebviewDispatcher { + window_id: Arc::new(Mutex::new(window_id)), + webview_id: id, + context: self.context.clone(), + }, + }; + DetachedWindowWebview { + webview, + use_https_scheme, + } + }); + + Ok(DetachedWindow { + id: window_id, + label, + dispatcher, + webview: detached_webview, + }) + } + + fn create_webview( + &self, + window_id: WindowId, + pending: PendingWebview, + ) -> Result> { + let label = pending.label.clone(); + + let window = self + .context + .main_thread + .windows + .0 + .borrow() + .get(&window_id) + .map(|w| (w.inner.clone(), w.focused_webview.clone())); + if let Some((Some(window), focused_webview)) = window { + let window_id_wrapper = Arc::new(Mutex::new(window_id)); + + let webview_id = self.context.next_webview_id(); + + let webview = create_webview( + WebviewKind::WindowChild, + &window, + window_id_wrapper.clone(), + webview_id, + &self.context, + pending, + focused_webview, + )?; + + #[allow(unknown_lints, clippy::manual_inspect)] + self + .context + .main_thread + .windows + .0 + .borrow_mut() + .get_mut(&window_id) + .map(|w| { + w.webviews.push(webview); + w.has_children.store(true, Ordering::Relaxed); + w + }); + + let dispatcher = WryWebviewDispatcher { + window_id: window_id_wrapper, + webview_id, + context: self.context.clone(), + }; + + Ok(DetachedWebview { label, dispatcher }) + } else { + Err(Error::WindowNotFound) + } + } + + fn primary_monitor(&self) -> Option { + self + .context + .main_thread + .window_target + .primary_monitor() + .map(|m| MonitorHandleWrapper(m).into()) + } + + fn monitor_from_point(&self, x: f64, y: f64) -> Option { + self + .context + .main_thread + .window_target + .monitor_from_point(x, y) + .map(|m| MonitorHandleWrapper(m).into()) + } + + fn available_monitors(&self) -> Vec { + self + .context + .main_thread + .window_target + .available_monitors() + .map(|m| MonitorHandleWrapper(m).into()) + .collect() + } + + fn cursor_position(&self) -> Result> { + self + .context + .main_thread + .window_target + .cursor_position() + .map(PhysicalPositionWrapper) + .map(Into::into) + .map_err(|_| Error::FailedToGetCursorPosition) + } + + fn set_theme(&self, theme: Option) { + self.event_loop.set_theme(to_tao_theme(theme)); + } + + #[cfg(target_os = "macos")] + fn set_activation_policy(&mut self, activation_policy: ActivationPolicy) { + self + .event_loop + .set_activation_policy(tao_activation_policy(activation_policy)); + } + + #[cfg(target_os = "macos")] + fn set_dock_visibility(&mut self, visible: bool) { + self.event_loop.set_dock_visibility(visible); + } + + #[cfg(target_os = "macos")] + fn show(&self) { + self.event_loop.show_application(); + } + + #[cfg(target_os = "macos")] + fn hide(&self) { + self.event_loop.hide_application(); + } + + fn set_device_event_filter(&mut self, filter: DeviceEventFilter) { + self + .event_loop + .set_device_event_filter(DeviceEventFilterWrapper::from(filter).0); + } + + #[cfg(desktop)] + fn run_iteration) + 'static>(&mut self, mut callback: F) { + use tao::platform::run_return::EventLoopExtRunReturn; + let windows = self.context.main_thread.windows.clone(); + let window_id_map = self.context.window_id_map.clone(); + let web_context = &self.context.main_thread.web_context; + let plugins = self.context.plugins.clone(); + + #[cfg(feature = "tracing")] + let active_tracing_spans = self.context.main_thread.active_tracing_spans.clone(); + + let proxy = self.event_loop.create_proxy(); + + self + .event_loop + .run_return(|event, event_loop, control_flow| { + *control_flow = ControlFlow::Wait; + if let Event::MainEventsCleared = &event { + *control_flow = ControlFlow::Exit; + } + + for p in plugins.lock().unwrap().iter_mut() { + let prevent_default = p.on_event( + &event, + event_loop, + &proxy, + control_flow, + EventLoopIterationContext { + callback: &mut callback, + window_id_map: window_id_map.clone(), + windows: windows.clone(), + #[cfg(feature = "tracing")] + active_tracing_spans: active_tracing_spans.clone(), + }, + web_context, + ); + if prevent_default { + return; + } + } + + handle_event_loop( + event, + event_loop, + control_flow, + EventLoopIterationContext { + callback: &mut callback, + windows: windows.clone(), + window_id_map: window_id_map.clone(), + #[cfg(feature = "tracing")] + active_tracing_spans: active_tracing_spans.clone(), + }, + ); + }); + } + + fn run) + 'static>(self, callback: F) { + let event_handler = make_event_handler(&self, callback); + + self.event_loop.run(event_handler) + } + + #[cfg(not(target_os = "ios"))] + fn run_return) + 'static>(mut self, callback: F) -> i32 { + use tao::platform::run_return::EventLoopExtRunReturn; + + let event_handler = make_event_handler(&self, callback); + + self.event_loop.run_return(event_handler) + } + + #[cfg(target_os = "ios")] + fn run_return) + 'static>(self, callback: F) -> i32 { + self.run(callback); + 0 + } +} + +fn make_event_handler( + runtime: &Wry, + mut callback: F, +) -> impl FnMut(Event<'_, Message>, &EventLoopWindowTarget>, &mut ControlFlow) +where + T: UserEvent, + F: FnMut(RunEvent) + 'static, +{ + let windows = runtime.context.main_thread.windows.clone(); + let window_id_map = runtime.context.window_id_map.clone(); + let web_context = runtime.context.main_thread.web_context.clone(); + let plugins = runtime.context.plugins.clone(); + + #[cfg(feature = "tracing")] + let active_tracing_spans = runtime.context.main_thread.active_tracing_spans.clone(); + let proxy = runtime.event_loop.create_proxy(); + + move |event, event_loop, control_flow| { + for p in plugins.lock().unwrap().iter_mut() { + let prevent_default = p.on_event( + &event, + event_loop, + &proxy, + control_flow, + EventLoopIterationContext { + callback: &mut callback, + window_id_map: window_id_map.clone(), + windows: windows.clone(), + #[cfg(feature = "tracing")] + active_tracing_spans: active_tracing_spans.clone(), + }, + &web_context, + ); + if prevent_default { + return; + } + } + handle_event_loop( + event, + event_loop, + control_flow, + EventLoopIterationContext { + callback: &mut callback, + window_id_map: window_id_map.clone(), + windows: windows.clone(), + #[cfg(feature = "tracing")] + active_tracing_spans: active_tracing_spans.clone(), + }, + ); + } +} + +pub struct EventLoopIterationContext<'a, T: UserEvent> { + pub callback: &'a mut (dyn FnMut(RunEvent) + 'static), + pub window_id_map: WindowIdStore, + pub windows: Arc, + #[cfg(feature = "tracing")] + pub active_tracing_spans: ActiveTraceSpanStore, +} + +struct UserMessageContext { + windows: Arc, + window_id_map: WindowIdStore, +} + +fn handle_user_message( + event_loop: &EventLoopWindowTarget>, + message: Message, + context: UserMessageContext, +) { + let UserMessageContext { + window_id_map, + windows, + } = context; + match message { + Message::Task(task) => task(), + #[cfg(target_os = "macos")] + Message::SetActivationPolicy(activation_policy) => { + event_loop.set_activation_policy_at_runtime(tao_activation_policy(activation_policy)) + } + #[cfg(target_os = "macos")] + Message::SetDockVisibility(visible) => event_loop.set_dock_visibility(visible), + Message::RequestExit(_code) => panic!("cannot handle RequestExit on the main thread"), + Message::Application(application_message) => match application_message { + #[cfg(target_os = "macos")] + ApplicationMessage::Show => { + event_loop.show_application(); + } + #[cfg(target_os = "macos")] + ApplicationMessage::Hide => { + event_loop.hide_application(); + } + #[cfg(any(target_os = "macos", target_os = "ios"))] + ApplicationMessage::FetchDataStoreIdentifiers(cb) => { + if let Err(e) = WebView::fetch_data_store_identifiers(cb) { + // this shouldn't ever happen because we're running on the main thread + // but let's be safe and warn here + log::error!("failed to fetch data store identifiers: {e}"); + } + } + #[cfg(any(target_os = "macos", target_os = "ios"))] + ApplicationMessage::RemoveDataStore(uuid, cb) => { + WebView::remove_data_store(&uuid, move |res| { + cb(res.map_err(|_| Error::FailedToRemoveDataStore)) + }) + } + }, + Message::Window(id, window_message) => { + let w = windows.0.borrow().get(&id).map(|w| { + ( + w.inner.clone(), + w.webviews.clone(), + w.has_children.load(Ordering::Relaxed), + w.window_event_listeners.clone(), + ) + }); + if let Some((Some(window), webviews, has_children, window_event_listeners)) = w { + match window_message { + WindowMessage::AddEventListener(id, listener) => { + window_event_listeners.lock().unwrap().insert(id, listener); + } + + // Getters + WindowMessage::ScaleFactor(tx) => tx.send(window.scale_factor()).unwrap(), + WindowMessage::InnerPosition(tx) => tx + .send( + window + .inner_position() + .map(|p| PhysicalPositionWrapper(p).into()) + .map_err(|_| Error::FailedToSendMessage), + ) + .unwrap(), + WindowMessage::OuterPosition(tx) => tx + .send( + window + .outer_position() + .map(|p| PhysicalPositionWrapper(p).into()) + .map_err(|_| Error::FailedToSendMessage), + ) + .unwrap(), + WindowMessage::InnerSize(tx) => tx + .send(PhysicalSizeWrapper(inner_size(&window, &webviews, has_children)).into()) + .unwrap(), + WindowMessage::OuterSize(tx) => tx + .send(PhysicalSizeWrapper(window.outer_size()).into()) + .unwrap(), + WindowMessage::IsFullscreen(tx) => tx.send(window.fullscreen().is_some()).unwrap(), + WindowMessage::IsMinimized(tx) => tx.send(window.is_minimized()).unwrap(), + WindowMessage::IsMaximized(tx) => tx.send(window.is_maximized()).unwrap(), + WindowMessage::IsFocused(tx) => tx.send(window.is_focused()).unwrap(), + WindowMessage::IsDecorated(tx) => tx.send(window.is_decorated()).unwrap(), + WindowMessage::IsResizable(tx) => tx.send(window.is_resizable()).unwrap(), + WindowMessage::IsMaximizable(tx) => tx.send(window.is_maximizable()).unwrap(), + WindowMessage::IsMinimizable(tx) => tx.send(window.is_minimizable()).unwrap(), + WindowMessage::IsClosable(tx) => tx.send(window.is_closable()).unwrap(), + WindowMessage::IsVisible(tx) => tx.send(window.is_visible()).unwrap(), + WindowMessage::Title(tx) => tx.send(window.title()).unwrap(), + WindowMessage::CurrentMonitor(tx) => tx.send(window.current_monitor()).unwrap(), + WindowMessage::PrimaryMonitor(tx) => tx.send(window.primary_monitor()).unwrap(), + WindowMessage::MonitorFromPoint(tx, (x, y)) => { + tx.send(window.monitor_from_point(x, y)).unwrap() + } + WindowMessage::AvailableMonitors(tx) => { + tx.send(window.available_monitors().collect()).unwrap() + } + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + WindowMessage::GtkWindow(tx) => tx.send(GtkWindow(window.gtk_window().clone())).unwrap(), + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + WindowMessage::GtkBox(tx) => tx + .send(GtkBox(window.default_vbox().unwrap().clone())) + .unwrap(), + WindowMessage::RawWindowHandle(tx) => tx + .send( + window + .window_handle() + .map(|h| SendRawWindowHandle(h.as_raw())), + ) + .unwrap(), + WindowMessage::Theme(tx) => { + tx.send(map_theme(&window.theme())).unwrap(); + } + WindowMessage::IsEnabled(tx) => tx.send(window.is_enabled()).unwrap(), + WindowMessage::IsAlwaysOnTop(tx) => tx.send(window.is_always_on_top()).unwrap(), + // Setters + WindowMessage::Center => window.center(), + WindowMessage::RequestUserAttention(request_type) => { + window.request_user_attention(request_type.map(|r| r.0)); + } + WindowMessage::SetResizable(resizable) => { + window.set_resizable(resizable); + #[cfg(windows)] + if !resizable { + undecorated_resizing::detach_resize_handler(window.hwnd()); + } else if !window.is_decorated() { + undecorated_resizing::attach_resize_handler( + window.hwnd(), + window.has_undecorated_shadow(), + ); + } + } + WindowMessage::SetMaximizable(maximizable) => window.set_maximizable(maximizable), + WindowMessage::SetMinimizable(minimizable) => window.set_minimizable(minimizable), + WindowMessage::SetClosable(closable) => window.set_closable(closable), + WindowMessage::SetTitle(title) => window.set_title(&title), + WindowMessage::Maximize => window.set_maximized(true), + WindowMessage::Unmaximize => window.set_maximized(false), + WindowMessage::Minimize => window.set_minimized(true), + WindowMessage::Unminimize => window.set_minimized(false), + WindowMessage::SetEnabled(enabled) => window.set_enabled(enabled), + WindowMessage::Show => window.set_visible(true), + WindowMessage::Hide => window.set_visible(false), + WindowMessage::Close => { + panic!("cannot handle `WindowMessage::Close` on the main thread") + } + WindowMessage::Destroy => { + panic!("cannot handle `WindowMessage::Destroy` on the main thread") + } + WindowMessage::SetDecorations(decorations) => { + window.set_decorations(decorations); + #[cfg(windows)] + if decorations { + undecorated_resizing::detach_resize_handler(window.hwnd()); + } else if window.is_resizable() { + undecorated_resizing::attach_resize_handler( + window.hwnd(), + window.has_undecorated_shadow(), + ); + } + } + WindowMessage::SetShadow(_enable) => { + #[cfg(windows)] + { + window.set_undecorated_shadow(_enable); + undecorated_resizing::update_drag_hwnd_rgn_for_undecorated(window.hwnd(), _enable); + } + #[cfg(target_os = "macos")] + window.set_has_shadow(_enable); + } + WindowMessage::SetAlwaysOnBottom(always_on_bottom) => { + window.set_always_on_bottom(always_on_bottom) + } + WindowMessage::SetAlwaysOnTop(always_on_top) => window.set_always_on_top(always_on_top), + WindowMessage::SetVisibleOnAllWorkspaces(visible_on_all_workspaces) => { + window.set_visible_on_all_workspaces(visible_on_all_workspaces) + } + WindowMessage::SetContentProtected(protected) => window.set_content_protection(protected), + WindowMessage::SetSize(size) => { + window.set_inner_size(SizeWrapper::from(size).0); + } + WindowMessage::SetMinSize(size) => { + window.set_min_inner_size(size.map(|s| SizeWrapper::from(s).0)); + } + WindowMessage::SetMaxSize(size) => { + window.set_max_inner_size(size.map(|s| SizeWrapper::from(s).0)); + } + WindowMessage::SetSizeConstraints(constraints) => { + window.set_inner_size_constraints(tao::window::WindowSizeConstraints { + min_width: constraints.min_width, + min_height: constraints.min_height, + max_width: constraints.max_width, + max_height: constraints.max_height, + }); + } + WindowMessage::SetPosition(position) => { + window.set_outer_position(PositionWrapper::from(position).0) + } + WindowMessage::SetFullscreen(fullscreen) => { + if fullscreen { + window.set_fullscreen(Some(Fullscreen::Borderless(None))) + } else { + window.set_fullscreen(None) + } + } + + #[cfg(target_os = "macos")] + WindowMessage::SetSimpleFullscreen(enable) => { + window.set_simple_fullscreen(enable); + } + + WindowMessage::SetFocus => { + window.set_focus(); + } + WindowMessage::SetFocusable(focusable) => { + window.set_focusable(focusable); + } + WindowMessage::SetIcon(icon) => { + window.set_window_icon(Some(icon)); + } + #[allow(unused_variables)] + WindowMessage::SetSkipTaskbar(skip) => { + #[cfg(any( + windows, + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + let _ = window.set_skip_taskbar(skip); + } + WindowMessage::SetCursorGrab(grab) => { + let _ = window.set_cursor_grab(grab); + } + WindowMessage::SetCursorVisible(visible) => { + window.set_cursor_visible(visible); + } + WindowMessage::SetCursorIcon(icon) => { + window.set_cursor_icon(CursorIconWrapper::from(icon).0); + } + WindowMessage::SetCursorPosition(position) => { + let _ = window.set_cursor_position(PositionWrapper::from(position).0); + } + WindowMessage::SetIgnoreCursorEvents(ignore) => { + let _ = window.set_ignore_cursor_events(ignore); + } + WindowMessage::DragWindow => { + let _ = window.drag_window(); + } + WindowMessage::ResizeDragWindow(direction) => { + let _ = window.drag_resize_window(match direction { + tauri_runtime::ResizeDirection::East => tao::window::ResizeDirection::East, + tauri_runtime::ResizeDirection::North => tao::window::ResizeDirection::North, + tauri_runtime::ResizeDirection::NorthEast => tao::window::ResizeDirection::NorthEast, + tauri_runtime::ResizeDirection::NorthWest => tao::window::ResizeDirection::NorthWest, + tauri_runtime::ResizeDirection::South => tao::window::ResizeDirection::South, + tauri_runtime::ResizeDirection::SouthEast => tao::window::ResizeDirection::SouthEast, + tauri_runtime::ResizeDirection::SouthWest => tao::window::ResizeDirection::SouthWest, + tauri_runtime::ResizeDirection::West => tao::window::ResizeDirection::West, + }); + } + WindowMessage::RequestRedraw => { + window.request_redraw(); + } + WindowMessage::SetBadgeCount(_count, _desktop_filename) => { + #[cfg(target_os = "ios")] + window.set_badge_count( + _count.map_or(0, |x| x.clamp(i32::MIN as i64, i32::MAX as i64) as i32), + ); + + #[cfg(target_os = "macos")] + window.set_badge_label(_count.map(|x| x.to_string())); + + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + window.set_badge_count(_count, _desktop_filename); + } + WindowMessage::SetBadgeLabel(_label) => { + #[cfg(target_os = "macos")] + window.set_badge_label(_label); + } + WindowMessage::SetOverlayIcon(_icon) => { + #[cfg(windows)] + window.set_overlay_icon(_icon.map(|x| x.0).as_ref()); + } + WindowMessage::SetProgressBar(progress_state) => { + window.set_progress_bar(ProgressBarStateWrapper::from(progress_state).0); + } + WindowMessage::SetTitleBarStyle(_style) => { + #[cfg(target_os = "macos")] + match _style { + TitleBarStyle::Visible => { + window.set_titlebar_transparent(false); + window.set_fullsize_content_view(true); + } + TitleBarStyle::Transparent => { + window.set_titlebar_transparent(true); + window.set_fullsize_content_view(false); + } + TitleBarStyle::Overlay => { + window.set_titlebar_transparent(true); + window.set_fullsize_content_view(true); + } + unknown => { + #[cfg(feature = "tracing")] + tracing::warn!("unknown title bar style applied: {unknown}"); + + #[cfg(not(feature = "tracing"))] + eprintln!("unknown title bar style applied: {unknown}"); + } + }; + } + WindowMessage::SetTrafficLightPosition(_position) => { + #[cfg(target_os = "macos")] + window.set_traffic_light_inset(_position); + } + WindowMessage::SetTheme(theme) => { + window.set_theme(to_tao_theme(theme)); + } + WindowMessage::SetBackgroundColor(color) => { + window.set_background_color(color.map(Into::into)) + } + } + } + } + Message::Webview(window_id, webview_id, webview_message) => { + #[cfg(any( + target_os = "macos", + windows, + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + if let WebviewMessage::Reparent(new_parent_window_id, tx) = webview_message { + let webview_handle = windows.0.borrow_mut().get_mut(&window_id).and_then(|w| { + w.webviews + .iter() + .position(|w| w.id == webview_id) + .map(|webview_index| w.webviews.remove(webview_index)) + }); + + if let Some(webview) = webview_handle { + if let Some((Some(new_parent_window), new_parent_window_webviews)) = windows + .0 + .borrow_mut() + .get_mut(&new_parent_window_id) + .map(|w| (w.inner.clone(), &mut w.webviews)) + { + #[cfg(target_os = "macos")] + let reparent_result = { + use wry::WebViewExtMacOS; + webview.inner.reparent(new_parent_window.ns_window() as _) + }; + #[cfg(windows)] + let reparent_result = { webview.inner.reparent(new_parent_window.hwnd()) }; + + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + let reparent_result = { + if let Some(container) = new_parent_window.default_vbox() { + let (_, children) = gtk_child_layout::containers(container); + webview.inner.reparent(&children) + } else { + Err(wry::Error::MessageSender) + } + }; + + match reparent_result { + Ok(_) => { + new_parent_window_webviews.push(webview); + tx.send(Ok(())).unwrap(); + } + Err(e) => { + log::error!("failed to reparent webview: {e}"); + tx.send(Err(Error::FailedToSendMessage)).unwrap(); + } + } + } + } else { + tx.send(Err(Error::FailedToSendMessage)).unwrap(); + } + + return; + } + + let webview_handle = windows.0.borrow().get(&window_id).map(|w| { + ( + w.inner.clone(), + w.webviews.iter().find(|w| w.id == webview_id).cloned(), + ) + }); + if let Some((Some(window), Some(webview))) = webview_handle { + match webview_message { + WebviewMessage::WebviewEvent(_) => { /* already handled */ } + WebviewMessage::SynthesizedWindowEvent(_) => { /* already handled */ } + WebviewMessage::Reparent(_window_id, _tx) => { /* already handled */ } + WebviewMessage::AddEventListener(id, listener) => { + webview + .webview_event_listeners + .lock() + .unwrap() + .insert(id, listener); + } + + #[cfg(all(feature = "tracing", not(target_os = "android")))] + WebviewMessage::EvaluateScript(script, tx, span) => { + let _span = span.entered(); + if let Err(e) = webview.evaluate_script(&script) { + log::error!("{e}"); + } + tx.send(()).unwrap(); + } + #[cfg(not(all(feature = "tracing", not(target_os = "android"))))] + WebviewMessage::EvaluateScript(script) => { + if let Err(e) = webview.evaluate_script(&script) { + log::error!("{e}"); + } + } + WebviewMessage::Navigate(url) => { + if let Err(e) = webview.load_url(url.as_str()) { + log::error!("failed to navigate to url {}: {}", url, e); + } + } + WebviewMessage::Reload => { + if let Err(e) = webview.reload() { + log::error!("failed to reload: {e}"); + } + } + WebviewMessage::Show => { + if let Err(e) = webview.set_visible(true) { + log::error!("failed to change webview visibility: {e}"); + } + } + WebviewMessage::Hide => { + if let Err(e) = webview.set_visible(false) { + log::error!("failed to change webview visibility: {e}"); + } + } + WebviewMessage::Print => { + let _ = webview.print(); + } + WebviewMessage::Close => { + #[allow(unknown_lints, clippy::manual_inspect)] + windows.0.borrow_mut().get_mut(&window_id).map(|window| { + if let Some(i) = window.webviews.iter().position(|w| w.id == webview.id) { + window.webviews.remove(i); + } + window + }); + } + WebviewMessage::SetBounds(bounds) => { + let bounds: RectWrapper = bounds.into(); + let bounds = bounds.0; + + if let Some(b) = &mut *webview.bounds.lock().unwrap() { + let scale_factor = window.scale_factor(); + let size = bounds.size.to_logical::(scale_factor); + let position = bounds.position.to_logical::(scale_factor); + let window_size = window.inner_size().to_logical::(scale_factor); + b.width_rate = size.width / window_size.width; + b.height_rate = size.height / window_size.height; + b.x_rate = position.x / window_size.width; + b.y_rate = position.y / window_size.height; + } + + if let Err(e) = webview.set_bounds(bounds) { + log::error!("failed to set webview size: {e}"); + } + } + WebviewMessage::SetSize(size) => match webview.bounds() { + Ok(mut bounds) => { + bounds.size = size; + + let scale_factor = window.scale_factor(); + let size = size.to_logical::(scale_factor); + + if let Some(b) = &mut *webview.bounds.lock().unwrap() { + let window_size = window.inner_size().to_logical::(scale_factor); + b.width_rate = size.width / window_size.width; + b.height_rate = size.height / window_size.height; + } + + if let Err(e) = webview.set_bounds(bounds) { + log::error!("failed to set webview size: {e}"); + } + } + Err(e) => { + log::error!("failed to get webview bounds: {e}"); + } + }, + WebviewMessage::SetPosition(position) => match webview.bounds() { + Ok(mut bounds) => { + bounds.position = position; + + let scale_factor = window.scale_factor(); + let position = position.to_logical::(scale_factor); + + if let Some(b) = &mut *webview.bounds.lock().unwrap() { + let window_size = window.inner_size().to_logical::(scale_factor); + b.x_rate = position.x / window_size.width; + b.y_rate = position.y / window_size.height; + } + + if let Err(e) = webview.set_bounds(bounds) { + log::error!("failed to set webview position: {e}"); + } + } + Err(e) => { + log::error!("failed to get webview bounds: {e}"); + } + }, + WebviewMessage::SetZoom(scale_factor) => { + if let Err(e) = webview.zoom(scale_factor) { + log::error!("failed to set webview zoom: {e}"); + } + } + WebviewMessage::SetBackgroundColor(color) => { + if let Err(e) = + webview.set_background_color(color.map(Into::into).unwrap_or((255, 255, 255, 255))) + { + log::error!("failed to set webview background color: {e}"); + } + } + WebviewMessage::ClearAllBrowsingData => { + if let Err(e) = webview.clear_all_browsing_data() { + log::error!("failed to clear webview browsing data: {e}"); + } + } + // Getters + WebviewMessage::Url(tx) => { + tx.send( + webview + .url() + .map(|u| u.parse().expect("invalid webview URL")) + .map_err(|_| Error::FailedToSendMessage), + ) + .unwrap(); + } + + WebviewMessage::Cookies(tx) => { + tx.send(webview.cookies().map_err(|_| Error::FailedToSendMessage)) + .unwrap(); + } + + WebviewMessage::SetCookie(cookie) => { + if let Err(e) = webview.set_cookie(&cookie) { + log::error!("failed to set webview cookie: {e}"); + } + } + + WebviewMessage::DeleteCookie(cookie) => { + if let Err(e) = webview.delete_cookie(&cookie) { + log::error!("failed to delete webview cookie: {e}"); + } + } + + WebviewMessage::CookiesForUrl(url, tx) => { + let webview_cookies = webview + .cookies_for_url(url.as_str()) + .map_err(|_| Error::FailedToSendMessage); + tx.send(webview_cookies).unwrap(); + } + + WebviewMessage::Bounds(tx) => { + tx.send( + webview + .bounds() + .map(|bounds| tauri_runtime::dpi::Rect { + size: bounds.size, + position: bounds.position, + }) + .map_err(|_| Error::FailedToSendMessage), + ) + .unwrap(); + } + WebviewMessage::Position(tx) => { + tx.send( + webview + .bounds() + .map(|bounds| bounds.position.to_physical(window.scale_factor())) + .map_err(|_| Error::FailedToSendMessage), + ) + .unwrap(); + } + WebviewMessage::Size(tx) => { + tx.send( + webview + .bounds() + .map(|bounds| bounds.size.to_physical(window.scale_factor())) + .map_err(|_| Error::FailedToSendMessage), + ) + .unwrap(); + } + WebviewMessage::SetFocus => { + if let Err(e) = webview.focus() { + log::error!("failed to focus webview: {e}"); + } + } + WebviewMessage::SetAutoResize(auto_resize) => match webview.bounds() { + Ok(bounds) => { + let scale_factor = window.scale_factor(); + let window_size = window.inner_size().to_logical::(scale_factor); + *webview.bounds.lock().unwrap() = if auto_resize { + let size = bounds.size.to_logical::(scale_factor); + let position = bounds.position.to_logical::(scale_factor); + Some(WebviewBounds { + x_rate: position.x / window_size.width, + y_rate: position.y / window_size.height, + width_rate: size.width / window_size.width, + height_rate: size.height / window_size.height, + }) + } else { + None + }; + } + Err(e) => { + log::error!("failed to get webview bounds: {e}"); + } + }, + WebviewMessage::WithWebview(f) => { + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + { + f(webview.webview()); + } + #[cfg(target_os = "macos")] + { + use wry::WebViewExtMacOS; + f(Webview { + webview: Retained::into_raw(webview.webview()) as *mut objc2::runtime::AnyObject + as *mut std::ffi::c_void, + manager: Retained::into_raw(webview.manager()) as *mut objc2::runtime::AnyObject + as *mut std::ffi::c_void, + ns_window: Retained::into_raw(webview.ns_window()) as *mut objc2::runtime::AnyObject + as *mut std::ffi::c_void, + }); + } + #[cfg(target_os = "ios")] + { + use wry::WebViewExtIOS; + + f(Webview { + webview: Retained::into_raw(webview.inner.webview()) + as *mut objc2::runtime::AnyObject + as *mut std::ffi::c_void, + manager: Retained::into_raw(webview.inner.manager()) + as *mut objc2::runtime::AnyObject + as *mut std::ffi::c_void, + view_controller: window.ui_view_controller(), + }); + } + #[cfg(windows)] + { + f(Webview { + controller: webview.controller(), + environment: webview.environment(), + }); + } + #[cfg(target_os = "android")] + { + f(webview.handle()) + } + } + #[cfg(any(debug_assertions, feature = "devtools"))] + WebviewMessage::OpenDevTools => { + webview.open_devtools(); + } + #[cfg(any(debug_assertions, feature = "devtools"))] + WebviewMessage::CloseDevTools => { + webview.close_devtools(); + } + #[cfg(any(debug_assertions, feature = "devtools"))] + WebviewMessage::IsDevToolsOpen(tx) => { + tx.send(webview.is_devtools_open()).unwrap(); + } + } + } + } + Message::CreateWebview(window_id, handler) => { + let window = windows + .0 + .borrow() + .get(&window_id) + .map(|w| (w.inner.clone(), w.focused_webview.clone())); + if let Some((Some(window), focused_webview)) = window { + match handler(&window, CreateWebviewOptions { focused_webview }) { + Ok(webview) => { + #[allow(unknown_lints, clippy::manual_inspect)] + windows.0.borrow_mut().get_mut(&window_id).map(|w| { + w.webviews.push(webview); + w.has_children.store(true, Ordering::Relaxed); + w + }); + } + Err(e) => { + log::error!("{e}"); + } + } + } + } + Message::CreateWindow(window_id, handler) => match handler(event_loop) { + // wait for borrow_mut to be available - on Windows we might poll for the window to be inserted + Ok(webview) => loop { + if let Ok(mut windows) = windows.0.try_borrow_mut() { + windows.insert(window_id, webview); + break; + } + }, + Err(e) => { + log::error!("{e}"); + } + }, + Message::CreateRawWindow(window_id, handler, sender) => { + let (label, builder) = handler(); + + #[cfg(windows)] + let background_color = builder.window.background_color; + #[cfg(windows)] + let is_window_transparent = builder.window.transparent; + + if let Ok(window) = builder.build(event_loop) { + window_id_map.insert(window.id(), window_id); + + let window = Arc::new(window); + + #[cfg(windows)] + let surface = if is_window_transparent { + if let Ok(context) = softbuffer::Context::new(window.clone()) { + if let Ok(mut surface) = softbuffer::Surface::new(&context, window.clone()) { + window.draw_surface(&mut surface, background_color); + Some(surface) + } else { + None + } + } else { + None + } + } else { + None + }; + + windows.0.borrow_mut().insert( + window_id, + WindowWrapper { + label, + has_children: AtomicBool::new(false), + inner: Some(window.clone()), + window_event_listeners: Default::default(), + webviews: Vec::new(), + #[cfg(windows)] + background_color, + #[cfg(windows)] + is_window_transparent, + #[cfg(windows)] + surface, + focused_webview: Default::default(), + }, + ); + sender.send(Ok(Arc::downgrade(&window))).unwrap(); + } else { + sender.send(Err(Error::CreateWindow)).unwrap(); + } + } + + Message::UserEvent(_) => (), + Message::EventLoopWindowTarget(message) => match message { + EventLoopWindowTargetMessage::CursorPosition(sender) => { + let pos = event_loop + .cursor_position() + .map_err(|_| Error::FailedToSendMessage); + sender.send(pos).unwrap(); + } + EventLoopWindowTargetMessage::SetTheme(theme) => { + event_loop.set_theme(to_tao_theme(theme)); + } + EventLoopWindowTargetMessage::SetDeviceEventFilter(filter) => { + event_loop.set_device_event_filter(DeviceEventFilterWrapper::from(filter).0); + } + }, + } +} + +fn handle_event_loop( + event: Event<'_, Message>, + event_loop: &EventLoopWindowTarget>, + control_flow: &mut ControlFlow, + context: EventLoopIterationContext<'_, T>, +) { + let EventLoopIterationContext { + callback, + window_id_map, + windows, + #[cfg(feature = "tracing")] + active_tracing_spans, + } = context; + if *control_flow != ControlFlow::Exit { + *control_flow = ControlFlow::Wait; + } + + match event { + Event::NewEvents(StartCause::Init) => { + callback(RunEvent::Ready); + } + + Event::NewEvents(StartCause::Poll) => { + callback(RunEvent::Resumed); + } + + Event::MainEventsCleared => { + callback(RunEvent::MainEventsCleared); + } + + Event::LoopDestroyed => { + callback(RunEvent::Exit); + } + + #[cfg(windows)] + Event::RedrawRequested(id) => { + if let Some(window_id) = window_id_map.get(&id) { + let mut windows_ref = windows.0.borrow_mut(); + if let Some(window) = windows_ref.get_mut(&window_id) { + if window.is_window_transparent { + let background_color = window.background_color; + if let Some(surface) = &mut window.surface { + if let Some(window) = &window.inner { + window.draw_surface(surface, background_color); + } + } + } + } + } + } + + #[cfg(feature = "tracing")] + Event::RedrawEventsCleared => { + active_tracing_spans.remove_window_draw(); + } + + Event::UserEvent(Message::Webview( + window_id, + webview_id, + WebviewMessage::WebviewEvent(event), + )) => { + let windows_ref = windows.0.borrow(); + if let Some(window) = windows_ref.get(&window_id) { + if let Some(webview) = window.webviews.iter().find(|w| w.id == webview_id) { + let label = webview.label.clone(); + let webview_event_listeners = webview.webview_event_listeners.clone(); + + drop(windows_ref); + + callback(RunEvent::WebviewEvent { + label, + event: event.clone(), + }); + let listeners = webview_event_listeners.lock().unwrap(); + let handlers = listeners.values(); + for handler in handlers { + handler(&event); + } + } + } + } + + Event::UserEvent(Message::Webview( + window_id, + _webview_id, + WebviewMessage::SynthesizedWindowEvent(event), + )) => { + if let Some(event) = WindowEventWrapper::from(event).0 { + let windows_ref = windows.0.borrow(); + let window = windows_ref.get(&window_id); + if let Some(window) = window { + let label = window.label.clone(); + let window_event_listeners = window.window_event_listeners.clone(); + + drop(windows_ref); + + callback(RunEvent::WindowEvent { + label, + event: event.clone(), + }); + + let listeners = window_event_listeners.lock().unwrap(); + let handlers = listeners.values(); + for handler in handlers { + handler(&event); + } + } + } + } + + Event::WindowEvent { + event, window_id, .. + } => { + if let Some(window_id) = window_id_map.get(&window_id) { + { + let windows_ref = windows.0.borrow(); + if let Some(window) = windows_ref.get(&window_id) { + if let Some(event) = WindowEventWrapper::parse(window, &event).0 { + let label = window.label.clone(); + let window_event_listeners = window.window_event_listeners.clone(); + + drop(windows_ref); + + callback(RunEvent::WindowEvent { + label, + event: event.clone(), + }); + let listeners = window_event_listeners.lock().unwrap(); + let handlers = listeners.values(); + for handler in handlers { + handler(&event); + } + } + } + } + + match event { + #[cfg(windows)] + TaoWindowEvent::ThemeChanged(theme) => { + if let Some(window) = windows.0.borrow().get(&window_id) { + for webview in &window.webviews { + let theme = match theme { + TaoTheme::Dark => wry::Theme::Dark, + TaoTheme::Light => wry::Theme::Light, + _ => wry::Theme::Light, + }; + if let Err(e) = webview.set_theme(theme) { + log::error!("failed to set theme: {e}"); + } + } + } + } + TaoWindowEvent::CloseRequested => { + on_close_requested(callback, window_id, windows); + } + TaoWindowEvent::Destroyed => { + let removed = windows.0.borrow_mut().remove(&window_id).is_some(); + if removed { + let is_empty = windows.0.borrow().is_empty(); + if is_empty { + let (tx, rx) = channel(); + callback(RunEvent::ExitRequested { code: None, tx }); + + let recv = rx.try_recv(); + let should_prevent = matches!(recv, Ok(ExitRequestedEventAction::Prevent)); + + if !should_prevent { + *control_flow = ControlFlow::Exit; + } + } + } + } + TaoWindowEvent::Resized(size) => { + if let Some((Some(window), webviews)) = windows + .0 + .borrow() + .get(&window_id) + .map(|w| (w.inner.clone(), w.webviews.clone())) + { + let size = size.to_logical::(window.scale_factor()); + for webview in webviews { + if let Some(b) = &*webview.bounds.lock().unwrap() { + if let Err(e) = webview.set_bounds(wry::Rect { + position: LogicalPosition::new(size.width * b.x_rate, size.height * b.y_rate) + .into(), + size: LogicalSize::new(size.width * b.width_rate, size.height * b.height_rate) + .into(), + }) { + log::error!("failed to autoresize webview: {e}"); + } + } + } + } + } + _ => {} + } + } + } + Event::UserEvent(message) => match message { + Message::RequestExit(code) => { + let (tx, rx) = channel(); + callback(RunEvent::ExitRequested { + code: Some(code), + tx, + }); + + let recv = rx.try_recv(); + let should_prevent = matches!(recv, Ok(ExitRequestedEventAction::Prevent)); + + if !should_prevent { + *control_flow = ControlFlow::Exit; + } + } + Message::Window(id, WindowMessage::Close) => { + on_close_requested(callback, id, windows); + } + Message::Window(id, WindowMessage::Destroy) => { + on_window_close(id, windows); + } + Message::UserEvent(t) => callback(RunEvent::UserEvent(t)), + message => { + handle_user_message( + event_loop, + message, + UserMessageContext { + window_id_map, + windows, + }, + ); + } + }, + #[cfg(any(target_os = "macos", target_os = "ios"))] + Event::Opened { urls } => { + callback(RunEvent::Opened { urls }); + } + #[cfg(target_os = "macos")] + Event::Reopen { + has_visible_windows, + .. + } => callback(RunEvent::Reopen { + has_visible_windows, + }), + _ => (), + } +} + +fn on_close_requested<'a, T: UserEvent>( + callback: &'a mut (dyn FnMut(RunEvent) + 'static), + window_id: WindowId, + windows: Arc, +) { + let (tx, rx) = channel(); + let windows_ref = windows.0.borrow(); + if let Some(w) = windows_ref.get(&window_id) { + let label = w.label.clone(); + let window_event_listeners = w.window_event_listeners.clone(); + + drop(windows_ref); + + let listeners = window_event_listeners.lock().unwrap(); + let handlers = listeners.values(); + for handler in handlers { + handler(&WindowEvent::CloseRequested { + signal_tx: tx.clone(), + }); + } + callback(RunEvent::WindowEvent { + label, + event: WindowEvent::CloseRequested { signal_tx: tx }, + }); + if let Ok(true) = rx.try_recv() { + } else { + on_window_close(window_id, windows); + } + } +} + +fn on_window_close(window_id: WindowId, windows: Arc) { + if let Some(window_wrapper) = windows.0.borrow_mut().get_mut(&window_id) { + window_wrapper.inner = None; + #[cfg(windows)] + window_wrapper.surface.take(); + } +} + +fn parse_proxy_url(url: &Url) -> Result { + let host = url.host().map(|h| h.to_string()).unwrap_or_default(); + let port = url.port().map(|p| p.to_string()).unwrap_or_default(); + + if url.scheme() == "http" { + let config = ProxyConfig::Http(ProxyEndpoint { host, port }); + + Ok(config) + } else if url.scheme() == "socks5" { + let config = ProxyConfig::Socks5(ProxyEndpoint { host, port }); + + Ok(config) + } else { + Err(Error::InvalidProxyUrl) + } +} + +fn create_window( + window_id: WindowId, + webview_id: u32, + event_loop: &EventLoopWindowTarget>, + context: &Context, + pending: PendingWindow>, + after_window_creation: Option, +) -> Result { + #[allow(unused_mut)] + let PendingWindow { + mut window_builder, + label, + webview, + } = pending; + + #[cfg(feature = "tracing")] + let _webview_create_span = tracing::debug_span!("wry::webview::create").entered(); + #[cfg(feature = "tracing")] + let window_draw_span = tracing::debug_span!("wry::window::draw").entered(); + #[cfg(feature = "tracing")] + let window_create_span = + tracing::debug_span!(parent: &window_draw_span, "wry::window::create").entered(); + + let window_event_listeners = WindowEventListeners::default(); + + #[cfg(windows)] + let background_color = window_builder.inner.window.background_color; + #[cfg(windows)] + let is_window_transparent = window_builder.inner.window.transparent; + + #[cfg(target_os = "macos")] + { + if window_builder.tabbing_identifier.is_none() + || window_builder.inner.window.transparent + || !window_builder.inner.window.decorations + { + window_builder.inner = window_builder.inner.with_automatic_window_tabbing(false); + } + } + + #[cfg(desktop)] + if window_builder.prevent_overflow.is_some() || window_builder.center { + let monitor = if let Some(window_position) = &window_builder.inner.window.position { + event_loop.available_monitors().find(|m| { + let monitor_pos = m.position(); + let monitor_size = m.size(); + + // type annotations required for 32bit targets. + let window_position = window_position.to_physical::(m.scale_factor()); + + monitor_pos.x <= window_position.x + && window_position.x < monitor_pos.x + monitor_size.width as i32 + && monitor_pos.y <= window_position.y + && window_position.y < monitor_pos.y + monitor_size.height as i32 + }) + } else { + event_loop.primary_monitor() + }; + if let Some(monitor) = monitor { + let scale_factor = monitor.scale_factor(); + let desired_size = window_builder + .inner + .window + .inner_size + .unwrap_or_else(|| TaoPhysicalSize::new(800, 600).into()); + let mut inner_size = window_builder + .inner + .window + .inner_size_constraints + .clamp(desired_size, scale_factor) + .to_physical::(scale_factor); + let mut window_size = inner_size; + #[allow(unused_mut)] + // Left and right window shadow counts as part of the window on Windows + // We need to include it when calculating positions, but not size + let mut shadow_width = 0; + #[cfg(windows)] + if window_builder.inner.window.decorations { + use windows::Win32::UI::WindowsAndMessaging::{AdjustWindowRect, WS_OVERLAPPEDWINDOW}; + let mut rect = windows::Win32::Foundation::RECT::default(); + let result = unsafe { AdjustWindowRect(&mut rect, WS_OVERLAPPEDWINDOW, false) }; + if result.is_ok() { + shadow_width = (rect.right - rect.left) as u32; + // rect.bottom is made out of shadow, and we don't care about it + window_size.height += -rect.top as u32; + } + } + + if let Some(margin) = window_builder.prevent_overflow { + let work_area = monitor.work_area(); + let margin = margin.to_physical::(scale_factor); + let constraint = PhysicalSize::new( + work_area.size.width - margin.width, + work_area.size.height - margin.height, + ); + if window_size.width > constraint.width || window_size.height > constraint.height { + if window_size.width > constraint.width { + inner_size.width = inner_size + .width + .saturating_sub(window_size.width - constraint.width); + window_size.width = constraint.width; + } + if window_size.height > constraint.height { + inner_size.height = inner_size + .height + .saturating_sub(window_size.height - constraint.height); + window_size.height = constraint.height; + } + window_builder.inner.window.inner_size = Some(inner_size.into()); + } + } + + if window_builder.center { + window_size.width += shadow_width; + let position = window::calculate_window_center_position(window_size, monitor); + let logical_position = position.to_logical::(scale_factor); + window_builder = window_builder.position(logical_position.x, logical_position.y); + } + } + }; + + let window = window_builder + .inner + .build(event_loop) + .map_err(|_| Error::CreateWindow)?; + + #[cfg(feature = "tracing")] + { + drop(window_create_span); + + context + .main_thread + .active_tracing_spans + .0 + .borrow_mut() + .push(ActiveTracingSpan::WindowDraw { + id: window.id(), + span: window_draw_span, + }); + } + + context.window_id_map.insert(window.id(), window_id); + + if let Some(handler) = after_window_creation { + let raw = RawWindow { + #[cfg(windows)] + hwnd: window.hwnd(), + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + gtk_window: window.gtk_window(), + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + default_vbox: window.default_vbox(), + _marker: &std::marker::PhantomData, + }; + handler(raw); + } + + let mut webviews = Vec::new(); + + let focused_webview = Arc::new(Mutex::new(None)); + + if let Some(webview) = webview { + webviews.push(create_webview( + #[cfg(feature = "unstable")] + WebviewKind::WindowChild, + #[cfg(not(feature = "unstable"))] + WebviewKind::WindowContent, + &window, + Arc::new(Mutex::new(window_id)), + webview_id, + context, + webview, + focused_webview.clone(), + )?); + } + + let window = Arc::new(window); + + #[cfg(windows)] + let surface = if is_window_transparent { + if let Ok(context) = softbuffer::Context::new(window.clone()) { + if let Ok(mut surface) = softbuffer::Surface::new(&context, window.clone()) { + window.draw_surface(&mut surface, background_color); + Some(surface) + } else { + None + } + } else { + None + } + } else { + None + }; + + Ok(WindowWrapper { + label, + has_children: AtomicBool::new(false), + inner: Some(window), + webviews, + window_event_listeners, + #[cfg(windows)] + background_color, + #[cfg(windows)] + is_window_transparent, + #[cfg(windows)] + surface, + focused_webview, + }) +} + +/// the kind of the webview +#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] +enum WebviewKind { + // webview is the entire window content + WindowContent, + // webview is a child of the window, which can contain other webviews too + WindowChild, +} + +#[derive(Debug, Clone)] +struct WebviewBounds { + x_rate: f32, + y_rate: f32, + width_rate: f32, + height_rate: f32, +} + +fn create_webview( + kind: WebviewKind, + window: &Window, + window_id: Arc>, + id: WebviewId, + context: &Context, + pending: PendingWebview>, + #[allow(unused_variables)] focused_webview: Arc>>, +) -> Result { + if !context.webview_runtime_installed { + #[cfg(all(not(debug_assertions), windows))] + dialog::error( + r#"Could not find the WebView2 Runtime. + +Make sure it is installed or download it from https://developer.microsoft.com/en-us/microsoft-edge/webview2 + +You may have it installed on another user account, but it is not available for this one. +"#, + ); + + if cfg!(target_os = "macos") { + log::warn!("WebKit webview runtime not found, attempting to create webview anyway."); + } else { + return Err(Error::WebviewRuntimeNotInstalled); + } + } + + #[allow(unused_mut)] + let PendingWebview { + webview_attributes, + uri_scheme_protocols, + label, + ipc_handler, + url, + .. + } = pending; + + let mut web_context = context + .main_thread + .web_context + .lock() + .expect("poisoned WebContext store"); + let is_first_context = web_context.is_empty(); + // the context must be stored on the HashMap because it must outlive the WebView on macOS + let automation_enabled = std::env::var("TAURI_WEBVIEW_AUTOMATION").as_deref() == Ok("true"); + let web_context_key = webview_attributes.data_directory; + let entry = web_context.entry(web_context_key.clone()); + let web_context = match entry { + Occupied(occupied) => { + let occupied = occupied.into_mut(); + occupied.referenced_by_webviews.insert(label.clone()); + occupied + } + Vacant(vacant) => { + let mut web_context = WryWebContext::new(web_context_key.clone()); + web_context.set_allows_automation(if automation_enabled { + is_first_context + } else { + false + }); + vacant.insert(WebContext { + inner: web_context, + referenced_by_webviews: [label.clone()].into(), + registered_custom_protocols: HashSet::new(), + }) + } + }; + + let mut webview_builder = WebViewBuilder::new_with_web_context(&mut web_context.inner) + .with_id(&label) + .with_focused(webview_attributes.focus) + .with_transparent(webview_attributes.transparent) + .with_accept_first_mouse(webview_attributes.accept_first_mouse) + .with_incognito(webview_attributes.incognito) + .with_clipboard(webview_attributes.clipboard) + .with_hotkeys_zoom(webview_attributes.zoom_hotkeys_enabled); + + if url != "about:blank" { + webview_builder = webview_builder.with_url(&url); + } + + #[cfg(target_os = "macos")] + if let Some(webview_configuration) = webview_attributes.webview_configuration { + webview_builder = webview_builder.with_webview_configuration(webview_configuration); + } + + #[cfg(any(target_os = "windows", target_os = "android"))] + { + webview_builder = webview_builder.with_https_scheme(webview_attributes.use_https_scheme); + } + + if let Some(background_throttling) = webview_attributes.background_throttling { + webview_builder = webview_builder.with_background_throttling(match background_throttling { + tauri_utils::config::BackgroundThrottlingPolicy::Disabled => { + wry::BackgroundThrottlingPolicy::Disabled + } + tauri_utils::config::BackgroundThrottlingPolicy::Suspend => { + wry::BackgroundThrottlingPolicy::Suspend + } + tauri_utils::config::BackgroundThrottlingPolicy::Throttle => { + wry::BackgroundThrottlingPolicy::Throttle + } + }); + } + + if webview_attributes.javascript_disabled { + webview_builder = webview_builder.with_javascript_disabled(); + } + + if let Some(color) = webview_attributes.background_color { + webview_builder = webview_builder.with_background_color(color.into()); + } + + if webview_attributes.drag_drop_handler_enabled { + let proxy = context.proxy.clone(); + let window_id_ = window_id.clone(); + webview_builder = webview_builder.with_drag_drop_handler(move |event| { + let event = match event { + WryDragDropEvent::Enter { + paths, + position: (x, y), + } => DragDropEvent::Enter { + paths, + position: PhysicalPosition::new(x as _, y as _), + }, + WryDragDropEvent::Over { position: (x, y) } => DragDropEvent::Over { + position: PhysicalPosition::new(x as _, y as _), + }, + WryDragDropEvent::Drop { + paths, + position: (x, y), + } => DragDropEvent::Drop { + paths, + position: PhysicalPosition::new(x as _, y as _), + }, + WryDragDropEvent::Leave => DragDropEvent::Leave, + _ => unimplemented!(), + }; + + let message = if kind == WebviewKind::WindowContent { + WebviewMessage::SynthesizedWindowEvent(SynthesizedWindowEvent::DragDrop(event)) + } else { + WebviewMessage::WebviewEvent(WebviewEvent::DragDrop(event)) + }; + + let _ = proxy.send_event(Message::Webview(*window_id_.lock().unwrap(), id, message)); + true + }); + } + + if let Some(navigation_handler) = pending.navigation_handler { + webview_builder = webview_builder.with_navigation_handler(move |url| { + url + .parse() + .map(|url| navigation_handler(&url)) + .unwrap_or(true) + }); + } + + if let Some(new_window_handler) = pending.new_window_handler { + #[cfg(desktop)] + let context = context.clone(); + webview_builder = webview_builder.with_new_window_req_handler(move |url, features| { + url + .parse() + .map(|url| { + let response = new_window_handler( + url, + tauri_runtime::webview::NewWindowFeatures::new( + features.size, + features.position, + tauri_runtime::webview::NewWindowOpener { + #[cfg(desktop)] + webview: features.opener.webview, + #[cfg(windows)] + environment: features.opener.environment, + #[cfg(target_os = "macos")] + target_configuration: features.opener.target_configuration, + }, + ), + ); + match response { + tauri_runtime::webview::NewWindowResponse::Allow => wry::NewWindowResponse::Allow, + #[cfg(desktop)] + tauri_runtime::webview::NewWindowResponse::Create { window_id } => { + let windows = &context.main_thread.windows.0; + let webview = loop { + if let Some(webview) = windows.try_borrow().ok().and_then(|windows| { + windows + .get(&window_id) + .map(|window| window.webviews.first().unwrap().clone()) + }) { + break webview; + } else { + // on Windows the window is created async so we should wait for it to be available + std::thread::sleep(std::time::Duration::from_millis(50)); + continue; + }; + }; + + #[cfg(desktop)] + wry::NewWindowResponse::Create { + #[cfg(target_os = "macos")] + webview: wry::WebViewExtMacOS::webview(&*webview).as_super().into(), + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd", + ))] + webview: webview.webview(), + #[cfg(windows)] + webview: webview.webview(), + } + } + tauri_runtime::webview::NewWindowResponse::Deny => wry::NewWindowResponse::Deny, + } + }) + .unwrap_or(wry::NewWindowResponse::Deny) + }); + } + + if let Some(document_title_changed_handler) = pending.document_title_changed_handler { + webview_builder = + webview_builder.with_document_title_changed_handler(document_title_changed_handler) + } + + let webview_bounds = if let Some(bounds) = webview_attributes.bounds { + let bounds: RectWrapper = bounds.into(); + let bounds = bounds.0; + + let scale_factor = window.scale_factor(); + let position = bounds.position.to_logical::(scale_factor); + let size = bounds.size.to_logical::(scale_factor); + + webview_builder = webview_builder.with_bounds(bounds); + + let window_size = window.inner_size().to_logical::(scale_factor); + + if webview_attributes.auto_resize { + Some(WebviewBounds { + x_rate: position.x / window_size.width, + y_rate: position.y / window_size.height, + width_rate: size.width / window_size.width, + height_rate: size.height / window_size.height, + }) + } else { + None + } + } else { + #[cfg(feature = "unstable")] + { + webview_builder = webview_builder.with_bounds(wry::Rect { + position: LogicalPosition::new(0, 0).into(), + size: window.inner_size().into(), + }); + Some(WebviewBounds { + x_rate: 0., + y_rate: 0., + width_rate: 1., + height_rate: 1., + }) + } + #[cfg(not(feature = "unstable"))] + None + }; + + if let Some(download_handler) = pending.download_handler { + let download_handler_ = download_handler.clone(); + webview_builder = webview_builder.with_download_started_handler(move |url, path| { + if let Ok(url) = url.parse() { + download_handler_(DownloadEvent::Requested { + url, + destination: path, + }) + } else { + false + } + }); + webview_builder = webview_builder.with_download_completed_handler(move |url, path, success| { + if let Ok(url) = url.parse() { + download_handler(DownloadEvent::Finished { url, path, success }); + } + }); + } + + if let Some(page_load_handler) = pending.on_page_load_handler { + webview_builder = webview_builder.with_on_page_load_handler(move |event, url| { + let _ = url.parse().map(|url| { + page_load_handler( + url, + match event { + wry::PageLoadEvent::Started => tauri_runtime::webview::PageLoadEvent::Started, + wry::PageLoadEvent::Finished => tauri_runtime::webview::PageLoadEvent::Finished, + }, + ) + }); + }); + } + + if let Some(user_agent) = webview_attributes.user_agent { + webview_builder = webview_builder.with_user_agent(&user_agent); + } + + if let Some(proxy_url) = webview_attributes.proxy_url { + let config = parse_proxy_url(&proxy_url)?; + + webview_builder = webview_builder.with_proxy_config(config); + } + + #[cfg(windows)] + { + if let Some(additional_browser_args) = webview_attributes.additional_browser_args { + webview_builder = webview_builder.with_additional_browser_args(&additional_browser_args); + } + + if let Some(environment) = webview_attributes.environment { + webview_builder = webview_builder.with_environment(environment); + } + + webview_builder = webview_builder.with_theme(match window.theme() { + TaoTheme::Dark => wry::Theme::Dark, + TaoTheme::Light => wry::Theme::Light, + _ => wry::Theme::Light, + }); + + webview_builder = + webview_builder.with_scroll_bar_style(match webview_attributes.scroll_bar_style { + ScrollBarStyle::Default => WryScrollBarStyle::Default, + ScrollBarStyle::FluentOverlay => WryScrollBarStyle::FluentOverlay, + _ => unreachable!(), + }); + } + + #[cfg(windows)] + { + webview_builder = webview_builder + .with_browser_extensions_enabled(webview_attributes.browser_extensions_enabled); + } + + #[cfg(any( + windows, + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + { + if let Some(path) = &webview_attributes.extensions_path { + webview_builder = webview_builder.with_extensions_path(path); + } + } + + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + { + if let Some(related_view) = webview_attributes.related_view { + webview_builder = webview_builder.with_related_view(related_view); + } + } + + #[cfg(any(target_os = "macos", target_os = "ios"))] + { + if let Some(data_store_identifier) = &webview_attributes.data_store_identifier { + webview_builder = webview_builder.with_data_store_identifier(*data_store_identifier); + } + + webview_builder = + webview_builder.with_allow_link_preview(webview_attributes.allow_link_preview); + } + + #[cfg(target_os = "ios")] + { + if let Some(input_accessory_view_builder) = webview_attributes.input_accessory_view_builder { + webview_builder = webview_builder + .with_input_accessory_view_builder(move |webview| input_accessory_view_builder.0(webview)); + } + } + + #[cfg(target_os = "macos")] + { + if let Some(position) = &webview_attributes.traffic_light_position { + webview_builder = webview_builder.with_traffic_light_inset(*position); + } + } + + webview_builder = webview_builder.with_ipc_handler(create_ipc_handler( + kind, + window_id.clone(), + id, + context.clone(), + label.clone(), + ipc_handler, + )); + + for script in webview_attributes.initialization_scripts { + webview_builder = webview_builder + .with_initialization_script_for_main_only(script.script, script.for_main_frame_only); + } + + for (scheme, protocol) in uri_scheme_protocols { + // on Linux the custom protocols are associated with the web context + // and you cannot register a scheme more than once + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + { + if web_context.registered_custom_protocols.contains(&scheme) { + continue; + } + + web_context + .registered_custom_protocols + .insert(scheme.clone()); + } + + webview_builder = webview_builder.with_asynchronous_custom_protocol( + scheme, + move |webview_id, request, responder| { + protocol( + webview_id, + request, + Box::new(move |response| responder.respond(response)), + ) + }, + ); + } + + #[cfg(any(debug_assertions, feature = "devtools"))] + { + webview_builder = webview_builder.with_devtools(webview_attributes.devtools.unwrap_or(true)); + } + + #[cfg(target_os = "android")] + { + if let Some(on_webview_created) = pending.on_webview_created { + webview_builder = webview_builder.on_webview_created(move |ctx| { + on_webview_created(tauri_runtime::webview::CreationContext { + env: ctx.env, + activity: ctx.activity, + webview: ctx.webview, + }) + }); + } + } + + let webview = match kind { + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + )))] + WebviewKind::WindowChild => { + let vbox = window.default_vbox().unwrap(); + let (_, children) = gtk_child_layout::containers(vbox); + webview_builder.build_gtk(&children) + } + #[cfg(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + ))] + WebviewKind::WindowChild => webview_builder.build_as_child(&window), + WebviewKind::WindowContent => { + #[cfg(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + ))] + let builder = webview_builder.build(&window); + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + )))] + let builder = { + let vbox = window.default_vbox().unwrap(); + let content = gtk_child_layout::content(vbox); + webview_builder.build_gtk(&content) + }; + builder + } + } + .map_err(|e| Error::CreateWebview(Box::new(e)))?; + + if kind == WebviewKind::WindowContent { + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + undecorated_resizing::attach_resize_handler(&webview); + #[cfg(windows)] + if window.is_resizable() && !window.is_decorated() { + undecorated_resizing::attach_resize_handler(window.hwnd(), window.has_undecorated_shadow()); + } + } + + #[cfg(windows)] + { + let controller = webview.controller(); + let proxy_clone = context.proxy.clone(); + let window_id_ = window_id.clone(); + let mut token = 0; + unsafe { + let label_ = label.clone(); + let focused_webview_ = focused_webview.clone(); + controller.add_GotFocus( + &FocusChangedEventHandler::create(Box::new(move |_, _| { + let mut focused_webview = focused_webview_.lock().unwrap(); + // when using multiwebview mode, we should check if the focus change is actually a "webview focus change" + // instead of a window focus change (here we're patching window events, so we only care about the actual window changing focus) + let already_focused = focused_webview.is_some(); + focused_webview.replace(label_.clone()); + + if !already_focused { + let _ = proxy_clone.send_event(Message::Webview( + *window_id_.lock().unwrap(), + id, + WebviewMessage::SynthesizedWindowEvent(SynthesizedWindowEvent::Focused(true)), + )); + } + Ok(()) + })), + &mut token, + ) + } + .unwrap(); + unsafe { + let label_ = label.clone(); + let window_id_ = window_id.clone(); + let proxy_clone = context.proxy.clone(); + controller.add_LostFocus( + &FocusChangedEventHandler::create(Box::new(move |_, _| { + let mut focused_webview = focused_webview.lock().unwrap(); + // when using multiwebview mode, we should handle webview focus changes + // so we check is the currently focused webview matches this webview's + // (in this case, it means we lost the window focus) + // + // on multiwebview mode if we change focus to a different webview + // we get the gotFocus event of the other webview before the lostFocus + // so this check makes sense + let lost_window_focus = focused_webview.as_ref().map_or(true, |w| w == &label_); + + if lost_window_focus { + // only reset when we lost window focus - otherwise some other webview is focused + *focused_webview = None; + let _ = proxy_clone.send_event(Message::Webview( + *window_id_.lock().unwrap(), + id, + WebviewMessage::SynthesizedWindowEvent(SynthesizedWindowEvent::Focused(false)), + )); + } + Ok(()) + })), + &mut token, + ) + } + .unwrap(); + + if let Ok(webview) = unsafe { controller.CoreWebView2() } { + let proxy_clone = context.proxy.clone(); + unsafe { + let _ = webview.add_ContainsFullScreenElementChanged( + &ContainsFullScreenElementChangedEventHandler::create(Box::new(move |sender, _| { + let mut contains_fullscreen_element = windows::core::BOOL::default(); + sender + .ok_or_else(windows::core::Error::empty)? + .ContainsFullScreenElement(&mut contains_fullscreen_element)?; + let _ = proxy_clone.send_event(Message::Window( + *window_id.lock().unwrap(), + WindowMessage::SetFullscreen(contains_fullscreen_element.as_bool()), + )); + Ok(()) + })), + &mut token, + ); + } + } + } + + Ok(WebviewWrapper { + label, + id, + inner: Rc::new(webview), + context_store: context.main_thread.web_context.clone(), + webview_event_listeners: Default::default(), + context_key: if automation_enabled { + None + } else { + web_context_key + }, + bounds: Arc::new(Mutex::new(webview_bounds)), + }) +} + +/// Create a wry ipc handler from a tauri ipc handler. +fn create_ipc_handler( + _kind: WebviewKind, + window_id: Arc>, + webview_id: WebviewId, + context: Context, + label: String, + ipc_handler: Option>>, +) -> Box { + Box::new(move |request| { + if let Some(handler) = &ipc_handler { + handler( + DetachedWebview { + label: label.clone(), + dispatcher: WryWebviewDispatcher { + window_id: window_id.clone(), + webview_id, + context: context.clone(), + }, + }, + request, + ); + } + }) +} + +#[cfg(target_os = "macos")] +fn inner_size( + window: &Window, + webviews: &[WebviewWrapper], + has_children: bool, +) -> TaoPhysicalSize { + if !has_children && !webviews.is_empty() { + use wry::WebViewExtMacOS; + let webview = webviews.first().unwrap(); + let view = unsafe { Retained::cast_unchecked::(webview.webview()) }; + let view_frame = view.frame(); + let logical: TaoLogicalSize = (view_frame.size.width, view_frame.size.height).into(); + return logical.to_physical(window.scale_factor()); + } + + window.inner_size() +} + +#[cfg(not(target_os = "macos"))] +#[allow(unused_variables)] +fn inner_size( + window: &Window, + webviews: &[WebviewWrapper], + has_children: bool, +) -> TaoPhysicalSize { + window.inner_size() +} + +fn to_tao_theme(theme: Option) -> Option { + match theme { + Some(Theme::Light) => Some(TaoTheme::Light), + Some(Theme::Dark) => Some(TaoTheme::Dark), + _ => None, + } +} diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/linux.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/linux.rs new file mode 100644 index 0000000000..62f87eb05c --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/linux.rs @@ -0,0 +1,18 @@ +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use gtk::prelude::MonitorExt; +use tao::platform::unix::MonitorHandleExtUnix; +use tauri_runtime::dpi::{LogicalPosition, LogicalSize, PhysicalRect}; + +impl super::MonitorExt for tao::monitor::MonitorHandle { + fn work_area(&self) -> PhysicalRect { + let rect = self.gdk_monitor().workarea(); + let scale_factor = self.scale_factor(); + PhysicalRect { + size: LogicalSize::new(rect.width() as u32, rect.height() as u32).to_physical(scale_factor), + position: LogicalPosition::new(rect.x(), rect.y()).to_physical(scale_factor), + } + } +} diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/macos.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/macos.rs new file mode 100644 index 0000000000..6ed9f3c1dd --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/macos.rs @@ -0,0 +1,34 @@ +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use tauri_runtime::dpi::{LogicalSize, PhysicalRect}; + +impl super::MonitorExt for tao::monitor::MonitorHandle { + fn work_area(&self) -> PhysicalRect { + use objc2_app_kit::NSScreen; + use tao::platform::macos::MonitorHandleExtMacOS; + if let Some(ns_screen) = self.ns_screen() { + let ns_screen: &NSScreen = unsafe { &*ns_screen.cast() }; + let screen_frame = ns_screen.frame(); + let visible_frame = ns_screen.visibleFrame(); + + let scale_factor = self.scale_factor(); + + let mut position = self.position().to_logical::(scale_factor); + + position.x += visible_frame.origin.x - screen_frame.origin.x; + + PhysicalRect { + size: LogicalSize::new(visible_frame.size.width, visible_frame.size.height) + .to_physical(scale_factor), + position: position.to_physical(scale_factor), + } + } else { + PhysicalRect { + size: self.size(), + position: self.position(), + } + } + } +} diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/mod.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/mod.rs new file mode 100644 index 0000000000..4322c3cadb --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/mod.rs @@ -0,0 +1,37 @@ +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use tauri_runtime::dpi::PhysicalRect; + +#[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" +))] +mod linux; +#[cfg(target_os = "macos")] +mod macos; +#[cfg(windows)] +mod windows; + +pub trait MonitorExt { + /// Get the work area of this monitor + /// + /// ## Platform-specific: + /// + /// - **Android / iOS**: Unsupported. + fn work_area(&self) -> PhysicalRect; +} + +#[cfg(mobile)] +impl MonitorExt for tao::monitor::MonitorHandle { + fn work_area(&self) -> PhysicalRect { + PhysicalRect { + size: self.size(), + position: self.position(), + } + } +} diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/windows.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/windows.rs new file mode 100644 index 0000000000..8547ac9ddf --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/monitor/windows.rs @@ -0,0 +1,32 @@ +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use tao::dpi::{PhysicalPosition, PhysicalSize}; +use tauri_runtime::dpi::PhysicalRect; + +impl super::MonitorExt for tao::monitor::MonitorHandle { + fn work_area(&self) -> PhysicalRect { + use tao::platform::windows::MonitorHandleExtWindows; + use windows::Win32::Graphics::Gdi::{GetMonitorInfoW, HMONITOR, MONITORINFO}; + let mut monitor_info = MONITORINFO { + cbSize: std::mem::size_of::() as u32, + ..Default::default() + }; + let status = unsafe { GetMonitorInfoW(HMONITOR(self.hmonitor() as _), &mut monitor_info) }; + if status.as_bool() { + PhysicalRect { + size: PhysicalSize::new( + (monitor_info.rcWork.right - monitor_info.rcWork.left) as u32, + (monitor_info.rcWork.bottom - monitor_info.rcWork.top) as u32, + ), + position: PhysicalPosition::new(monitor_info.rcWork.left, monitor_info.rcWork.top), + } + } else { + PhysicalRect { + size: self.size(), + position: self.position(), + } + } + } +} diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/undecorated_resizing.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/undecorated_resizing.rs new file mode 100644 index 0000000000..66a98710cb --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/undecorated_resizing.rs @@ -0,0 +1,628 @@ +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +#![cfg(any( + windows, + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" +))] + +const CLIENT: isize = 0b0000; +const LEFT: isize = 0b0001; +const RIGHT: isize = 0b0010; +const TOP: isize = 0b0100; +const BOTTOM: isize = 0b1000; +const TOPLEFT: isize = TOP | LEFT; +const TOPRIGHT: isize = TOP | RIGHT; +const BOTTOMLEFT: isize = BOTTOM | LEFT; +const BOTTOMRIGHT: isize = BOTTOM | RIGHT; + +#[cfg(not(windows))] +pub use self::gtk::*; +#[cfg(windows)] +pub use self::windows::*; + +#[cfg(windows)] +type WindowPositions = i32; +#[cfg(not(windows))] +type WindowPositions = f64; + +#[derive(Debug, PartialEq, Eq, Clone, Copy)] +enum HitTestResult { + Client, + Left, + Right, + Top, + Bottom, + TopLeft, + TopRight, + BottomLeft, + BottomRight, + NoWhere, +} + +#[allow(clippy::too_many_arguments)] +fn hit_test( + left: WindowPositions, + top: WindowPositions, + right: WindowPositions, + bottom: WindowPositions, + cx: WindowPositions, + cy: WindowPositions, + border_x: WindowPositions, + border_y: WindowPositions, +) -> HitTestResult { + #[rustfmt::skip] + let result = (LEFT * (cx < left + border_x) as isize) + | (RIGHT * (cx >= right - border_x) as isize) + | (TOP * (cy < top + border_y) as isize) + | (BOTTOM * (cy >= bottom - border_y) as isize); + + match result { + CLIENT => HitTestResult::Client, + LEFT => HitTestResult::Left, + RIGHT => HitTestResult::Right, + TOP => HitTestResult::Top, + BOTTOM => HitTestResult::Bottom, + TOPLEFT => HitTestResult::TopLeft, + TOPRIGHT => HitTestResult::TopRight, + BOTTOMLEFT => HitTestResult::BottomLeft, + BOTTOMRIGHT => HitTestResult::BottomRight, + _ => HitTestResult::NoWhere, + } +} + +#[cfg(windows)] +mod windows { + use crate::util; + + use super::{hit_test, HitTestResult}; + + use windows::core::*; + use windows::Win32::System::LibraryLoader::*; + use windows::Win32::UI::WindowsAndMessaging::*; + use windows::Win32::{Foundation::*, UI::Shell::SetWindowSubclass}; + use windows::Win32::{Graphics::Gdi::*, UI::Shell::DefSubclassProc}; + + impl HitTestResult { + fn to_win32(self) -> i32 { + match self { + HitTestResult::Left => HTLEFT as _, + HitTestResult::Right => HTRIGHT as _, + HitTestResult::Top => HTTOP as _, + HitTestResult::Bottom => HTBOTTOM as _, + HitTestResult::TopLeft => HTTOPLEFT as _, + HitTestResult::TopRight => HTTOPRIGHT as _, + HitTestResult::BottomLeft => HTBOTTOMLEFT as _, + HitTestResult::BottomRight => HTBOTTOMRIGHT as _, + _ => HTTRANSPARENT, + } + } + } + + const CLASS_NAME: PCWSTR = w!("TAURI_DRAG_RESIZE_BORDERS"); + const WINDOW_NAME: PCWSTR = w!("TAURI_DRAG_RESIZE_WINDOW"); + + const WM_UPDATE_UNDECORATED_SHADOWS: u32 = WM_USER + 100; + + struct UndecoratedResizingData { + child: HWND, + has_undecorated_shadows: bool, + } + + pub fn attach_resize_handler(hwnd: isize, has_undecorated_shadows: bool) { + let parent = HWND(hwnd as _); + + // return early if we already attached + if unsafe { FindWindowExW(Some(parent), None, CLASS_NAME, WINDOW_NAME) }.is_ok() { + return; + } + + let class = WNDCLASSEXW { + cbSize: std::mem::size_of::() as u32, + style: WNDCLASS_STYLES::default(), + lpfnWndProc: Some(drag_resize_window_proc), + cbClsExtra: 0, + cbWndExtra: 0, + hInstance: unsafe { HINSTANCE(GetModuleHandleW(PCWSTR::null()).unwrap_or_default().0) }, + hIcon: HICON::default(), + hCursor: HCURSOR::default(), + hbrBackground: HBRUSH::default(), + lpszMenuName: PCWSTR::null(), + lpszClassName: CLASS_NAME, + hIconSm: HICON::default(), + }; + + unsafe { RegisterClassExW(&class) }; + + let mut rect = RECT::default(); + unsafe { GetClientRect(parent, &mut rect).unwrap() }; + let width = rect.right - rect.left; + let height = rect.bottom - rect.top; + + let data = UndecoratedResizingData { + child: HWND::default(), + has_undecorated_shadows, + }; + + let Ok(drag_window) = (unsafe { + CreateWindowExW( + WINDOW_EX_STYLE::default(), + CLASS_NAME, + WINDOW_NAME, + WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, + 0, + 0, + width, + height, + Some(parent), + None, + GetModuleHandleW(None).ok().map(|h| HINSTANCE(h.0)), + Some(Box::into_raw(Box::new(data)) as _), + ) + }) else { + return; + }; + + unsafe { + set_drag_hwnd_rgn(drag_window, width, height, has_undecorated_shadows); + + let _ = SetWindowPos( + drag_window, + Some(HWND_TOP), + 0, + 0, + 0, + 0, + SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOSIZE, + ); + + let data = UndecoratedResizingData { + child: drag_window, + has_undecorated_shadows, + }; + + let _ = SetWindowSubclass( + parent, + Some(subclass_parent), + (WM_USER + 1) as _, + Box::into_raw(Box::new(data)) as _, + ); + } + } + + unsafe extern "system" fn subclass_parent( + parent: HWND, + msg: u32, + wparam: WPARAM, + lparam: LPARAM, + _: usize, + data: usize, + ) -> LRESULT { + match msg { + WM_SIZE => { + let data = data as *mut UndecoratedResizingData; + let data = &*data; + let child = data.child; + let has_undecorated_shadows = data.has_undecorated_shadows; + + // when parent is maximized, remove the undecorated window drag resize region + if is_maximized(parent).unwrap_or(false) { + let _ = SetWindowPos( + child, + Some(HWND_TOP), + 0, + 0, + 0, + 0, + SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOMOVE, + ); + } else { + // otherwise updat the cutout region + let mut rect = RECT::default(); + if GetClientRect(parent, &mut rect).is_ok() { + let width = rect.right - rect.left; + let height = rect.bottom - rect.top; + + let _ = SetWindowPos( + child, + Some(HWND_TOP), + 0, + 0, + width, + height, + SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOMOVE, + ); + + set_drag_hwnd_rgn(child, width, height, has_undecorated_shadows); + } + } + } + + WM_UPDATE_UNDECORATED_SHADOWS => { + let data = data as *mut UndecoratedResizingData; + let data = &mut *data; + data.has_undecorated_shadows = wparam.0 != 0; + } + + WM_NCDESTROY => { + let data = data as *mut UndecoratedResizingData; + drop(Box::from_raw(data)); + } + + _ => {} + } + + DefSubclassProc(parent, msg, wparam, lparam) + } + + unsafe extern "system" fn drag_resize_window_proc( + child: HWND, + msg: u32, + wparam: WPARAM, + lparam: LPARAM, + ) -> LRESULT { + match msg { + WM_CREATE => { + let data = lparam.0 as *mut CREATESTRUCTW; + let data = (*data).lpCreateParams as *mut UndecoratedResizingData; + (*data).child = child; + SetWindowLongPtrW(child, GWLP_USERDATA, data as _); + } + + WM_NCHITTEST => { + let data = GetWindowLongPtrW(child, GWLP_USERDATA); + let data = &*(data as *mut UndecoratedResizingData); + + let Ok(parent) = GetParent(child) else { + return DefWindowProcW(child, msg, wparam, lparam); + }; + let style = GetWindowLongPtrW(parent, GWL_STYLE); + let style = WINDOW_STYLE(style as u32); + + let is_resizable = (style & WS_SIZEBOX).0 != 0; + if !is_resizable { + return DefWindowProcW(child, msg, wparam, lparam); + } + + // if the window has undecorated shadows, + // it should always be the top border, + // ensured by the cutout drag window + if data.has_undecorated_shadows { + return LRESULT(HTTOP as _); + } + + let mut rect = RECT::default(); + if GetWindowRect(child, &mut rect).is_err() { + return DefWindowProcW(child, msg, wparam, lparam); + } + + let (cx, cy) = (GET_X_LPARAM(lparam) as i32, GET_Y_LPARAM(lparam) as i32); + + let dpi = unsafe { util::hwnd_dpi(child) }; + let border_x = util::get_system_metrics_for_dpi(SM_CXFRAME, dpi); + let border_y = util::get_system_metrics_for_dpi(SM_CYFRAME, dpi); + + let res = hit_test( + rect.left, + rect.top, + rect.right, + rect.bottom, + cx, + cy, + border_x, + border_y, + ); + + return LRESULT(res.to_win32() as _); + } + + WM_NCLBUTTONDOWN => { + let data = GetWindowLongPtrW(child, GWLP_USERDATA); + let data = &*(data as *mut UndecoratedResizingData); + + let Ok(parent) = GetParent(child) else { + return DefWindowProcW(child, msg, wparam, lparam); + }; + let style = GetWindowLongPtrW(parent, GWL_STYLE); + let style = WINDOW_STYLE(style as u32); + + let is_resizable = (style & WS_SIZEBOX).0 != 0; + if !is_resizable { + return DefWindowProcW(child, msg, wparam, lparam); + } + + let (cx, cy) = (GET_X_LPARAM(lparam) as i32, GET_Y_LPARAM(lparam) as i32); + + // if the window has undecorated shadows, + // it should always be the top border, + // ensured by the cutout drag window + let res = if data.has_undecorated_shadows { + HitTestResult::Top + } else { + let mut rect = RECT::default(); + if GetWindowRect(child, &mut rect).is_err() { + return DefWindowProcW(child, msg, wparam, lparam); + } + + let dpi = unsafe { util::hwnd_dpi(child) }; + let border_x = util::get_system_metrics_for_dpi(SM_CXFRAME, dpi); + let border_y = util::get_system_metrics_for_dpi(SM_CYFRAME, dpi); + + hit_test( + rect.left, + rect.top, + rect.right, + rect.bottom, + cx, + cy, + border_x, + border_y, + ) + }; + + if res != HitTestResult::NoWhere { + let points = POINTS { + x: cx as i16, + y: cy as i16, + }; + + let _ = PostMessageW( + Some(parent), + WM_NCLBUTTONDOWN, + WPARAM(res.to_win32() as _), + LPARAM(&points as *const _ as _), + ); + } + + return LRESULT(0); + } + + WM_UPDATE_UNDECORATED_SHADOWS => { + let data = GetWindowLongPtrW(child, GWLP_USERDATA); + let data = &mut *(data as *mut UndecoratedResizingData); + data.has_undecorated_shadows = wparam.0 != 0; + } + + WM_NCDESTROY => { + let data = GetWindowLongPtrW(child, GWLP_USERDATA); + let data = data as *mut UndecoratedResizingData; + drop(Box::from_raw(data)); + } + + _ => {} + } + + DefWindowProcW(child, msg, wparam, lparam) + } + + pub fn detach_resize_handler(hwnd: isize) { + let hwnd = HWND(hwnd as _); + + let Ok(child) = (unsafe { FindWindowExW(Some(hwnd), None, CLASS_NAME, WINDOW_NAME) }) else { + return; + }; + + let _ = unsafe { DestroyWindow(child) }; + } + + unsafe fn set_drag_hwnd_rgn(hwnd: HWND, width: i32, height: i32, only_top: bool) { + // The window used for drag resizing an undecorated window + // is a child HWND that covers the whole window + // and so we need create a cut out in the middle for the parent and other child + // windows like the webview can receive mouse events. + + let dpi = unsafe { util::hwnd_dpi(hwnd) }; + let border_x = util::get_system_metrics_for_dpi(SM_CXFRAME, dpi); + let border_y = util::get_system_metrics_for_dpi(SM_CYFRAME, dpi); + + // hrgn1 must be mutable to call .free() later + let mut hrgn1 = CreateRectRgn(0, 0, width, height); + + let x1 = if only_top { 0 } else { border_x }; + let y1 = border_y; + let x2 = if only_top { width } else { width - border_x }; + let y2 = if only_top { height } else { height - border_y }; + + // Wrap hrgn2 in Owned so it is automatically freed when going out of scope + let hrgn2 = Owned::new(CreateRectRgn(x1, y1, x2, y2)); + + CombineRgn(Some(hrgn1), Some(hrgn1), Some(*hrgn2), RGN_DIFF); + + // Try to set the window region + if SetWindowRgn(hwnd, Some(hrgn1), true) == 0 { + // If it fails, we must free hrgn1 manually + hrgn1.free(); + } + } + + pub fn update_drag_hwnd_rgn_for_undecorated(hwnd: isize, has_undecorated_shadows: bool) { + let hwnd = HWND(hwnd as _); + + let mut rect = RECT::default(); + let Ok(_) = (unsafe { GetClientRect(hwnd, &mut rect) }) else { + return; + }; + + let width = rect.right - rect.left; + let height = rect.bottom - rect.top; + + let Ok(child) = (unsafe { FindWindowExW(Some(hwnd), None, CLASS_NAME, WINDOW_NAME) }) else { + return; + }; + + unsafe { set_drag_hwnd_rgn(child, width, height, has_undecorated_shadows) }; + + unsafe { + SendMessageW( + hwnd, + WM_UPDATE_UNDECORATED_SHADOWS, + None, + Some(LPARAM(has_undecorated_shadows as _)), + ) + }; + unsafe { + SendMessageW( + child, + WM_UPDATE_UNDECORATED_SHADOWS, + None, + Some(LPARAM(has_undecorated_shadows as _)), + ) + }; + } + + fn is_maximized(window: HWND) -> windows::core::Result { + let mut placement = WINDOWPLACEMENT { + length: std::mem::size_of::() as u32, + ..WINDOWPLACEMENT::default() + }; + unsafe { GetWindowPlacement(window, &mut placement)? }; + Ok(placement.showCmd == SW_MAXIMIZE.0 as u32) + } + + /// Implementation of the `GET_X_LPARAM` macro. + #[allow(non_snake_case)] + #[inline] + fn GET_X_LPARAM(lparam: LPARAM) -> i16 { + ((lparam.0 as usize) & 0xFFFF) as u16 as i16 + } + + /// Implementation of the `GET_Y_LPARAM` macro. + #[allow(non_snake_case)] + #[inline] + fn GET_Y_LPARAM(lparam: LPARAM) -> i16 { + (((lparam.0 as usize) & 0xFFFF_0000) >> 16) as u16 as i16 + } +} + +#[cfg(not(windows))] +mod gtk { + use super::{hit_test, HitTestResult}; + + const BORDERLESS_RESIZE_INSET: i32 = 5; + + impl HitTestResult { + fn to_gtk_edge(self) -> gtk::gdk::WindowEdge { + match self { + HitTestResult::Client | HitTestResult::NoWhere => gtk::gdk::WindowEdge::__Unknown(0), + HitTestResult::Left => gtk::gdk::WindowEdge::West, + HitTestResult::Right => gtk::gdk::WindowEdge::East, + HitTestResult::Top => gtk::gdk::WindowEdge::North, + HitTestResult::Bottom => gtk::gdk::WindowEdge::South, + HitTestResult::TopLeft => gtk::gdk::WindowEdge::NorthWest, + HitTestResult::TopRight => gtk::gdk::WindowEdge::NorthEast, + HitTestResult::BottomLeft => gtk::gdk::WindowEdge::SouthWest, + HitTestResult::BottomRight => gtk::gdk::WindowEdge::SouthEast, + } + } + } + + pub fn attach_resize_handler(webview: &wry::WebView) { + use gtk::{ + gdk::{prelude::*, WindowEdge}, + glib::Propagation, + prelude::*, + }; + use wry::WebViewExtUnix; + + let webview = webview.webview(); + + webview.add_events( + gtk::gdk::EventMask::BUTTON1_MOTION_MASK + | gtk::gdk::EventMask::BUTTON_PRESS_MASK + | gtk::gdk::EventMask::TOUCH_MASK, + ); + + webview.connect_button_press_event( + move |webview: &webkit2gtk::WebView, event: >k::gdk::EventButton| { + if event.button() == 1 { + // This one should be GtkBox + if let Some(window) = webview.parent().and_then(|w| w.parent()) { + // Safe to unwrap unless this is not from tao + let window: gtk::Window = window.downcast().unwrap(); + if !window.is_decorated() && window.is_resizable() && !window.is_maximized() { + if let Some(window) = window.window() { + let (root_x, root_y) = event.root(); + let (window_x, window_y) = window.position(); + let (client_x, client_y) = (root_x - window_x as f64, root_y - window_y as f64); + let border = window.scale_factor() * BORDERLESS_RESIZE_INSET; + let edge = hit_test( + 0.0, + 0.0, + window.width() as f64, + window.height() as f64, + client_x, + client_y, + border as _, + border as _, + ) + .to_gtk_edge(); + + // we ignore the `__Unknown` variant so the webview receives the click correctly if it is not on the edges. + match edge { + WindowEdge::__Unknown(_) => (), + _ => { + window.begin_resize_drag(edge, 1, root_x as i32, root_y as i32, event.time()) + } + } + } + } + } + } + + Propagation::Proceed + }, + ); + + webview.connect_touch_event( + move |webview: &webkit2gtk::WebView, event: >k::gdk::Event| { + // This one should be GtkBox + if let Some(window) = webview.parent().and_then(|w| w.parent()) { + // Safe to unwrap unless this is not from tao + let window: gtk::Window = window.downcast().unwrap(); + if !window.is_decorated() && window.is_resizable() && !window.is_maximized() { + if let Some(window) = window.window() { + if let Some((root_x, root_y)) = event.root_coords() { + if let Some(device) = event.device() { + let (window_x, window_y) = window.position(); + let (client_x, client_y) = (root_x - window_x as f64, root_y - window_y as f64); + let border = window.scale_factor() * BORDERLESS_RESIZE_INSET; + let edge = hit_test( + 0.0, + 0.0, + window.width() as f64, + window.height() as f64, + client_x, + client_y, + border as _, + border as _, + ) + .to_gtk_edge(); + + // we ignore the `__Unknown` variant so the window receives the click correctly if it is not on the edges. + match edge { + WindowEdge::__Unknown(_) => (), + _ => window.begin_resize_drag_for_device( + edge, + &device, + 0, + root_x as i32, + root_y as i32, + event.time(), + ), + } + } + } + } + } + } + + Propagation::Proceed + }, + ); + } +} diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/util.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/util.rs new file mode 100644 index 0000000000..8270ec3c38 --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/util.rs @@ -0,0 +1,118 @@ +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +#[cfg_attr(not(windows), allow(unused_imports))] +pub use imp::*; + +#[cfg(not(windows))] +mod imp {} + +#[cfg(windows)] +mod imp { + use std::{iter::once, os::windows::ffi::OsStrExt}; + + use once_cell::sync::Lazy; + use windows::{ + core::{HRESULT, PCSTR, PCWSTR}, + Win32::{ + Foundation::*, + Graphics::Gdi::*, + System::LibraryLoader::{GetProcAddress, LoadLibraryW}, + UI::{HiDpi::*, WindowsAndMessaging::*}, + }, + }; + + pub fn encode_wide(string: impl AsRef) -> Vec { + string.as_ref().encode_wide().chain(once(0)).collect() + } + + // Helper function to dynamically load function pointer. + // `library` and `function` must be zero-terminated. + pub(super) fn get_function_impl(library: &str, function: &str) -> FARPROC { + let library = encode_wide(library); + assert_eq!(function.chars().last(), Some('\0')); + + // Library names we will use are ASCII so we can use the A version to avoid string conversion. + let module = unsafe { LoadLibraryW(PCWSTR::from_raw(library.as_ptr())) }.unwrap_or_default(); + if module.is_invalid() { + return None; + } + + unsafe { GetProcAddress(module, PCSTR::from_raw(function.as_ptr())) } + } + + macro_rules! get_function { + ($lib:expr, $func:ident) => { + $crate::util::get_function_impl($lib, concat!(stringify!($func), '\0')) + .map(|f| unsafe { std::mem::transmute::<_, $func>(f) }) + }; + } + + type GetDpiForWindow = unsafe extern "system" fn(hwnd: HWND) -> u32; + type GetDpiForMonitor = unsafe extern "system" fn( + hmonitor: HMONITOR, + dpi_type: MONITOR_DPI_TYPE, + dpi_x: *mut u32, + dpi_y: *mut u32, + ) -> HRESULT; + type GetSystemMetricsForDpi = + unsafe extern "system" fn(nindex: SYSTEM_METRICS_INDEX, dpi: u32) -> i32; + + static GET_DPI_FOR_WINDOW: Lazy> = + Lazy::new(|| get_function!("user32.dll", GetDpiForWindow)); + static GET_DPI_FOR_MONITOR: Lazy> = + Lazy::new(|| get_function!("shcore.dll", GetDpiForMonitor)); + static GET_SYSTEM_METRICS_FOR_DPI: Lazy> = + Lazy::new(|| get_function!("user32.dll", GetSystemMetricsForDpi)); + + #[allow(non_snake_case)] + pub unsafe fn hwnd_dpi(hwnd: HWND) -> u32 { + let hdc = GetDC(Some(hwnd)); + if hdc.is_invalid() { + return USER_DEFAULT_SCREEN_DPI; + } + if let Some(GetDpiForWindow) = *GET_DPI_FOR_WINDOW { + // We are on Windows 10 Anniversary Update (1607) or later. + match GetDpiForWindow(hwnd) { + 0 => USER_DEFAULT_SCREEN_DPI, // 0 is returned if hwnd is invalid + dpi => dpi, + } + } else if let Some(GetDpiForMonitor) = *GET_DPI_FOR_MONITOR { + // We are on Windows 8.1 or later. + let monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST); + if monitor.is_invalid() { + return USER_DEFAULT_SCREEN_DPI; + } + + let mut dpi_x = 0; + let mut dpi_y = 0; + if GetDpiForMonitor(monitor, MDT_EFFECTIVE_DPI, &mut dpi_x, &mut dpi_y).is_ok() { + dpi_x + } else { + USER_DEFAULT_SCREEN_DPI + } + } else { + // We are on Vista or later. + if IsProcessDPIAware().as_bool() { + // If the process is DPI aware, then scaling must be handled by the application using + // this DPI value. + GetDeviceCaps(Some(hdc), LOGPIXELSX) as u32 + } else { + // If the process is DPI unaware, then scaling is performed by the OS; we thus return + // 96 (scale factor 1.0) to prevent the window from being re-scaled by both the + // application and the WM. + USER_DEFAULT_SCREEN_DPI + } + } + } + + #[allow(non_snake_case)] + pub unsafe fn get_system_metrics_for_dpi(nindex: SYSTEM_METRICS_INDEX, dpi: u32) -> i32 { + if let Some(GetSystemMetricsForDpi) = *GET_SYSTEM_METRICS_FOR_DPI { + GetSystemMetricsForDpi(nindex, dpi) + } else { + GetSystemMetrics(nindex) + } + } +} diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/webview.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/webview.rs new file mode 100644 index 0000000000..67b607392b --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/webview.rs @@ -0,0 +1,47 @@ +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +#[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" +))] +mod imp { + pub type Webview = webkit2gtk::WebView; +} + +#[cfg(target_vendor = "apple")] +mod imp { + use std::ffi::c_void; + + pub struct Webview { + pub webview: *mut c_void, + pub manager: *mut c_void, + #[cfg(target_os = "macos")] + pub ns_window: *mut c_void, + #[cfg(target_os = "ios")] + pub view_controller: *mut c_void, + } +} + +#[cfg(windows)] +mod imp { + use webview2_com::Microsoft::Web::WebView2::Win32::{ + ICoreWebView2Controller, ICoreWebView2Environment, + }; + pub struct Webview { + pub controller: ICoreWebView2Controller, + pub environment: ICoreWebView2Environment, + } +} + +#[cfg(target_os = "android")] +mod imp { + use wry::JniHandle; + pub type Webview = JniHandle; +} + +pub use imp::*; diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/linux.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/linux.rs new file mode 100644 index 0000000000..e7ee9276bd --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/linux.rs @@ -0,0 +1,31 @@ +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use gtk::prelude::*; +#[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" +))] +use tao::platform::unix::WindowExtUnix; + +impl super::WindowExt for tao::window::Window { + fn set_enabled(&self, enabled: bool) { + self.gtk_window().set_sensitive(enabled); + } + + fn is_enabled(&self) -> bool { + self.gtk_window().is_sensitive() + } + + fn center(&self) { + if let Some(monitor) = self.current_monitor() { + let window_size = self.outer_size(); + let new_pos = super::calculate_window_center_position(window_size, monitor); + self.set_outer_position(new_pos); + } + } +} diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/macos.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/macos.rs new file mode 100644 index 0000000000..6bb16ce3e5 --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/macos.rs @@ -0,0 +1,43 @@ +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use objc2::MainThreadMarker; +use objc2_app_kit::{NSBackingStoreType, NSWindow, NSWindowStyleMask}; +use tao::platform::macos::WindowExtMacOS; + +impl super::WindowExt for tao::window::Window { + // based on electron implementation + // https://github.com/electron/electron/blob/15db63e26df3e3d59ce6281f030624f746518511/shell/browser/native_window_mac.mm#L474 + fn set_enabled(&self, enabled: bool) { + let ns_window: &NSWindow = unsafe { &*self.ns_window().cast() }; + if !enabled { + let frame = ns_window.frame(); + let mtm = MainThreadMarker::new() + .expect("`Window::set_enabled` can only be called on the main thread"); + let sheet = unsafe { + NSWindow::initWithContentRect_styleMask_backing_defer( + mtm.alloc(), + frame, + NSWindowStyleMask::Titled, + NSBackingStoreType::Buffered, + false, + ) + }; + unsafe { sheet.setAlphaValue(0.5) }; + unsafe { ns_window.beginSheet_completionHandler(&sheet, None) }; + } else if let Some(attached) = unsafe { ns_window.attachedSheet() } { + unsafe { ns_window.endSheet(&attached) }; + } + } + + fn is_enabled(&self) -> bool { + let ns_window: &NSWindow = unsafe { &*self.ns_window().cast() }; + unsafe { ns_window.attachedSheet() }.is_none() + } + + fn center(&self) { + let ns_window: &NSWindow = unsafe { &*self.ns_window().cast() }; + ns_window.center(); + } +} diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/mod.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/mod.rs new file mode 100644 index 0000000000..b18543e5d0 --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/mod.rs @@ -0,0 +1,72 @@ +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +#[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" +))] +mod linux; +#[cfg(target_os = "macos")] +mod macos; +#[cfg(windows)] +mod windows; + +use crate::monitor::MonitorExt; + +pub trait WindowExt { + /// Enable or disable the window + /// + /// ## Platform-specific: + /// + /// - **Android / iOS**: Unsupported. + fn set_enabled(&self, enabled: bool); + + /// Whether the window is enabled or disabled. + /// + /// ## Platform-specific: + /// + /// - **Android / iOS**: Unsupported, always returns `true`. + fn is_enabled(&self) -> bool; + + /// Center the window + /// + /// ## Platform-specific: + /// + /// - **Android / iOS**: Unsupported. + fn center(&self) {} + + /// Clears the window surface. i.e make it transparent. + #[cfg(windows)] + fn draw_surface( + &self, + surface: &mut softbuffer::Surface< + std::sync::Arc, + std::sync::Arc, + >, + background_color: Option, + ); +} + +#[cfg(mobile)] +impl WindowExt for tao::window::Window { + fn set_enabled(&self, _: bool) {} + fn is_enabled(&self) -> bool { + true + } +} + +pub fn calculate_window_center_position( + window_size: tao::dpi::PhysicalSize, + target_monitor: tao::monitor::MonitorHandle, +) -> tao::dpi::PhysicalPosition { + let work_area = target_monitor.work_area(); + + tao::dpi::PhysicalPosition::new( + (work_area.size.width as i32 - window_size.width as i32) / 2 + work_area.position.x, + (work_area.size.height as i32 - window_size.height as i32) / 2 + work_area.position.y, + ) +} diff --git a/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/windows.rs b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/windows.rs new file mode 100644 index 0000000000..6c032beabd --- /dev/null +++ b/packages/tauri-app/vendor/tauri-runtime-wry-2.10.1/src/window/windows.rs @@ -0,0 +1,68 @@ +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use windows::Win32::{ + Foundation::{HWND, RECT}, + Graphics::Dwm::{DwmGetWindowAttribute, DWMWA_EXTENDED_FRAME_BOUNDS}, + UI::Input::KeyboardAndMouse::{EnableWindow, IsWindowEnabled}, +}; + +use tao::platform::windows::WindowExtWindows; + +impl super::WindowExt for tao::window::Window { + fn set_enabled(&self, enabled: bool) { + let _ = unsafe { EnableWindow(HWND(self.hwnd() as _), enabled) }; + } + + fn is_enabled(&self) -> bool { + unsafe { IsWindowEnabled(HWND(self.hwnd() as _)) }.as_bool() + } + + fn center(&self) { + if let Some(monitor) = self.current_monitor() { + let mut window_size = self.outer_size(); + + if self.is_decorated() { + let mut rect = RECT::default(); + let result = unsafe { + DwmGetWindowAttribute( + HWND(self.hwnd() as _), + DWMWA_EXTENDED_FRAME_BOUNDS, + &mut rect as *mut _ as *mut _, + std::mem::size_of::() as u32, + ) + }; + if result.is_ok() { + window_size.height = (rect.bottom - rect.top) as u32; + } + } + + let new_pos = super::calculate_window_center_position(window_size, monitor); + self.set_outer_position(new_pos); + } + } + + fn draw_surface( + &self, + surface: &mut softbuffer::Surface< + std::sync::Arc, + std::sync::Arc, + >, + background_color: Option, + ) { + let size = self.inner_size(); + if let (Some(width), Some(height)) = ( + std::num::NonZeroU32::new(size.width), + std::num::NonZeroU32::new(size.height), + ) { + surface.resize(width, height).unwrap(); + let mut buffer = surface.buffer_mut().unwrap(); + let color = background_color + .map(|(r, g, b, _)| (b as u32) | ((g as u32) << 8) | ((r as u32) << 16)) + .unwrap_or(0); + buffer.fill(color); + let _ = buffer.present(); + } + } +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/.cargo/config.toml b/packages/tauri-app/vendor/wry-0.54.4/.cargo/config.toml new file mode 100644 index 0000000000..3f6a4c76b1 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/.cargo/config.toml @@ -0,0 +1,4 @@ +# [build] +# target = "aarch64-linux-android" +[target.x86_64-apple-darwin] +rustflags = ["-C", "link-arg=-mmacosx-version-min=10.12"] diff --git a/packages/tauri-app/vendor/wry-0.54.4/.cargo_vcs_info.json b/packages/tauri-app/vendor/wry-0.54.4/.cargo_vcs_info.json new file mode 100644 index 0000000000..3d868021e3 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/.cargo_vcs_info.json @@ -0,0 +1,7 @@ +{ + "git": { + "sha1": "0b1e2befc0e813c28a2b1094170cfd8f185875d2", + "dirty": true + }, + "path_in_vcs": "" +} \ No newline at end of file diff --git a/packages/tauri-app/vendor/wry-0.54.4/.gitignore b/packages/tauri-app/vendor/wry-0.54.4/.gitignore new file mode 100644 index 0000000000..0a01592710 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/.gitignore @@ -0,0 +1,9 @@ +# Copyright 2020-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT + +target +gh-pages +.DS_Store +examples/test_video.mp4 +.vscode/ diff --git a/packages/tauri-app/vendor/wry-0.54.4/.license_template b/packages/tauri-app/vendor/wry-0.54.4/.license_template new file mode 100644 index 0000000000..9601f8a1b4 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/.license_template @@ -0,0 +1,3 @@ +// Copyright {20\d{2}(-20\d{2})?} Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT \ No newline at end of file diff --git a/packages/tauri-app/vendor/wry-0.54.4/CHANGELOG.md b/packages/tauri-app/vendor/wry-0.54.4/CHANGELOG.md new file mode 100644 index 0000000000..e79db118f1 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/CHANGELOG.md @@ -0,0 +1,1257 @@ +# Changelog + +## \[0.54.4] + +- [`47d9470`](https://github.com/tauri-apps/wry/commit/47d9470e40160af8209da094364141917ec677a7) ([#1693](https://github.com/tauri-apps/wry/pull/1693) by [@Legend-Master](https://github.com/tauri-apps/wry/../../Legend-Master)) Updated dependency dom_query to 0.27.0, this fixed a bug where initialization scripts were escaped incorrectly on Android +- [`1540788`](https://github.com/tauri-apps/wry/commit/1540788a0161235e1b89c70912725fd2f18cb813) ([#1692](https://github.com/tauri-apps/wry/pull/1692) by [@Sbenazar](https://github.com/tauri-apps/wry/../../Sbenazar)) fix(webkitgtk): normalize background color values to 0.0–1.0 + +## \[0.54.3] + +- [`40a7032`](https://github.com/tauri-apps/wry/commit/40a703214d3e66942edf6f6a96074580798d5046) ([#1677](https://github.com/tauri-apps/wry/pull/1677) by [@russellmcc](https://github.com/tauri-apps/wry/../../russellmcc)) Fix bug where wry would crash when loaded by multiple dylibs in the same process on macOS. + +### Dependencies + +- [`146e36e`](https://github.com/tauri-apps/wry/commit/146e36e68b5da3c8e4488a67c8661695e76e60eb) ([#1671](https://github.com/tauri-apps/wry/pull/1671) by [@thomaseizinger](https://github.com/tauri-apps/wry/../../thomaseizinger)) Refactors HTML manipulation on Android to use `dom_query` instead of `kuchikiki`. + +### enhance + +- [`e430558`](https://github.com/tauri-apps/wry/commit/e430558f4be90096a1bf786cdb59c49a0754beec) ([#1649](https://github.com/tauri-apps/wry/pull/1649) by [@aoxiangtianyu-go](https://github.com/tauri-apps/wry/../../aoxiangtianyu-go)) Add an option to control browser-level autofill behavior on Windows. + +### bug + +- [`a7de137`](https://github.com/tauri-apps/wry/commit/a7de137ecc321bf3c3a3a10c857b5839741b4b5c) ([#1680](https://github.com/tauri-apps/wry/pull/1680) by [@Legend-Master](https://github.com/tauri-apps/wry/../../Legend-Master)) Fix infinite loop on main thread if creating the webview failed or getting cookie failed + +## \[0.54.2] + +- [`1d1b870`](https://github.com/tauri-apps/wry/commit/1d1b8707665b4638e040dde7a88cd33d77ba2ebc) ([#1662](https://github.com/tauri-apps/wry/pull/1662) by [@JSKitty](https://github.com/tauri-apps/wry/../../JSKitty)) On macOS, implement `background_color` support for WKWebView behind the `transparent` feature. Disables the default white background via the `drawsBackground` KVC key at init and applies `underPageBackgroundColor` on macOS 12+ for both initial creation and runtime `set_background_color` calls. +- [`e3761e5`](https://github.com/tauri-apps/wry/commit/e3761e5e5ab684ae277dfa7df931ed9ff4c5bc38) ([#1668](https://github.com/tauri-apps/wry/pull/1668) by [@zeta-gundam](https://github.com/tauri-apps/wry/../../zeta-gundam)) Fixed an issue that caused "Symbol not found: \_NSHTTPCookieSameSite..." panics on macOS `10.13` & `10.14`. +- [`e3761e5`](https://github.com/tauri-apps/wry/commit/e3761e5e5ab684ae277dfa7df931ed9ff4c5bc38) ([#1668](https://github.com/tauri-apps/wry/pull/1668) by [@zeta-gundam](https://github.com/tauri-apps/wry/../../zeta-gundam)) Fixed an issue that caused "\[\ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key drawsBackground." panics on macOS `10.13` + +## \[0.54.1] + +- [`6704b20`](https://github.com/tauri-apps/wry/commit/6704b207ac985e968be0b5c26b898ca152ae47d9) ([#1655](https://github.com/tauri-apps/wry/pull/1655)) Adds a `PartialEq` derive to `Rect`. + +## \[0.54.0] + +- [`5fdd1a9`](https://github.com/tauri-apps/wry/commit/5fdd1a9840e24ce77ea4a57ce3746c3dbee28c9c) ([#1625](https://github.com/tauri-apps/wry/pull/1625)) Use OnBackPressedCallback instead of the deprecated onKeyDown for back navigation on Android. +- [`51d06d0`](https://github.com/tauri-apps/wry/commit/51d06d0cecdf69652a0ae636b1b875e427534bc3) ([#1646](https://github.com/tauri-apps/wry/pull/1646)) Remove redundant clones in WebView and download handling. No user facing changes. +- [`7b77322`](https://github.com/tauri-apps/wry/commit/7b77322f886c440d035674b8efa586671dc0a3db) ([#1647](https://github.com/tauri-apps/wry/pull/1647)) Fix clippy io_other_error. No user facing changes. +- [`ff8876d`](https://github.com/tauri-apps/wry/commit/ff8876d92b9681b139d6637220cefe3248b7d3fb) ([#1652](https://github.com/tauri-apps/wry/pull/1652)) Improve wkwebview performance. No user-facing changes. +- [`27ba73f`](https://github.com/tauri-apps/wry/commit/27ba73f07720b80a21b6b876f1229cad8871aa33) Add handler for web content process termination. +- [`4fcff14`](https://github.com/tauri-apps/wry/commit/4fcff147b5022af3ee006ed077759b1648b32aa6) ([#1547](https://github.com/tauri-apps/wry/pull/1547)) Set `WebsiteDataManagerBuilder::base_cache_directory` with the same path as `base_data_directory`. + + This change allows the cache directory to be changed instead of using the default one [from WebKitGTK](https://webkitgtk.org/reference/webkit2gtk/stable/property.WebsiteDataManager.base-cache-directory.html). +- [`64d9296`](https://github.com/tauri-apps/wry/commit/64d92960b960a4b2fdf9205b6188f55650ddd62f) ([#1640](https://github.com/tauri-apps/wry/pull/1640)) Update webkit2gtk-rs crates to `2.0.2`. + +## \[0.53.5] + +- [#1622](https://github.com/tauri-apps/wry/pull/1626) Fixed an issue that caused docs.rs builds to fail. No user facing changes. + +## \[0.53.4] + +- [`093856a`](https://github.com/tauri-apps/wry/commit/093856a2a53a6fc1aaa759e048c7e1fe31bb09fa) ([#1622](https://github.com/tauri-apps/wry/pull/1622) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Add flag to opt out of automatic back navigation handling on Android via `WryActivity#handleBackNavigation`. +- [`0f51d67`](https://github.com/tauri-apps/wry/commit/0f51d67485d84fd9c72391379a67567eea3cbbfe) ([#1605](https://github.com/tauri-apps/wry/pull/1605) by [@dgerhardt](https://github.com/tauri-apps/wry/../../dgerhardt)) On Linux, removed a workaround which forced inital requests for multiple webviews to be handled sequentially. + The workaround was intended to fix a concurrency bug with loading multiple URIs at the same time on WebKitGTK. + But it prevented parallelization and could cause a deadlock in certain situations. + It is no longer needed with newer WebKitGTK versions. + +## \[0.53.3] + +- [`6aa5854`](https://github.com/tauri-apps/wry/commit/6aa5854b0371a4828638cd722e18d9b1ab235a8b) ([#1609](https://github.com/tauri-apps/wry/pull/1609) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Enhance error handling of the `webview_version` function on macOS. + +## \[0.53.2] + +- [`1743e7f`](https://github.com/tauri-apps/wry/commit/1743e7f9c1113db1639d544f1f12b8835f91e20b) ([#1608](https://github.com/tauri-apps/wry/pull/1608) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Fix new_window_req_handler craashing when creating new window for webview that has a custom data_store_identifier. + +## \[0.53.1] + +- [`ccdf912`](https://github.com/tauri-apps/wry/commit/ccdf912621f5e12698bdb2cb75af81dd794ab751) ([#1603](https://github.com/tauri-apps/wry/pull/1603) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Fix the build when not enabling the `x11` feature. + +## \[0.53.0] + +- [`1456f8e`](https://github.com/tauri-apps/wry/commit/1456f8e33ad3d05239c2ee71f64e49ef32d48f03) ([#1602](https://github.com/tauri-apps/wry/pull/1602) by [@FabianLars](https://github.com/tauri-apps/wry/../../FabianLars)) Enabled all downloads by default to match WebView2 and browser behavior on all platforms. To disable this, provide a custom `download_started_handler`. +- [`43e78ff`](https://github.com/tauri-apps/wry/commit/43e78ff6b09fe9cac84ff7d73460f170a8c32081) ([#1588](https://github.com/tauri-apps/wry/pull/1588) by [@zphrs](https://github.com/tauri-apps/wry/../../zphrs)) Add `WebViewBuilder::with_limit_navigations_to_app_bound_domains` only on iOS. + Function is a no-op if iOS version is less than iOS 14. +- [`60dba38`](https://github.com/tauri-apps/wry/commit/60dba38ddcc01c428feccea2957adf69128373ef) ([#1569](https://github.com/tauri-apps/wry/pull/1569) by [@WSH032](https://github.com/tauri-apps/wry/../../WSH032)) Add `WebView::set_cookie` and `WebView::delete_cookie` APIs. +- [`88cbb01`](https://github.com/tauri-apps/wry/commit/88cbb019a8d38fbcf7ad015d5f34f9a838a88f98) ([#1561](https://github.com/tauri-apps/wry/pull/1561) by [@dgerhardt](https://github.com/tauri-apps/wry/../../dgerhardt)) On Linux, fix a deadlock, which could occur when destroying a WebView before loading has finished. +- [`eb562ca`](https://github.com/tauri-apps/wry/commit/eb562ca99346fabf2c28d65252d176e2612f3178) ([#1596](https://github.com/tauri-apps/wry/pull/1596) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Do not fire `new_window_req_handler` on navigation events on macOS and iOS. +- [`78634b3`](https://github.com/tauri-apps/wry/commit/78634b3d4dd31651f9e6a3959cbb5f994502a92b) ([#1594](https://github.com/tauri-apps/wry/pull/1594) by [@FabianLars](https://github.com/tauri-apps/wry/../../FabianLars)) On Linux, macOS and iOS, the `download_started_handler` will now get the correct suggested destination path. +- [`5399823`](https://github.com/tauri-apps/wry/commit/5399823a1ecfca4476e7c585c694380c41951766) ([#1600](https://github.com/tauri-apps/wry/pull/1600) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Fixes `new_window_req_handler` not creating the webview on Linux when executing `window.open()`. +- [`eb562ca`](https://github.com/tauri-apps/wry/commit/eb562ca99346fabf2c28d65252d176e2612f3178) ([#1596](https://github.com/tauri-apps/wry/pull/1596) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Fixes `new_window_req_handler` not fired on macOS when executing `window.open()`. +- [`3f978d3`](https://github.com/tauri-apps/wry/commit/3f978d3290aa5cebd6b5feea506557ac0f6e07a7) ([#1601](https://github.com/tauri-apps/wry/pull/1601) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Refactor `WebViewBuilder::with_new_window_req_handler` to allow creating the webview manually. +- [`3f978d3`](https://github.com/tauri-apps/wry/commit/3f978d3290aa5cebd6b5feea506557ac0f6e07a7) ([#1601](https://github.com/tauri-apps/wry/pull/1601) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Disable new window creation by default on Windows to match behavior of other platforms. Use `WebViewBuilder::with_new_window_req_handler` to enable. + +## \[0.52.1] + +- [`63eaab8`](https://github.com/tauri-apps/wry/commit/63eaab80bad7c5f888893c79690c5b626d015eb3) ([#1573](https://github.com/tauri-apps/wry/pull/1573) by [@Legend-Master](https://github.com/tauri-apps/wry/../../Legend-Master)) Fix `wry::DragDropEvent::Drop::paths` returns random data on Windows + +## \[0.52.0] + +- [`5e6b0e6`](https://github.com/tauri-apps/wry/commit/5e6b0e689e38068c817ed1beb87af60b0fcbe0e2) ([#1555](https://github.com/tauri-apps/wry/pull/1555) by [@FabianLars](https://github.com/tauri-apps/wry/../../FabianLars)) Added iOS support for `set_background_color`. +- [`99dab51`](https://github.com/tauri-apps/wry/commit/99dab51fef0dfd49647a8e568f383553bbab6551) ([#1570](https://github.com/tauri-apps/wry/pull/1570) by [@renovate](https://github.com/tauri-apps/wry/../../renovate)) Updated `webview2-com` to `0.38`. +- [`41f4a3a`](https://github.com/tauri-apps/wry/commit/41f4a3a65e0c2ec8e63eedaee9b7fa4d6d3f4fa7) ([#1572](https://github.com/tauri-apps/wry/pull/1572) by [@FabianLars](https://github.com/tauri-apps/wry/../../FabianLars)) On Windows on systems running WebView2 v137+ wry now uses a new default background color API which should reduce white flashes. The use of the `RemoveRedirectionBitmap` browser flag (v134+) was removed due to crashes on Insider builds. +- [`eb40ac8`](https://github.com/tauri-apps/wry/commit/eb40ac8b2ab691bbc0e75bc9c27ba53e2f645e03) ([#1528](https://github.com/tauri-apps/wry/pull/1528) by [@aurelj](https://github.com/tauri-apps/wry/../../aurelj)) Added `x11` feature flag (enabled by default). + +### breaking + +- [`1567635`](https://github.com/tauri-apps/wry/commit/1567635ba5f660827d4ae20f4e226ed7fa595f12) ([#1558](https://github.com/tauri-apps/wry/pull/1558) by [@amrbashir](https://github.com/tauri-apps/wry/../../amrbashir)) Rename `WebViewBuilder` methods for consistency and clarity: + + - Renamed `WebViewBuilder::with_web_context` to `WebViewBuilder::new_with_web_context` + - Renamed `WebViewBuilder::with_attributes` to `WebViewBuilder::new_with_attributes` +- [`f868658`](https://github.com/tauri-apps/wry/commit/f868658d6ffbf0a6b944faebb3b7565726c82f57) ([#1556](https://github.com/tauri-apps/wry/pull/1556) by [@Legend-Master](https://github.com/tauri-apps/wry/../../Legend-Master)) `WebContext::is_custom_protocol_registered` now takes `&str` instead of `String` + +## \[0.51.2] + +- [`f7781a7`](https://github.com/tauri-apps/wry/commit/f7781a788dbb0d07bea27f18daf844d70a3958a3) ([#1544](https://github.com/tauri-apps/wry/pull/1544) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Allow modifying or removing the input accessory view on iOS via `WebViewBuilderExtIos::with_input_accessory_view_builder`. + +## \[0.51.1] + +- [`3e24d6b`](https://github.com/tauri-apps/wry/commit/3e24d6b7b191ce37298ad6be99614ccdf04c7d3f) ([#1543](https://github.com/tauri-apps/wry/pull/1543) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Fix async custom protocol not responding. + +## \[0.51.0] + +- [`f99bbd9`](https://github.com/tauri-apps/wry/commit/f99bbd97c6f46492a2f8b34894532629ce17550d) ([#1507](https://github.com/tauri-apps/wry/pull/1507) by [@Simon-Laux](https://github.com/tauri-apps/wry/../../Simon-Laux)) Renamed `Error::UrlPrase` to `Error::UrlParse` to fix typo. +- [`2d753c6`](https://github.com/tauri-apps/wry/commit/2d753c64822e05ed28621009ef9383ffb70b1b94) ([#1531](https://github.com/tauri-apps/wry/pull/1531) by [@Legend-Master](https://github.com/tauri-apps/wry/../../Legend-Master)) **Breaking Change**: `WebViewAttributes::initialization_scripts` takes `Vec::` now instead of `Vec::<(String, bool)>` +- [`78b83a0`](https://github.com/tauri-apps/wry/commit/78b83a0d8a5db3c58140d7a3f00a52616049251e) ([#1537](https://github.com/tauri-apps/wry/pull/1537) by [@Brendonovich](https://github.com/tauri-apps/wry/../../Brendonovich)) Moved protocol handler functions to a thread local instead of storing them as ivars to prevent a race condition between webview close and custom protocol handling. +- [`5f1e4ba`](https://github.com/tauri-apps/wry/commit/5f1e4bafeee6aab8cdc1d7ebc5d13bb6cfeb94ad) ([#1538](https://github.com/tauri-apps/wry/pull/1538) by [@syrel](https://github.com/tauri-apps/wry/../../syrel)) macOS: Handle flipped coordinates when adding a WebView as a child +- [`4ec951a`](https://github.com/tauri-apps/wry/commit/4ec951a7b5d0484e19f2d94665c79380171ec9ba) ([#1526](https://github.com/tauri-apps/wry/pull/1526) by [@Legend-Master](https://github.com/tauri-apps/wry/../../Legend-Master)) Updated `webview2-com` to `0.37`, `windows` to `0.61`. +- [`2d753c6`](https://github.com/tauri-apps/wry/commit/2d753c64822e05ed28621009ef9383ffb70b1b94) ([#1531](https://github.com/tauri-apps/wry/pull/1531) by [@Legend-Master](https://github.com/tauri-apps/wry/../../Legend-Master)) Init scripts are always executed on all frames on Windows WebView2 +- [`2d753c6`](https://github.com/tauri-apps/wry/commit/2d753c64822e05ed28621009ef9383ffb70b1b94) ([#1531](https://github.com/tauri-apps/wry/pull/1531) by [@Legend-Master](https://github.com/tauri-apps/wry/../../Legend-Master)) Fix init script sometimes get executed too late on Windows WebView2 + +### feat + +- [`ecbced2`](https://github.com/tauri-apps/wry/commit/ecbced25e5e41c6a9f7816ea6517763d30c5b060) ([#1534](https://github.com/tauri-apps/wry/pull/1534) by [@Simon-Laux](https://github.com/tauri-apps/wry/../../Simon-Laux)) macOS/iOS: add option to disable link previews when building a webview (the webkit API has it enabled by default) + + - `WebViewBuilderExtDarwin.with_allow_link_preview(bool)` + +## \[0.50.5] + +### enhance + +- [`353bd95`](https://github.com/tauri-apps/wry/commit/353bd9573a1ff80aa1e547e82f8c32ab2f984f9f) ([#1517](https://github.com/tauri-apps/wry/pull/1517) by [@FabianLars](https://github.com/tauri-apps/wry/../../FabianLars)) Added a Windows-only setting to disable all Webview2 context menus. + +### bug + +- [`4f4ade3`](https://github.com/tauri-apps/wry/commit/4f4ade3c9564bb33b6e54488c228a4c5b054204f) ([#1520](https://github.com/tauri-apps/wry/pull/1520) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Fix crash setting macOS traffic light buttons inset when window is undecorated or buttons have been removed. + +## \[0.50.4] + +- [`349dfe3`](https://github.com/tauri-apps/wry/commit/349dfe37d25f71ed60143f7ec36153bedc296cfa) ([#1512](https://github.com/tauri-apps/wry/pull/1512) by [@Simon-Laux](https://github.com/tauri-apps/wry/../../Simon-Laux)) Added `WebViewExtDarwin` to expose WebView functions available to both macOS and iOS. +- [`349dfe3`](https://github.com/tauri-apps/wry/commit/349dfe37d25f71ed60143f7ec36153bedc296cfa) ([#1512](https://github.com/tauri-apps/wry/pull/1512) by [@Simon-Laux](https://github.com/tauri-apps/wry/../../Simon-Laux)) fix: crash when using `WebViewBuilderExtDarwin.with_data_store_identifier` +- [`349dfe3`](https://github.com/tauri-apps/wry/commit/349dfe37d25f71ed60143f7ec36153bedc296cfa) ([#1512](https://github.com/tauri-apps/wry/pull/1512) by [@Simon-Laux](https://github.com/tauri-apps/wry/../../Simon-Laux)) feat: macOS: add `WebViewExtDarwin::fetch_data_store_identifiers` and `WebViewExtDarwin::remove_data_store`. +- [`d0b16a7`](https://github.com/tauri-apps/wry/commit/d0b16a7b89dfed084405bd7058020da1a4b6708a) ([#1491](https://github.com/tauri-apps/wry/pull/1491) by [@neilmcguire](https://github.com/tauri-apps/wry/../../neilmcguire)) On Windows, Add support for iframe requests in custom protocols. Requires WebView2 1.0.2365.46 or higher. +- [`148d7cd`](https://github.com/tauri-apps/wry/commit/148d7cdd23de91aba541f935aa23d2faf5558199) ([#1513](https://github.com/tauri-apps/wry/pull/1513) by [@FabianLars](https://github.com/tauri-apps/wry/../../FabianLars)) Wry by default now passes `--enable-features=RemoveRedirectionBitmap` to WebView2 to hide the initial white flash of newly created webviews. Only takes effect on WebView2 Runtime versions 134 and above. + +## \[0.50.3] + +- [`94ecadb`](https://github.com/tauri-apps/wry/commit/94ecadbc73d6357484a4df7358c96e72111ce4be) ([#1496](https://github.com/tauri-apps/wry/pull/1496) by [@Simon-Laux](https://github.com/tauri-apps/wry/../../Simon-Laux)) Add `WebViewBuilder.with_javascript_disabled` api to disable JavaScript. +- [`5120a5c`](https://github.com/tauri-apps/wry/commit/5120a5cc0fd4b9d1df32812d3df121c632821395) ([#1486](https://github.com/tauri-apps/wry/pull/1486) by [@charrondev](https://github.com/tauri-apps/wry/../../charrondev)) Fix `Webview::cookies` and `Webview::cookies_for_url` deadlock on macOS. +- [`8dfeb76`](https://github.com/tauri-apps/wry/commit/8dfeb7650213fc10edbf7b03acc9a95107c7e342) ([#1500](https://github.com/tauri-apps/wry/pull/1500) by [@Simon-Laux](https://github.com/tauri-apps/wry/../../Simon-Laux)) feat: add `Webview.reload` + +## \[0.50.2] + +- [`cef818f`](https://github.com/tauri-apps/wry/commit/cef818f63f36b9acfc4d31f17b5e9fe7c3058612) ([#1505](https://github.com/tauri-apps/wry/pull/1505) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Fix `already mutably borrowed: BorrowError` panic on webview initialization on Android. + +## \[0.50.1] + +- [`f9abf6b`](https://github.com/tauri-apps/wry/commit/f9abf6b4464acc91926236366a347f04d741b15d) ([#1501](https://github.com/tauri-apps/wry/pull/1501) by [@Legend-Master](https://github.com/tauri-apps/wry/../../Legend-Master)) Fix webview not resized with parent when it gets maximized on Windows + +## \[0.50.0] + +- [`933de78`](https://github.com/tauri-apps/wry/commit/933de788bc0fbab1914b7c5ce29c209281996b03) ([#1492](https://github.com/tauri-apps/wry/pull/1492) by [@Legend-Master](https://github.com/tauri-apps/wry/../../Legend-Master)) Updated `webview2-com` to `0.36`, `windows` to `0.60`. + +## \[0.49.0] + +- [`0395df5`](https://github.com/tauri-apps/wry/commit/0395df504ffaea2320d706501c89859a6e319d30) ([#1484](https://github.com/tauri-apps/wry/pull/1484) by [@alexmoon](https://github.com/tauri-apps/wry/../../alexmoon)) Removed `obj-exception` feature. +- [`c27b4ff`](https://github.com/tauri-apps/wry/commit/c27b4ffc05b6bc9bb3748a1203116342cfec680d) ([#1468](https://github.com/tauri-apps/wry/pull/1468) by [@madsmtm](https://github.com/tauri-apps/wry/../../madsmtm)) Update to `objc2` v0.6. + + This bumps MSRV on macOS/iOS to 1.71. +- [`95a9319`](https://github.com/tauri-apps/wry/commit/95a9319f24cb62add69d468ec0f60530b608fe6b) ([#1454](https://github.com/tauri-apps/wry/pull/1454) by [@Legend-Master](https://github.com/tauri-apps/wry/../../Legend-Master)) Updated `webview2-com` to `0.35`, `windows` to `0.59`. +- [`9df094a`](https://github.com/tauri-apps/wry/commit/9df094aa79210c6743b5d295069931afaee596db) ([#1483](https://github.com/tauri-apps/wry/pull/1483) by [@amrbashir](https://github.com/tauri-apps/wry/../../amrbashir)) On Windows, fix webview slightly larger than the host window causing a pixel or two to be obscured. +- [`ce98c34`](https://github.com/tauri-apps/wry/commit/ce98c3401d6bc3079900ced9007f212f4f30099c) ([#1480](https://github.com/tauri-apps/wry/pull/1480) by [@ahqsoftwares](https://github.com/tauri-apps/wry/../../ahqsoftwares)) Fixed an issue that could cause `Return type mismatch: expected 'kotlin.String', actual 'kotlin.String?'` errors. + +### enhance + +- [`0185644`](https://github.com/tauri-apps/wry/commit/0185644040184c43084814cb8692acb4e1004d86) ([#1452](https://github.com/tauri-apps/wry/pull/1452) by [@mzdk100](https://github.com/tauri-apps/wry/../../mzdk100)) Allow the use of TAB to cycle through focus elements in an HTML document. + +## \[0.48.1] + +- [`cbbcccc`](https://github.com/tauri-apps/wry/commit/cbbcccc38af7d900a0f8f7fa5ea5e6667765ed81) ([#1446](https://github.com/tauri-apps/wry/pull/1446) by [@FabianLars](https://github.com/tauri-apps/wry/../../FabianLars)) Add functionality to set the traffic light inset on macOS. This is required to prevent flickers if the WebView is injected via `build()` instead of `build_as_child()`. + +### enhance + +- [`26abf63`](https://github.com/tauri-apps/wry/commit/26abf63d79c4a0fcff8ea39d0ff677686f5b546c) ([#1445](https://github.com/tauri-apps/wry/pull/1445) by [@bastiankistner](https://github.com/tauri-apps/wry/../../bastiankistner)) Add an option to change the default background throttling policy (currently for WebKit only). + +## \[0.48.0] + +- [`eb0c816`](https://github.com/tauri-apps/wry/commit/eb0c8163f1e2a11115ef1928b5e4bf0a8f083f3b) ([#1423](https://github.com/tauri-apps/wry/pull/1423) by [@SpikeHD](https://github.com/tauri-apps/wry/../../SpikeHD)) Rename `{WebViewBuilderExtWindows, WebViewBuilderExtUnix}::with_extension_path` to `with_extensions_path`. +- [`b4ba5b4`](https://github.com/tauri-apps/wry/commit/b4ba5b47f235df503085150671ff16189d3d9ea9) ([#1426](https://github.com/tauri-apps/wry/pull/1426) by [@FabianLars](https://github.com/tauri-apps/wry/../../FabianLars)) On Windows, Wry will now log PostMessage errors instead of panicking. +- [`f0c6b94`](https://github.com/tauri-apps/wry/commit/f0c6b947dddc8f1b208157a664a6cc940f123b3c) ([#1441](https://github.com/tauri-apps/wry/pull/1441) by [@renovate](https://github.com/tauri-apps/wry/../../renovate)) Updated `webview2-com` to `0.34`. + +## \[0.47.2] + +- [`7bb4f49`](https://github.com/tauri-apps/wry/commit/7bb4f4929eddbde8f36472a55ec3713d6d51c0e3) ([#1421](https://github.com/tauri-apps/wry/pull/1421) by [@SpikeHD](https://github.com/tauri-apps/wry/../../SpikeHD)) Fix extension loading on Windows. + +## \[0.47.1] + +- [`59c1eef`](https://github.com/tauri-apps/wry/commit/59c1eef0805ecbb1f70a7c78578ff4e03b09a204) ([#1418](https://github.com/tauri-apps/wry/pull/1418) by [@amrbashir](https://github.com/tauri-apps/wry/../../amrbashir)) Fix initialization scripts running twice on Windows. + +## \[0.47.0] + +- [`7221256`](https://github.com/tauri-apps/wry/commit/72212568cb4d815463fc035969f9cac60fe28ba6) ([#1365](https://github.com/tauri-apps/wry/pull/1365) by [@Norbiros](https://github.com/tauri-apps/wry/../../Norbiros)) Add `WebViewBuilder::with_initialization_script_for_main_only` to enable injecting JavaScript code into main frame only or all subframes. +- [`c1b26b9`](https://github.com/tauri-apps/wry/commit/c1b26b9612bf5c5a9e4e0185f73739a2444343cd) ([#1394](https://github.com/tauri-apps/wry/pull/1394) by [@amrbashir](https://github.com/tauri-apps/wry/../../amrbashir)) Add `WebView::cookies` and `WebView::cookies_for_url` APIs. +- [`c193e2a`](https://github.com/tauri-apps/wry/commit/c193e2a04c369b7699cd0d73049e84b6851b5c06) ([#1408](https://github.com/tauri-apps/wry/pull/1408) by [@amrbashir](https://github.com/tauri-apps/wry/../../amrbashir)) Fix `DragDropEvent::Drop` event never fired on Wayland (and sometimes on X11). +- [`1d63fa3`](https://github.com/tauri-apps/wry/commit/1d63fa325327a02a0a8be9ee50ce1eb7a0e8e04f) ([#1403](https://github.com/tauri-apps/wry/pull/1403) by [@SpikeHD](https://github.com/tauri-apps/wry/../../SpikeHD)) Add `WebViewBuilder::with_extension_path` API to Windows and Linux. +- [`0c192f4`](https://github.com/tauri-apps/wry/commit/0c192f4fda1d9c0020bd3ad09a9090bca25ef04f) ([#1414](https://github.com/tauri-apps/wry/pull/1414) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Fix Android static handlers not being replaced when the application UI is relaunched while still running in the foreground. +- [`9a2a2d4`](https://github.com/tauri-apps/wry/commit/9a2a2d42b635a1e27bd6a8f67f7f7b1c59acc7db) ([#1412](https://github.com/tauri-apps/wry/pull/1412) by [@amrbashir](https://github.com/tauri-apps/wry/../../amrbashir)) Fix icons of dragged items getting stuck when using `WebViewBuilder::with_drag_drop_handler` on some distros like Gnome. +- [`fa9875b`](https://github.com/tauri-apps/wry/commit/fa9875bb16dd967520c41e50c562a5aabccc2cbc) ([#1409](https://github.com/tauri-apps/wry/pull/1409) by [@amrbashir](https://github.com/tauri-apps/wry/../../amrbashir)) On Windows, disable Webview2's file drop when using `WebViewBuilder::with_drag_drop_handler` which fix drag events for files from "Recent files" view. +- [`6007608`](https://github.com/tauri-apps/wry/commit/600760827735696e4099eff1ad500baa69d84d2f) ([#1400](https://github.com/tauri-apps/wry/pull/1400) by [@amrbashir](https://github.com/tauri-apps/wry/../../amrbashir)) On Windows, fix webview slightly larger than the window inner size, which resulted in a hidden 1px in the right and bottom borders of the webview + +## \[0.46.3] + +- [`be122f6`](https://github.com/tauri-apps/wry/commit/be122f667f9f5516b4bc25f9e8c61cb99dbe1440) ([#1397](https://github.com/tauri-apps/wry/pull/1397) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Fix `with_user_agent` regression. + +## \[0.46.2] + +- [`1189e2a`](https://github.com/tauri-apps/wry/commit/1189e2a2d5ee18ad83281eea92b05a93f9184ebf) ([#1392](https://github.com/tauri-apps/wry/pull/1392) by [@chrox](https://github.com/tauri-apps/wry/../../chrox)) Fix malformed headers in custom protocol response on macOS. + +## \[0.46.1] + +### bug + +- [`33c0193`](https://github.com/tauri-apps/wry/commit/33c01931a08b2178bb37b03b762d82f20f10aa3b) ([#1389](https://github.com/tauri-apps/wry/pull/1389) by [@amrbashir](https://github.com/tauri-apps/wry/../../amrbashir)) Fix crash on macOS versions below 14. +- [`a57719e`](https://github.com/tauri-apps/wry/commit/a57719e6d63c8dbb002905e54c19d9d2f82c12de) ([#1385](https://github.com/tauri-apps/wry/pull/1385) by [@huacnlee](https://github.com/tauri-apps/wry/../../huacnlee)) Add `WebView::focus_parent` method. + +## \[0.46.0] + +- [`8cc2a7f`](https://github.com/tauri-apps/wry/commit/8cc2a7f6570085da5d6a5ea57ad7f127520b778f) ([#1384](https://github.com/tauri-apps/wry/pull/1384) by [@amrbashir](https://github.com/tauri-apps/wry/../../amrbashir)) This release contains quite the breaking changes, because even though wry@0.44, ignored duplicate custom protocols, On Linux when using a shared web context, the custom protocol handler can only be registered once so we are bringing the duplicate custom protocols on Linux again, Windows and macOS are not affected. If using a shared web context, make sure to register a protocol only once on Linux (other platforms should be registed multiple times), use `WebContext::is_custom_protocol_registered` with `#[cfg(target_os = "linux")]`. + + We also noticed that it is hard to know which webview made a request to the custom protocol so we added a method to attach an ID to a webview, and changed relevant custom protocol APIs to take a new argument that passes the specified id back to protocol handler. + + We also made a few changes to the builder, specifically `WebViewBuilder::new` and `WebViewBuilder::build` methods to make them more ergonomic to work with. + + - Added `Error::DuplicateCustomProtocol` enum variant. + - Added `Error::ContextDuplicateCustomProtocol` enum variant. + - On Linux, return an error in `WebViewBuilder::build` if registering a custom protocol multiple times. + - Added `WebContext::is_custom_protocol_registered` to check if a protocol has been regsterd for this web context. + - Added `WebViewId` alias type. + - **Breaking** Changed `WebViewAttributes` to have a lifetime parameter. + - Added `WebViewAttributes.id` field to specify an id for the webview. + - Added `WebViewBuilder::with_id` method to specify an id for the webview. + - Added `WebViewAttributes.context` field to specify a shared context for the webview. + - **Breaking** Changed `WebViewAttributes.custom_protocols` field,`WebViewBuilder::with_custom_protocol` method and `WebViewBuilder::with_asynchronous_custom_protocol` method handler function to take `WebViewId` as the first argument to check which webview made the request to the protocol. + - **Breaking** Changed `WebViewBuilder::with_web_context` to be a static method to create a builder with a webcontext, instead of it being a setter method. It is now an alternative to `WebviewBuilder::new` + - Added `WebViewBuilder::with_attributes` to create a webview builder with provided attributes. + - **Breaking** Changed `WebViewBuilder::new` to take no arguments. + - **Breaking** Changed `WebViewBuilder::build` method to take a reference to a window to create the webview in it. + - **Breaking** Removed `WebViewBuilder::new_as_child`. + - Added `WebViewBuilder::build_as_child` method, which takes a reference to a window to create the webview in it. + - **Breaking** Removed `WebViewBuilderExtUnix::new_gtk`. + - Added `WebViewBuilderExtUnix::build_gtk`. +- [`0abc221`](https://github.com/tauri-apps/wry/commit/0abc221ca0edf3482518a68af024f9988b10f50b) ([#1316](https://github.com/tauri-apps/wry/pull/1316) by [@pewsheen](https://github.com/tauri-apps/wry/../../pewsheen)) Migrate to obj2. +- [`b01eac3`](https://github.com/tauri-apps/wry/commit/b01eac35f521e4e763fc15753e2fbee68aa31a02) ([#1386](https://github.com/tauri-apps/wry/pull/1386) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Use unescaped Android package identifier for the proguard rules. + +## \[0.45.0] + +- [`0fd1229`](https://github.com/tauri-apps/wry/commit/0fd12297997f598e4893e8f5b6e235b09cedec09) ([#1369](https://github.com/tauri-apps/wry/pull/1369) by [@lloydzhou](https://github.com/tauri-apps/wry/../../lloydzhou)) On Linux, fixed incorrect path for indexeddb database directory which made apps using `wry@0.24` and `tauri@1` migrating to `wry@>=0.38` and `tauri@2` lose their indexeddb data. +- [`e332eff`](https://github.com/tauri-apps/wry/commit/e332eff6ac41ff0f4ed6cf5196c3a78c776912d3) ([#1368](https://github.com/tauri-apps/wry/pull/1368) by [@zephraph](https://github.com/tauri-apps/wry/../../zephraph)) Add `Webview::load_html`. + +## \[0.44.1] + +- [`5111eb0`](https://github.com/tauri-apps/wry/commit/5111eb013e1b049d12aad38b96b2017a4fc54c72) ([#1362](https://github.com/tauri-apps/wry/pull/1362) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Fixes `WebView::clear_all_browsing_data` crashing with a segfault on macOS. + +## \[0.44.0] + +- [`b863d38`](https://github.com/tauri-apps/wry/commit/b863d38ff705e037b297c1651e17775d3dbe473c) ([#1356](https://github.com/tauri-apps/wry/pull/1356) by [@SpikeHD](https://github.com/tauri-apps/wry/../../SpikeHD)) Expose ability to enable browser extensions in WebView2 +- [`9220793`](https://github.com/tauri-apps/wry/commit/92207933c9de4a0c1ef65ecbacb0c303619ced4c) ([#1361](https://github.com/tauri-apps/wry/pull/1361) by [@amrbashir](https://github.com/tauri-apps/wry/../../amrbashir)) Ignore duplicate custom protocols in `WebviewBuilder::with_custom_protocol` and `WebviewBuilder::with_async_custom_protocol` and use the last registered one. +- [`9220793`](https://github.com/tauri-apps/wry/commit/92207933c9de4a0c1ef65ecbacb0c303619ced4c) ([#1361](https://github.com/tauri-apps/wry/pull/1361) by [@amrbashir](https://github.com/tauri-apps/wry/../../amrbashir)) Removed `Error::DuplicateCustomProtocol` variant. +- [`5915341`](https://github.com/tauri-apps/wry/commit/59153413d87549964b885ad3ed84473acf4b70df) ([#1354](https://github.com/tauri-apps/wry/pull/1354) by [@millermk](https://github.com/tauri-apps/wry/../../millermk)) Fixes Android webview error page flashing when a redirect to the app is performed. +- [`170095b`](https://github.com/tauri-apps/wry/commit/170095b9a5829ac9279cfeea3fac0da2c922d448) ([#1360](https://github.com/tauri-apps/wry/pull/1360) by [@Steve-xmh](https://github.com/tauri-apps/wry/../../Steve-xmh)) Fix web resource loading in android binding by skip duplicate Content-Type/Content-Length headers. +- [`5915341`](https://github.com/tauri-apps/wry/commit/59153413d87549964b885ad3ed84473acf4b70df) ([#1354](https://github.com/tauri-apps/wry/pull/1354) by [@millermk](https://github.com/tauri-apps/wry/../../millermk)) Fix navigation error handling to trigger custom protocol on Android. + +## \[0.43.1] + +- [`5cea504`](https://github.com/tauri-apps/wry/commit/5cea5045c9e646ace1f94767d91b746c2afd3c14) ([#1352](https://github.com/tauri-apps/wry/pull/1352) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Fixes Android file picker result processing. + +## \[0.43.0] + +- [`7b1c26a`](https://github.com/tauri-apps/wry/commit/7b1c26adff5fdf13a3364b6fc26c8444c120d5c1) ([#1344](https://github.com/tauri-apps/wry/pull/1344) by [@Themayu](https://github.com/tauri-apps/wry/../../Themayu)) Windows: Implement `WebViewBuilderExtWindows::with_scroll_bar_style` to allow opting into Fluent Overlay style scrollbars. +- [`98d1a83`](https://github.com/tauri-apps/wry/commit/98d1a835e2c818e9f733a55b074e7de3c0cd725f) ([#1326](https://github.com/tauri-apps/wry/pull/1326) by [@ollpu](https://github.com/tauri-apps/wry/../../ollpu)) Fix Linux IPC handler and initialization scripts when sharing a WebContext between multiple WebViews. + +## \[0.42.0] + +- [`556a359`](https://github.com/tauri-apps/wry/commit/556a359d3739ac3a3e671ab2d1c3dda2784c511e) ([#1301](https://github.com/tauri-apps/wry/pull/1301) by [@pewsheen](https://github.com/tauri-apps/wry/../../pewsheen)) On macOS, emit an error when the URL scheme registration fails. +- [`19d83d7`](https://github.com/tauri-apps/wry/commit/19d83d7d01ef9704197c09e6197a6da31a4eec6c) ([#1332](https://github.com/tauri-apps/wry/pull/1332) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Fixes a crash on the Android custom protocol handler when the request URL is invalid. +- [`38abcb9`](https://github.com/tauri-apps/wry/commit/38abcb95090a3917ad5092f4933acb95c721f893) ([#1340](https://github.com/tauri-apps/wry/pull/1340) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Fixes custom protocols not triggered on Android on external redirects. +- [`d1f1e7e`](https://github.com/tauri-apps/wry/commit/d1f1e7e6fa82722d9848fbb540e6f9a3d5925cdd) ([#1299](https://github.com/tauri-apps/wry/pull/1299) by [@kanatapple](https://github.com/tauri-apps/wry/../../kanatapple)) Fix `Webview::bounds` returning logical values where it should have been physical. +- [`03cdf93`](https://github.com/tauri-apps/wry/commit/03cdf93f1e39469a1cd73565ba61138c58567fb6) ([#1311](https://github.com/tauri-apps/wry/pull/1311) by [@bukowa](https://github.com/tauri-apps/wry/../../bukowa)) Handle `webkit2gtk` close signal (when `window.close` is called from js) +- [`68413e8`](https://github.com/tauri-apps/wry/commit/68413e837f81a88e8de0df39d12ba2b405b89e5e) ([#1296](https://github.com/tauri-apps/wry/pull/1296) by [@MarijnS95](https://github.com/tauri-apps/wry/../../MarijnS95)) **Breaking change**: Upgrade `ndk` crate to `0.9` and delete unused `ndk-sys` and `ndk-context` dependencies. Types from the `ndk` crate are used in public API surface. + **Breaking change**: The public `android_setup()` function now takes `&ThreadLooper` instead of `&ForeignLooper`, signifying that the setup function must be called on the thread where the looper is attached (and the `JNIEnv` argument is already thread-local as well). +- [`39fc82c`](https://github.com/tauri-apps/wry/commit/39fc82c9276bd039a9130919645db149f067719a) ([#1306](https://github.com/tauri-apps/wry/pull/1306) by [@Legend-Master](https://github.com/tauri-apps/wry/../../Legend-Master)) Support WebView2 version older than 101.0.1210.39 and document `incognito` and `theme` will not work for versions before it +- [`5231a37`](https://github.com/tauri-apps/wry/commit/5231a379d09c9eea27f490b3062129dd474cb44c) ([#1322](https://github.com/tauri-apps/wry/pull/1322) by [@Legend-Master](https://github.com/tauri-apps/wry/../../Legend-Master)) Support WebView2 version older than 86.0.616.0 and document version requirements for `back_forward_navigation_gestures`, `with_user_agent`, `with_hotkeys_zoom`, `with_browser_accelerator_keys` +- [`a23a28d`](https://github.com/tauri-apps/wry/commit/a23a28d32a01a0a4c8e62e83d34813ec7db4a004) ([#1341](https://github.com/tauri-apps/wry/pull/1341) by [@amrbashir](https://github.com/tauri-apps/wry/../../amrbashir)) Updated `windows` to 0.58. + +## \[0.41.0] + +- [`8b691df`](https://github.com/tauri-apps/wry/commit/8b691df1ac57eb5eb15082c5f6d72e871965c61e) ([#1285](https://github.com/tauri-apps/wry/pull/1285) by [@pewsheen](https://github.com/tauri-apps/wry/../../pewsheen)) On macOS, fix an issue that could cause a panic when running an async command. +- [`6c7f45e`](https://github.com/tauri-apps/wry/commit/6c7f45e1e3f89805a9fd6b58a9382a6bbc2b0c28) ([#1287](https://github.com/tauri-apps/wry/pull/1287) by [@FabianLars](https://github.com/tauri-apps/wry/../../FabianLars)) Fixed a regression causing autoplay on windows to require user gestures. +- [`24a7d27`](https://github.com/tauri-apps/wry/commit/24a7d275c9059dd9e54544b75a5996c9d0762f26) ([#1289](https://github.com/tauri-apps/wry/pull/1289) by [@renovate](https://github.com/tauri-apps/wry/../../renovate)) Update `windows` crate to `0.57` and `webview2-com` crate to `0.31` + +## \[0.40.1] + +- [`b6863ed`](https://github.com/tauri-apps/wry/commit/b6863ed1884fb190ae46f37ed72dcdd92de700cd)([#1275](https://github.com/tauri-apps/wry/pull/1275)) On Android, set `RustWebViewClient.currentUrl` field early in `onPageStarted` method instead of `onPageFinished` +- [`f089964`](https://github.com/tauri-apps/wry/commit/f089964a3cf3014987aca24a7e7d6cae83e67d8a)([#1276](https://github.com/tauri-apps/wry/pull/1276)) Fixes `with_asynchronous_custom_protocol` crashing when sending the response on Linux. +- [`637289d`](https://github.com/tauri-apps/wry/commit/637289dfb36150635177eb629a12b40fdaac1afe)([#1272](https://github.com/tauri-apps/wry/pull/1272)) On Android, make `WryActivity.setWebview` method public to prevent JNI crashes. + +## \[0.40.0] + +- [`a424a0b`](https://github.com/tauri-apps/wry/commit/a424a0b234cb20b3ca7305d87e82aba3c8b2bd41)([#1270](https://github.com/tauri-apps/wry/pull/1270)) On Windows, fix child webview invisible after creation because it was created with `0,0` size +- [`d6f8dd7`](https://github.com/tauri-apps/wry/commit/d6f8dd7b6c0485fbb96fed34717969540eef2b96)([#1271](https://github.com/tauri-apps/wry/pull/1271)) On Windows, create child webview at the top of z-order to align with other platforms. +- [`03d2535`](https://github.com/tauri-apps/wry/commit/03d25357d2c20a21640871cfca9d5f6a39c7afc8)([#1269](https://github.com/tauri-apps/wry/pull/1269)) On macOS, disable initialization script injection into subframes. +- [`1e65049`](https://github.com/tauri-apps/wry/commit/1e65049d4842947ced6a807b93211542c46ca771)([#1267](https://github.com/tauri-apps/wry/pull/1267)) On macOS, fixed a crash when sending empty body by IPC. +- [`0f3c886`](https://github.com/tauri-apps/wry/commit/0f3c886a224a1b52980ef90667860e58a6ad669a)([#1260](https://github.com/tauri-apps/wry/pull/1260)) On macOS, fixed an issue of not being able to listen to the cmd+key event in javascript in single WebView. +- [`0f14e2a`](https://github.com/tauri-apps/wry/commit/0f14e2a540a1d54f82bdee2a3c2f93c43c593959)([#1259](https://github.com/tauri-apps/wry/pull/1259)) Default the margin when printing on MacOS to 0 so it is closer to the behavior of when printing on the web. +- [`0f14e2a`](https://github.com/tauri-apps/wry/commit/0f14e2a540a1d54f82bdee2a3c2f93c43c593959)([#1259](https://github.com/tauri-apps/wry/pull/1259)) Add `WebViewExtMacOS::print_with_options` which allows to modify the margins that will be used on the print dialog. +- [`f516122`](https://github.com/tauri-apps/wry/commit/f5161225940c545dd457af1178c73f36dfe63710)([#1262](https://github.com/tauri-apps/wry/pull/1262)) On Windows, enable webview2 [non client region support](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2settings9?view=webview2-1.0.2478.35#get_isnonclientregionsupportenabled) which allows using `app-region` CSS style. + +## \[0.39.5] + +- [`4c88c66`](https://github.com/tauri-apps/wry/commit/4c88c66fb79fc3742f4592252c260e7e012d5fcf)([#1247](https://github.com/tauri-apps/wry/pull/1247)) Force the IPC and custom protocol tracing spans to have no parent. +- [`2d43d62`](https://github.com/tauri-apps/wry/commit/2d43d62a8e61514ade27ae63fa33c1dee2de6744)([#1254](https://github.com/tauri-apps/wry/pull/1254)) On Windows, fix webview having a bigger size than the actual window size after creation and until the window is resized. + +## \[0.39.4] + +- [`8bbc2bf`](https://github.com/tauri-apps/wry/commit/8bbc2bf388113af2e7d91250abe1569070b351a9)([#1237](https://github.com/tauri-apps/wry/pull/1237)) Fix `WebviewBuilder::with_transparent`, `WebviewBuilder::with_background_color`, and `Webview::set_background_color` always failing and causing the webview to fail to load. +- [`130c469`](https://github.com/tauri-apps/wry/commit/130c46965d0cd0ae2389d2fa9b683488a16e0cc8)([#1238](https://github.com/tauri-apps/wry/pull/1238)) Add `WebViewBuilderExtDarwin::with_data_store_identifier`. +- [`203604c`](https://github.com/tauri-apps/wry/commit/203604c519e4acb169676b20ddf5956ba21b4d57)([#1233](https://github.com/tauri-apps/wry/pull/1233)) On Windows, fix the webview not filling up the whole window if the parent window was resized during the webview initialization. + +## \[0.39.3] + +- [`c7ca3db`](https://github.com/tauri-apps/wry/commit/c7ca3db581bbeb4f16a28f47c3a1fd59889c0978)([#1221](https://github.com/tauri-apps/wry/pull/1221)) On Windows, fix data directory created next to the executable with a gibberish name even if it was explicitly provided in `WebConext::new` + +## \[0.39.2] + +- [`3e3d59c`](https://github.com/tauri-apps/wry/commit/3e3d59cd4f79c21571e503a5bf80d4d54a654a38)([#1215](https://github.com/tauri-apps/wry/pull/1215)) On macOS, prevent NSExceptions and invalid memory access panics when dropping the WebView while custom protocols handlers may still be running. +- [`ca6b5fb`](https://github.com/tauri-apps/wry/commit/ca6b5fbef6e5a5efe43b5cbebe6bfc4bc13930d3)([#1224](https://github.com/tauri-apps/wry/pull/1224)) Update `windows` crate to `0.56` + +## \[0.39.1] + +- [`f0e82d3`](https://github.com/tauri-apps/wry/commit/f0e82d3aa2da9da2b935d97c9a9b5e2dbd65b6ea)([#1217](https://github.com/tauri-apps/wry/pull/1217)) Fix target detection on build script to enhance cross compiling capabilities. +- [`ed9fa9b`](https://github.com/tauri-apps/wry/commit/ed9fa9b3950206548cdaf0bcdb6c2d5fb72619b3)([#1210](https://github.com/tauri-apps/wry/pull/1210)) On iOS, allows media plays inline. + +## \[0.39.0] + +- [`ddda455`](https://github.com/tauri-apps/wry/commit/ddda4556b36a41b1c6f3f4d200eb16612d5f3f12)([#1207](https://github.com/tauri-apps/wry/pull/1207)) Disable deprecated applicationCache web api. This api was completely removed upstream in webkitgtk 2.44. +- [`d7031ae`](https://github.com/tauri-apps/wry/commit/d7031aed8eebc6324e4b3db46ee53120ce24930b)([#1206](https://github.com/tauri-apps/wry/pull/1206)) On Windows, fix a crash due to a double-free when the host window is destroyed before the webview is dropped. +- [`34ae1ca`](https://github.com/tauri-apps/wry/commit/34ae1ca3af75c471f77b90fd342bbcc79ac7189a)([#1202](https://github.com/tauri-apps/wry/pull/1202)) Add `dpi` module which is a re-export of `dpi` crate. +- [`fdbd3d3`](https://github.com/tauri-apps/wry/commit/fdbd3d3c614acd42dddb49583d16de6b3f02e62d)([#1081](https://github.com/tauri-apps/wry/pull/1081)) Update `http` dependency to `1` +- [`34ae1ca`](https://github.com/tauri-apps/wry/commit/34ae1ca3af75c471f77b90fd342bbcc79ac7189a)([#1202](https://github.com/tauri-apps/wry/pull/1202)) **Breaking Change**: Removed `x`, `y`, `with` and `height` fields from `Rect` struct and replaced it with `size` and `position` fields. +- [`c033bd2`](https://github.com/tauri-apps/wry/commit/c033bd27f23953537520d17493c7b77ea146e7d5)([#1156](https://github.com/tauri-apps/wry/pull/1156)) On `macOS`, fix menu keyboard shortcuts when added `webview` as `child`. + +## \[0.38.2] + +- [`3e84a0e`](https://github.com/tauri-apps/wry/commit/3e84a0e276dfac0b28fb01f42460f9367fff9f22)([#1200](https://github.com/tauri-apps/wry/pull/1200)) Fixes compilation for 32bit Linux targets. + +## \[0.38.1] + +- [`7c9e71f`](https://github.com/tauri-apps/wry/commit/7c9e71f4692e94fd401ad3508ff3912d43880e2c)([#1192](https://github.com/tauri-apps/wry/pull/1192)) Fixes compilation failing on Windows with the `tracing` feature enabled. + +## \[0.38.0] + +- [`e6f0fbd`](https://github.com/tauri-apps/wry/commit/e6f0fbd33365070af46361605a922ba24e542fb5)([#1180](https://github.com/tauri-apps/wry/pull/1180)) Fixes a null pointer exception when running `window.ipc.postMessage(null)` on Android. +- [`5789bf7`](https://github.com/tauri-apps/wry/commit/5789bf759ce94e4dad5ff26a08fe81521658a4e4)([#1187](https://github.com/tauri-apps/wry/pull/1187)) **Breaking change**: Refactored the file-drop handling on the webview for better representation of the actual drag and drop operation: + + - Renamed `file-drop` cargo feature flag to `drag-drop`. + - Removed `FileDropEvent` enum and replaced with a new `DragDropEvent` enum. + - Renamed `WebViewAttributes::file_drop_handler` field to `WebViewAttributes::drag_drop_handler`. + - Renamed `WebViewAttributes::with_file_drop_handler` method to `WebViewAttributes::with_drag_drop_handler`. +- [`b8fea39`](https://github.com/tauri-apps/wry/commit/b8fea396c2eca289e2f930ad635a15397b7c0dda)([#1183](https://github.com/tauri-apps/wry/pull/1183)) Changed `WebViewBuilder::with_ipc_handler` closure to take `http::Request` instead of `String` so the request URL is available. +- [`3a2026b`](https://github.com/tauri-apps/wry/commit/3a2026b37be67dea53535f0a7d78b32452ac8b40)([#1182](https://github.com/tauri-apps/wry/pull/1182)) **Breaking changes**: Changed a few methods on `WebView` type to return a `Result`: + + - `Webview::url` + - `Webview::zoom` + - `Webview::load_url` + - `Webview::load_url_with_headers` + - `Webview::bounds` + - `Webview::set_bounds` + - `Webview::set_visible` + - `WebviewExtWindows::set_theme` + - `WebviewExtWindows::set_memory_usage_level` + - `WebviewExtWindows::reparent` + - `WebviewExtUnix::reparent` + - `WebviewExtMacOS::reparent` +- [`e1e2e07`](https://github.com/tauri-apps/wry/commit/e1e2e071e5329bc1a94864e368fdaa3041e79427)([#1190](https://github.com/tauri-apps/wry/pull/1190)) Update `webview2-com` crate to `0.29` +- [`e1e2e07`](https://github.com/tauri-apps/wry/commit/e1e2e071e5329bc1a94864e368fdaa3041e79427)([#1190](https://github.com/tauri-apps/wry/pull/1190)) Update `windows` crate to `0.54` +- [`00bc96d`](https://github.com/tauri-apps/wry/commit/00bc96d115879c841fc47242271db3761d19f746)([#1179](https://github.com/tauri-apps/wry/pull/1179)) Added `WryActivity::onWebViewCreate(android.webkit.WebView)` on Android. + +## \[0.37.0] + +- [`8c86fba`](https://github.com/tauri-apps/wry/commit/8c86fbaf51cd970737cc070583318d4b532349d2) **Breaking change**: Removed `data:` url support, as its native support in Windows and macOS are buggy and unreliable, use `Webview::with_html` instead. +- [`8c86fba`](https://github.com/tauri-apps/wry/commit/8c86fbaf51cd970737cc070583318d4b532349d2) On Linux, decode `FilDropEvent` paths before emitting them to make it consistent across all platforms. +- [`8c86fba`](https://github.com/tauri-apps/wry/commit/8c86fbaf51cd970737cc070583318d4b532349d2) Added `WebViewExtMacOS::reparent`,`WebViewExtWindows::reparent` and `WebViewExtUnix::reparent`. +- [`8c86fba`](https://github.com/tauri-apps/wry/commit/8c86fbaf51cd970737cc070583318d4b532349d2) Revert global keys shortcuts (wry#1156) +- [`8c86fba`](https://github.com/tauri-apps/wry/commit/8c86fbaf51cd970737cc070583318d4b532349d2) **Breaking change**: Removed internal url parsing which had a few side-effects such as encoded url content, now it is up to the user to pass a valid URL as a string. This also came with a few breaking changes: + + - Removed `Url` struct re-export + - Removed `Error::UrlError` variant. + - Changed `WebviewAttributes::url` field type to `String`. + - Changed `WebviewBuilder::with_url` and `WebviewBuilder::with_url_and_headers` return type to `WebviewBuilder` instead of `Result`. + - Changed `Webview::url` getter to return a `String` instead of `Url`. + +## \[0.36.0] + +- [`8646120`](https://github.com/tauri-apps/wry/commit/8646120339b8ed983582caa9e668fc286dc59cb3)([#1159](https://github.com/tauri-apps/wry/pull/1159)) On android, fix `no non-static method ".evalScript(ILjava/lang/String;)"` when calling `Window::eval`. +- [`8646120`](https://github.com/tauri-apps/wry/commit/8646120339b8ed983582caa9e668fc286dc59cb3)([#1159](https://github.com/tauri-apps/wry/pull/1159)) On macOS, fix a release build crashes with SEGV when calling `WebView::evaluate_script`. This crash bug was introduced at v0.35.2. +- [`8646120`](https://github.com/tauri-apps/wry/commit/8646120339b8ed983582caa9e668fc286dc59cb3)([#1159](https://github.com/tauri-apps/wry/pull/1159)) **Breaking change** Update [raw-window-handle](https://crates.io/crates/raw-window-handle) crate to v0.6. + + - `HasWindowHandle` trait is required for window types instead of `HasRawWindowHandle`. + - `wry::raw_window_handle` now re-exports v0.6. +- [`8646120`](https://github.com/tauri-apps/wry/commit/8646120339b8ed983582caa9e668fc286dc59cb3)([#1159](https://github.com/tauri-apps/wry/pull/1159)) On `macOS`, fix menu keyboard shortcuts. This issue bug was introduced in `v2` when added `webview` as `child`. + +## \[0.35.2] + +- [`0ef041f`](https://github.com/tauri-apps/wry/commit/0ef041ffece143dcb5059ad43596c63b18a62928)([#1133](https://github.com/tauri-apps/wry/pull/1133)) On Linux, apply passed webview bounds when using `WebView::new_gtk` or `WebViewBuilder::new_gtk` with `gtk::Fixed` widget. This allows to create multiple webviews inside `gtk::Fixed` in the same window. +- [`0ef041f`](https://github.com/tauri-apps/wry/commit/0ef041ffece143dcb5059ad43596c63b18a62928)([#1133](https://github.com/tauri-apps/wry/pull/1133)) Added tracing spans for `evaluate_script`, `ipc_handler` and `custom_protocols` behind the `tracing` feature flag. + +## \[0.35.1] + +- [`a4a39b9`](https://github.com/tauri-apps/wry/commit/a4a39b9b23da3c562f27730dd0eab09b9459755b)([#1098](https://github.com/tauri-apps/wry/pull/1098)) Fix the API documentation cannot be built on docs.rs. +- [`e116d42`](https://github.com/tauri-apps/wry/commit/e116d427319d1adbc14d418e78c43ddb49b70d76)([#1111](https://github.com/tauri-apps/wry/pull/1111)) Fix screen share permissions dialog not showing up on macOS 14.0+ +- [`a8c0d38`](https://github.com/tauri-apps/wry/commit/a8c0d384fc51b12d2436c11d10fd8c2dfdcd9d4a)([#1097](https://github.com/tauri-apps/wry/pull/1097)) Fix IPC crash on wkwebview if receiving invalid types. +- [`8fddbb6`](https://github.com/tauri-apps/wry/commit/8fddbb6d514de8fa0561bd6631ff8a3699911ddd)([#1091](https://github.com/tauri-apps/wry/pull/1091)) Add `WebView::bounds` getter. +- [`30a85f3`](https://github.com/tauri-apps/wry/commit/30a85f31141839a5284b1bfdd52b1cb690fcd10d)([#1122](https://github.com/tauri-apps/wry/pull/1122)) On Windows, fix file drop handler. + +## \[0.35.0] + +- [`e61e7f8`](https://github.com/tauri-apps/wry/commit/e61e7f8474c18752f5c60d3f1f5ba33b27e41d52)([#1090](https://github.com/tauri-apps/wry/pull/1090)) **Breaking change** Consistently use `WebView` in API names. The following APIs were renamed: + + - `WebviewExtWindows` → `WebViewExtWindows` + - `WebviewExtUnix` → `WebViewExtUnix` + - `WebviewExtMacOS` → `WebViewExtMacOS` + - `WebviewExtIOS` → `WebViewExtIOS` + - `WebviewExtAndroid` → `WebViewExtAndroid` + - `WebviewUriLoader` → `WebViewUriLoader` +- [`e61e7f8`](https://github.com/tauri-apps/wry/commit/e61e7f8474c18752f5c60d3f1f5ba33b27e41d52)([#1090](https://github.com/tauri-apps/wry/pull/1090)) Add `WebViewExtWindows::set_memory_usage_level` API to set the [memory usage target level](https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2memoryusagetargetlevel) on Windows. Setting 'Low' memory usage target level when an application is going to inactive can significantly reduce the memory consumption. Please read the [guide for WebView2](https://github.com/MicrosoftEdge/WebView2Feedback/blob/main/specs/MemoryUsageTargetLevel.md) for more details. +- [`e61e7f8`](https://github.com/tauri-apps/wry/commit/e61e7f8474c18752f5c60d3f1f5ba33b27e41d52)([#1090](https://github.com/tauri-apps/wry/pull/1090)) - Add cfg_aliases for easier feature configuration. And add `os-webview` as default feature. +- [`e61e7f8`](https://github.com/tauri-apps/wry/commit/e61e7f8474c18752f5c60d3f1f5ba33b27e41d52)([#1090](https://github.com/tauri-apps/wry/pull/1090)) Enhance initalization script implementation on Android supporting any kind of URL. +- [`e61e7f8`](https://github.com/tauri-apps/wry/commit/e61e7f8474c18752f5c60d3f1f5ba33b27e41d52)([#1090](https://github.com/tauri-apps/wry/pull/1090)) Fix wkwebview crashed when received invalid UTF8 string from IPC. +- [`e61e7f8`](https://github.com/tauri-apps/wry/commit/e61e7f8474c18752f5c60d3f1f5ba33b27e41d52)([#1090](https://github.com/tauri-apps/wry/pull/1090)) Refactor new method to take raw window handle instead. Following are APIs got affected: + + - `application` module is removed, and `webivew` module is moved to root module. + - `WebViewBuilder::new`, `WebView::new` now take `RawWindowHandle` instead. + - Add `WebViewBuilder::new_as_child`, `WebView::new_as_child` to crate a webview as a child inside a parent window. + - `Webview::inner_size` is removed. + - Add `WebViewBuilderExtUnix` trait to extend `WebViewBuilder` on Unix platforms. + - Add `new_gtk` functions to `WebViewBuilderExtUnix` and `WebviewExtUnix`. + - [raw-window-handle](https://docs.rs/raw-window-handle/latest/raw_window_handle/) crate is re-exported as `wry::raw_window_handle`. + + This also means that we removed `tao` as a dependency completely which required some changes to the public APIs and to the Android backend: + + - Webview attributes `ipc_handler`, `file_drop_handler`, `document_change_handler` don't take the `Window` as first parameter anymore. + Users should use closure to capture the types they want to use. + - Position field in `FileDrop` event is now a tuple of `(x, y)` physical position instead of `PhysicalPosition`. Users need to handle scale factor + - We exposed the `android_setup` function that needs to be called once to setup necessary logic. + - Previously the `android_binding!` had internal call to `tao::android_binding` but now that `tao` has been removed, + the macro signature has changed and you now need to call `tao::android_binding` yourself, checkout the crate documentation for more information. + +## \[0.34.2] + +- [`c2e6980`](https://github.com/tauri-apps/wry/commit/c2e6980b6cacf02b3f8c0b0285d391d010f4536b)([#1047](https://github.com/tauri-apps/wry/pull/1047)) Fix doc building by removing dox feature requirement from `webkit2gtk`. +- [`82908d4`](https://github.com/tauri-apps/wry/commit/82908d4e001d1be6fd5d692fcb2e08908c4b5e16)([#1045](https://github.com/tauri-apps/wry/pull/1045)) Fix docs.rs build. + +## \[0.34.1] + +- [`3de68e7`](https://github.com/tauri-apps/wry/commit/3de68e781d52f3c817473c1ee8cc73b392d60c98)([#1043](https://github.com/tauri-apps/wry/pull/1043)) Fix compilation with the `linux-body` feature. + +## \[0.34.0] + +- [`ce95730`](https://github.com/tauri-apps/wry/commit/ce957301566dfe33f576810982a3eb38813d22ea)([#1036](https://github.com/tauri-apps/wry/pull/1036)) Upgrade gtk to 0.18 and bump MSRV to 1.70.0. +- [`591fda8`](https://github.com/tauri-apps/wry/commit/591fda8045b88ea0edbc5676e2814fb9acb2d6f6)([#1042](https://github.com/tauri-apps/wry/pull/1042)) Use `gtk`'s re-exported modules instead. +- [`b22a19e`](https://github.com/tauri-apps/wry/commit/b22a19e1c19ce90aec6521a66587dac9b0351579)([#1037](https://github.com/tauri-apps/wry/pull/1037)) Update `windows` and `windows-implement` crate to `0.51` + +## \[0.33.1] + +- [`0582cdf`](https://github.com/tauri-apps/wry/commit/0582cdf4a195db5df9c4e21d24039c64b7474683)([#1033](https://github.com/tauri-apps/wry/pull/1033)) Fix documentation for macOS target not being generated on docs.rs. + +## \[0.33.0] + +- [`5adf9da`](https://github.com/tauri-apps/wry/commit/5adf9da2151800ec2431a1547cc0d970fc95b764)([#994](https://github.com/tauri-apps/wry/pull/994)) **Breaking change** Wry now defaults to `http://.localhost/` for custom protocols on Android. +- [`844d95a`](https://github.com/tauri-apps/wry/commit/844d95a4035f68371d64f6b04151982481cdee70)([#1023](https://github.com/tauri-apps/wry/pull/1023)) Fixes async custom protocol resolver on Windows. +- [`5adf9da`](https://github.com/tauri-apps/wry/commit/5adf9da2151800ec2431a1547cc0d970fc95b764)([#994](https://github.com/tauri-apps/wry/pull/994)) Add `WebViewBuilderExtAndroid::with_https_scheme` to be able to choose between `http` and `https` for custom protocols on Android. +- [`c5c3731`](https://github.com/tauri-apps/wry/commit/c5c3731f2027802735f7b80c7ae5f4b64d0fb746)([#1024](https://github.com/tauri-apps/wry/pull/1024)) Add winit-gtk to support winit feature flag on Linux. + +## \[0.32.0] + +- [`4bdf1c3`](https://github.com/tauri-apps/wry/commit/4bdf1c366de5708b7626ca63eb39e134869c5bd4)([#1017](https://github.com/tauri-apps/wry/pull/1017)) Added `WebViewBuilder::with_asynchronous_custom_protocol` to allow implementing a protocol handler that resolves asynchronously. +- [`70d8ae0`](https://github.com/tauri-apps/wry/commit/70d8ae057c5e8b81db4aac28e5fa2dd3424b3307)([#1009](https://github.com/tauri-apps/wry/pull/1009)) Fixes Android freezing when handling request due to endless iteration when reading request headers. +- [`b5e1875`](https://github.com/tauri-apps/wry/commit/b5e1875230794502a8e74c74abe79ca63488e421)([#994](https://github.com/tauri-apps/wry/pull/994)) **Breaking change** Wry now defaults to `http://.localhost/` for custom protocols on Windows. +- [`b5e1875`](https://github.com/tauri-apps/wry/commit/b5e1875230794502a8e74c74abe79ca63488e421)([#994](https://github.com/tauri-apps/wry/pull/994)) Add `WebViewBuilderExtWindows::with_https_scheme` to be able to choose between `http` and `https` for custom protocols on Windows. +- [`fa15076`](https://github.com/tauri-apps/wry/commit/fa15076207d9e678db4149210aba929044d0ff45)([#163](https://github.com/tauri-apps/wry/pull/163)) Add `winit` and `tao` feature flag with `tao` as default. +- [`4bdf1c3`](https://github.com/tauri-apps/wry/commit/4bdf1c366de5708b7626ca63eb39e134869c5bd4)([#1017](https://github.com/tauri-apps/wry/pull/1017)) **Breaking change:** `WebViewBuidler::with_custom_protocol` closure now returns `http::Response` instead of `Result`. +- [`ebc4a20`](https://github.com/tauri-apps/wry/commit/ebc4a20d218036b29b186aca1853d28d870fa2ef)([#1015](https://github.com/tauri-apps/wry/pull/1015)) Add `WebViewAtrributes.focused` and `WebViewBuilder::with_focused` to control whether to focus the webview upon creation or not. Supported on Windows and Linux only. + +## \[0.31.0] + +- [`e47562f`](https://github.com/tauri-apps/wry/commit/e47562f71284457ff77e4c8b6bf02fdbe19ab880)([#993](https://github.com/tauri-apps/wry/pull/993)) Update the unmaintained `kuchiki` crate to the maintained `kuchikiki` crate. +- [`7a353c7`](https://github.com/tauri-apps/wry/commit/7a353c7d8a474bfb14b92a272efc75ceb194ea90)([#980](https://github.com/tauri-apps/wry/pull/980)) Add `WebViewBuilder::with_on_page_load_handler` for providing a callback for handling various page loading events. +- [`b0a08b1`](https://github.com/tauri-apps/wry/commit/b0a08b165215823ed7a48a0a377e0f09832898df)([#997](https://github.com/tauri-apps/wry/pull/997)) Update `tao` to version `0.22` which has removed the global-shortcut, menus and tray features, see [tao@v0.22 release](https://github.com/tauri-apps/tao/releases/tag/tao-v0.22.0). + +## \[0.30.0] + +- [`17e04e2`](https://github.com/tauri-apps/wry/commit/17e04e2b4c0bd75f93bbc511234f0d3c93726b63)([#985](https://github.com/tauri-apps/wry/pull/985)) Make `WebViewBuilder::with_navigation_handler` apply to Android `loadUrl` calls. +- [`17e04e2`](https://github.com/tauri-apps/wry/commit/17e04e2b4c0bd75f93bbc511234f0d3c93726b63)([#985](https://github.com/tauri-apps/wry/pull/985)) Add support for `WebViewBuilder::with_navigation_handler` on Android. +- [`87b331a`](https://github.com/tauri-apps/wry/commit/87b331a7d4c169814d2b6a1f8a06d976ad7565bc)([#978](https://github.com/tauri-apps/wry/pull/978)) On Windows, avoid resizing the webview when the window gets minimized to avoid unnecessary `resize` event on JS side. +- [`17e04e2`](https://github.com/tauri-apps/wry/commit/17e04e2b4c0bd75f93bbc511234f0d3c93726b63)([#985](https://github.com/tauri-apps/wry/pull/985)) Update tao to 0.21. + +## \[0.29.0] + +- [`c09dd7b`](https://github.com/tauri-apps/wry/commit/c09dd7bebe3d00f989dff57f0414f1023653efe4)([#968](https://github.com/tauri-apps/wry/pull/968)) Remove ActionBar handling from wry. If you want to hide the action bar, hide it using the `themes.xml` file in your android project or inherit `WryActivity` class and use `getSupportActionBar()?.hide()` in the `onCreate` method. +- [`2b56bfa`](https://github.com/tauri-apps/wry/commit/2b56bfaaee5125f0dc48f4a9bedb53db0e679e5f)([#966](https://github.com/tauri-apps/wry/pull/966)) Add support for `WebViewBuilder::with_html` and `WebViewAttributes.html` on Android. +- [`d2c1819`](https://github.com/tauri-apps/wry/commit/d2c1819f81a7b03288348f1c3b195407400dfbde)([#969](https://github.com/tauri-apps/wry/pull/969)) On Linux, replace `linux-header` flag with `linux-body` flag. Request headers are enabled by default. Add request body on custom protocol but it's behind the flag. +- [`f7dded4`](https://github.com/tauri-apps/wry/commit/f7dded417c239c39ca4cad6f9d3f6b319c3f91f2)([#955](https://github.com/tauri-apps/wry/pull/955)) The bug was reported in tauri repo: https://github.com/tauri-apps/tauri/issues/5986 + + With input method preedit disabled,fcitx can anchor at edit cursor position. + the pre-edit text will not disappear,instead it shows in the fcitx selection window below the input area. +- [`2b56bfa`](https://github.com/tauri-apps/wry/commit/2b56bfaaee5125f0dc48f4a9bedb53db0e679e5f)([#966](https://github.com/tauri-apps/wry/pull/966)) Set base url and origin to null for `WebViewBuilder::with_html` and `WebViewAttributes.html` for consistency on all platforms. + +## \[0.28.3] + +- On iOS, fix panic at runtime due to setting webview ivar. + - [c9002c1](https://github.com/tauri-apps/wry/commit/c9002c1e043e8a948fff2e671ccb04153a10dcd5) fix(macos): remove `webview` ivar in `WryWebView` ([#943](https://github.com/tauri-apps/wry/pull/943)) on 2023-04-26 + +## \[0.28.2] + +- Adjust `cargo:rerun-if-changed` instruction for Android files. + - [cc934fe](https://github.com/tauri-apps/wry/commit/cc934fe799836e4cc72d796f5eddba868a9b585e) refactor(build): adjust rerun-if-changed instruction for Android files ([#940](https://github.com/tauri-apps/wry/pull/940)) on 2023-04-24 + +## \[0.28.1] + +- Fix unresolved reference in kotlin files when building for android. + - [ed36c0b](https://github.com/tauri-apps/wry/commit/ed36c0b032cdf27c926577ee72658ad9f0785a5f) fix(android): fix unresolved reference in kotlin files ([#932](https://github.com/tauri-apps/wry/pull/932)) on 2023-04-19 +- Support modifying user agent string on Android. + - [4a320b0](https://github.com/tauri-apps/wry/commit/4a320b0bdef81d36a1f85a083c2abbabaf958521) feat(android): add support modifying user agent string ([#933](https://github.com/tauri-apps/wry/pull/933)) on 2023-04-20 +- On Linux and macOS, add synthesized event for mouse backward and forward buttons. + - [6ef820b](https://github.com/tauri-apps/wry/commit/6ef820b97dd505bacdc7d3f906112ffe0a6a1e60) feat: synthesize forward/backward mouse button on Linux and macOS ([#900](https://github.com/tauri-apps/wry/pull/900)) on 2023-04-18 + +## \[0.28.0] + +- Add `Webview::clear_browsing_data` method. + - [5f0c9e4](https://github.com/tauri-apps/wry/commit/5f0c9e4595baf5d60ec407b391f873ab52abf923) feat: add `Webview::clear_browsing_data` ([#915](https://github.com/tauri-apps/wry/pull/915)) on 2023-04-18 +- On Android, generate a `proguard-wry.pro` file that could be used to keep the necessary symbols for wry when using minification. + - [ced4c0b](https://github.com/tauri-apps/wry/commit/ced4c0b4459ceb0ff89d07b84d6396c60cfd75e5) feat: generate proguard rule file for android ([#927](https://github.com/tauri-apps/wry/pull/927)) on 2023-04-17 +- Update `tao` to `0.19` + - [d560981](https://github.com/tauri-apps/wry/commit/d56098113f9764e31f73aa84144ee84be8e2aead) refactor: rename `TauriActivity` to `WryActivity` ([#926](https://github.com/tauri-apps/wry/pull/926)) on 2023-04-17 + +## \[0.27.3] + +- Adds a way to launch a WebView as incognito through a new API at WebViewBuilder named as `with_incognito`. + - [8698836](https://github.com/tauri-apps/wry/commit/86988368a4e833b21089d119c934529ecfe306b7) feat: Add a way to launch WebViews as incognito `WebView::as_incognito`, closes [#908](https://github.com/tauri-apps/wry/pull/908) ([#916](https://github.com/tauri-apps/wry/pull/916)) on 2023-04-06 +- On macOS and iOS, remove webcontext implementation since we don't actually use it. This also fix segfault if users drop webcontext early. + - [3cc45cb](https://github.com/tauri-apps/wry/commit/3cc45cb86b93c56cf2444bfc37dc6ba229d4222e) Remove webcontext implementation on wkwebview ([#922](https://github.com/tauri-apps/wry/pull/922)) on 2023-04-07 +- Use the new WKWebView `inspectable` property if available (iOS 16.4, macOS 13.3). + - [c3f7304](https://github.com/tauri-apps/wry/commit/c3f7304dbfd45d1e1c27b53be2369c737e946b69) feat(macos): use WKWebView's inspectable property ([#923](https://github.com/tauri-apps/wry/pull/923)) on 2023-04-08 + +## \[0.27.2] + +- On Android, Add support for native back button navigation. + - [fc232a3](https://github.com/tauri-apps/wry/commit/fc232a32268a13ec89965450dd6cf0abca064b24) feat(android): add support for native back navigation ([#918](https://github.com/tauri-apps/wry/pull/918)) on 2023-04-03 +- Fix `WebView::url` getter on Android. + - [427cf92](https://github.com/tauri-apps/wry/commit/427cf9222d7152f911aa70eb778eb7aa90c83fac) Unify custom porotocol across Android/iOS ([#546](https://github.com/tauri-apps/wry/pull/546)) on 2022-04-11 + - [b89398a](https://github.com/tauri-apps/wry/commit/b89398a9bb17303544a1f04303783f311c6dc77f) Publish New Versions ([#547](https://github.com/tauri-apps/wry/pull/547)) on 2022-04-26 + - [c22744a](https://github.com/tauri-apps/wry/commit/c22744a0c11e9c78f548dc3786e6be30c1d6f46f) fix(android): use correct method signature ([#917](https://github.com/tauri-apps/wry/pull/917)) on 2023-03-31 +- Add Webview attribute to enable/disable autoplay. Enabled by default. + - [6a523cc](https://github.com/tauri-apps/wry/commit/6a523cc7a633236e1fb562e0626e0aedc67ec2fc) feat: Add setting to enable autoplay ([#913](https://github.com/tauri-apps/wry/pull/913)) on 2023-04-04 +- Fix the `WebViewBuilder::with_url` when the projet use `mimalloc` + - [c22744a](https://github.com/tauri-apps/wry/commit/c22744a0c11e9c78f548dc3786e6be30c1d6f46f) fix(android): use correct method signature ([#917](https://github.com/tauri-apps/wry/pull/917)) on 2023-03-31 +- Revert [`51b49c54`](https://github.com/tauri-apps/wry/commit/51b49c54e41c71d1c5f03b568094d43fb9dc32ac) which hid the webview when minimized on Windows. + - [f76568a](https://github.com/tauri-apps/wry/commit/f76568a1cc8f7e56f36633d2f6e700af684bb213) fix(windows): Ignore resize event when minimizing frameless windows ([#909](https://github.com/tauri-apps/wry/pull/909)) on 2023-03-24 + +## \[0.27.1] + +- On Windows, Linux and macOS, add method `evaluate_script_with_callback` to execute javascipt with a callback. + Evaluated result will be serialized into JSON string and pass to the callback. + - [2647731](https://github.com/tauri-apps/wry/commit/2647731c1f084565895a5306fa6465ee6cd271c2) feat: support callback function in eval ([#778](https://github.com/tauri-apps/wry/pull/778)) on 2023-03-23 +- On iOS, set webview scroll bounce default to NO. + - [4d61cf1](https://github.com/tauri-apps/wry/commit/4d61cf122dc0e5b2cef818e0fd491dbd0fd47621) fix(ios): set scroll bounce default to NO ([#907](https://github.com/tauri-apps/wry/pull/907)) on 2023-03-20 +- Update the value returned on a `None` value of `ClassDecl::new("WryDownloadDelegate", class!(NSObject))` + from `UIViewController` to `WryDownloadDelegate`. + - [7795356](https://github.com/tauri-apps/wry/commit/7795356a45b1bd015fad0e9973fc5af58c8c339b) fix: WryDownloadDelegate call after first time on 2023-02-20 +- On Linux, disable system appearance for scrollbars. + - [530a8b7](https://github.com/tauri-apps/wry/commit/530a8b73766dc54736ae6de9528683b27430eaa6) fix(linux): disable system appearance for scrollbars ([#897](https://github.com/tauri-apps/wry/pull/897)) on 2023-03-08 +- On Windows and Linux, implement `WebviewBuilder::with_back_forward_navigation_gestures` and `WebviewAttributes::back_forward_navigation_gestures` to control swipe navigation. Disabled by default. + - [15b4ddf](https://github.com/tauri-apps/wry/commit/15b4ddf7698cf04b90ffcc3164ccb7b62daf6ed0) feat(win\&linux): implement the option to control gesture navigation ([#896](https://github.com/tauri-apps/wry/pull/896)) on 2023-03-07 + +## \[0.27.0] + +- Add function to dispatch closure with the Android context. + - [a9e186c](https://github.com/tauri-apps/wry/commit/a9e186cab4456d7ac2c265e61e71b345f7d269c4) feat(android): add function to dispatch closure to the Android context ([#864](https://github.com/tauri-apps/wry/pull/864)) on 2023-02-06 +- On macOS, fix crash when getting dragging position. + - [a8f7cef](https://github.com/tauri-apps/wry/commit/a8f7cefaac72d3e9fd2f8901f790a777d9888357) Fix crash when getting drag position ([#867](https://github.com/tauri-apps/wry/pull/867)) on 2023-02-04 +- On Android, `wry` can again load assets from the apk's `asset` folder via a custom protocol. This is set by `WebViewBuilder`'s method `with_asset_loader`, which is exclusive to Android (by virtue of existing within `WebViewBuilderExtAndroid`). + - [077eb3a](https://github.com/tauri-apps/wry/commit/077eb3a7ca520d07e73f899da60ce23eef941e6f) fix(android): restore asset loading functionality to android (fix: [#846](https://github.com/tauri-apps/wry/pull/846)) ([#854](https://github.com/tauri-apps/wry/pull/854)) on 2023-02-07 +- Update `webview2-com` to `0.22` and `windows-rs` to `0.44` which bumps the MSRV of this crate on Windows to `1.64`. + - [496bfb5](https://github.com/tauri-apps/wry/commit/496bfb5c7be55e9c2bb674e241f9d7d2620e2acd) chore(deps): update to windows-rs 0.44 and webview2-com 0.22 ([#871](https://github.com/tauri-apps/wry/pull/871)) on 2023-02-06 + +## \[0.26.0] + +- Added `WebViewBuilderExtAndroid` trait and with `on_webview_created` hook. + - [08c0156](https://github.com/tauri-apps/wry/commit/08c0156c60e016bd77f6e0f1bd16ae31dc48d4a0) feat(android): add on_webview_created hook, expose find_class ([#855](https://github.com/tauri-apps/wry/pull/855)) on 2023-01-30 +- Enable dox feature when building docs. + - [c6e53c6](https://github.com/tauri-apps/wry/commit/c6e53c6fa007dcc2dc4771a94b7f312f95edd892) Enable dox feature when building docs ([#861](https://github.com/tauri-apps/wry/pull/861)) on 2023-01-31 +- Expose `wry::webview::prelude::find_class` function to find an Android class in the app project scope. + - [08c0156](https://github.com/tauri-apps/wry/commit/08c0156c60e016bd77f6e0f1bd16ae31dc48d4a0) feat(android): add on_webview_created hook, expose find_class ([#855](https://github.com/tauri-apps/wry/pull/855)) on 2023-01-30 +- Added `WebviewExtIOS` trait to access the WKWebView and userContentController references. + - [f546c44](https://github.com/tauri-apps/wry/commit/f546c44fce76faf04855a97b285bbdef8ae80f3d) feat(ios): add WebviewExtIOS ([#859](https://github.com/tauri-apps/wry/pull/859)) on 2023-01-30 + +## \[0.25.0] + +- **Breaking Change:** Bump webkit2gtk to 0.19. This will use webkit2gtk-4.1 as dependency from now on. Also Bump gtk version: 0.15 -> 0.16. + - [c5f3b36](https://github.com/tauri-apps/wry/commit/c5f3b36b7ac4613971ddf56397932c44a9c74878) Bump gtk version 0.15 -> 0.16 ([#851](https://github.com/tauri-apps/wry/pull/851)) on 2023-01-26 +- **Breaking** Add position of the drop to `FileDropEvent` struct. + - [bce39e2](https://github.com/tauri-apps/wry/commit/bce39e2be195194e547b0021e770e45a3df15fa1) feat: add file drop position ([#847](https://github.com/tauri-apps/wry/pull/847)) on 2023-01-17 +- On Android, fix the injection of `intialization_scripts` for devServers where the `Content-Type` header includes more information than just `"text/plain"`. + - [87216c7](https://github.com/tauri-apps/wry/commit/87216c7f01d5f65641422343dd0aa7f08ea61d0d) fix: make the Content-Type check spec compliant ([#844](https://github.com/tauri-apps/wry/pull/844)) on 2023-01-14 + +## \[0.24.1] + +- Update `tao` to `0.16.0` + - [a27a66b](https://github.com/tauri-apps/wry/commit/a27a66baccc86873110b0aa67ddad1f3a8dbd205) chore: update tao to 0.16.0 on 2023-01-11 + +## \[0.24.0] + +- Changed env vars used when building for Android; changed `WRY_ANDROID_REVERSED_DOMAIN` to `WRY_ANDROID_PACKAGE` and `WRY_ANDROID_APP_NAME_SNAKE_CASE` to `WRY_ANDROID_LIBRARY`. + - [dfe6a5e](https://github.com/tauri-apps/wry/commit/dfe6a5e78acca05d9e0808c8f4ed974a8657b847) refactor: improve android env vars naming ([#829](https://github.com/tauri-apps/wry/pull/829)) on 2022-12-30 +- Fixes Android initialization scripts order. + - [7f819c0](https://github.com/tauri-apps/wry/commit/7f819c0ec3d3aaaf582d9eecde09f5e539c45743) fix(android): initialization scripts order ([#808](https://github.com/tauri-apps/wry/pull/808)) on 2022-12-12 +- Remove redundant `.clone()` calls and avoid unnecessary heap allocations. + - [45f2b21](https://github.com/tauri-apps/wry/commit/45f2b2127e73718b71f349eae1847d1764c748f5) perf: remove redundant `.clone()` calls and avoid unnecessary heap allocations ([#812](https://github.com/tauri-apps/wry/pull/812)) on 2022-12-14 +- Change return type of [custom protocol handlers](https://docs.rs/wry/latest/wry/webview/struct.WebViewBuilder.html#method.with_custom_protocol) from `Result>>` to `Result>>`. This allows the handlers to return static resources without heap allocations. This is effective when you embed some large files like bundled JavaScript source as `&'static [u8]` using [`include_bytes!`](https://doc.rust-lang.org/std/macro.include_bytes.html). + - [ddd3461](https://github.com/tauri-apps/wry/commit/ddd34614be8a0ba826eff8acbf4b06710ce2ba65) perf: Change return type of custom protocol handler from `Vec` to `Cow<'static, [u8]>`, closes [#796](https://github.com/tauri-apps/wry/pull/796) ([#797](https://github.com/tauri-apps/wry/pull/797)) on 2022-12-12 +- Ensures that the script passed to `.with_initialization_script("here")` is not empty. + - [ceb209e](https://github.com/tauri-apps/wry/commit/ceb209eddc20d284be748ee382ba8aef7686863b) fix empty string bug (fix: [#833](https://github.com/tauri-apps/wry/pull/833)) ([#836](https://github.com/tauri-apps/wry/pull/836)) on 2023-01-08 +- Add APIs to process webview document title change. + - [14a0ee3](https://github.com/tauri-apps/wry/commit/14a0ee323e8e596f45d4a57d2d86abcf0a848bc8) feat: add document title changed handler, closes [#804](https://github.com/tauri-apps/wry/pull/804) ([#825](https://github.com/tauri-apps/wry/pull/825)) on 2022-12-30 +- Evaluate scripts after the page load starts on Linux and macOS. + - [ca7c8e4](https://github.com/tauri-apps/wry/commit/ca7c8e44832b3236f08022f7ea3469be9a65aa3f) fix(unix): race condition on script eval ([#815](https://github.com/tauri-apps/wry/pull/815)) on 2022-12-14 +- Improve panic error messages on the build script. + - [5b9f21d](https://github.com/tauri-apps/wry/commit/5b9f21d38974881c2d6f4456990f5863484e7382) feat: improve build script panic messages ([#807](https://github.com/tauri-apps/wry/pull/807)) on 2022-12-12 +- Add `WebViewBuilder::with_url_and_headers` and `WebView::load_url_with_headers` to navigate to urls with headers. + - [8ae93b9](https://github.com/tauri-apps/wry/commit/8ae93b9c76b2efe14e93febd009e31fc459275a8) feat: add headers when loading URLs, closes [#816](https://github.com/tauri-apps/wry/pull/816) ([#826](https://github.com/tauri-apps/wry/pull/826)) on 2023-01-01 + - [e246bd1](https://github.com/tauri-apps/wry/commit/e246bd164eb9df1b0e48123a542bbd240958c9db) chore: update headers change file on 2023-01-01 +- Change class declare name from `UIViewController` to `WryNavigationDelegate` to avoid class name conflict on iOS. + - [fca42a0](https://github.com/tauri-apps/wry/commit/fca42a0730e75a142f7f354c6ac3f6d6a0f4711f) fix(ios): navigation delegate class name conflict ([#824](https://github.com/tauri-apps/wry/pull/824)) on 2022-12-27 +- Rerun build script if the `WRY_ANDROID_KOTLIN_FILES_OUT_DIR` directory changes. + - [1cf92e2](https://github.com/tauri-apps/wry/commit/1cf92e2b68b1d9109de3924a3cd1fd10cb8c7c17) feat(build): rerun if kotlin out directory changes ([#839](https://github.com/tauri-apps/wry/pull/839)) on 2023-01-10 +- On Windows, Add `WebviewBuilderExtWindows::with_theme` and `WebviewExtWindows::set_theme` to change webview2 theme. + - [563a497](https://github.com/tauri-apps/wry/commit/563a497d7f842c760ad05a0017059e7781c2b810) feat(webview2): add theme API, closes [#806](https://github.com/tauri-apps/wry/pull/806) ([#809](https://github.com/tauri-apps/wry/pull/809)) on 2022-12-13 + +## \[0.23.4] + +- Fixes Android initialization scripts order. + - [800cc48](https://github.com/tauri-apps/wry/commit/800cc48b46ba9e5ce968efd5708aeb71b63832f9) fix(android): initialization scripts order ([#808](https://github.com/tauri-apps/wry/pull/808)) on 2022-12-12 +- Improve panic error messages on the build script. + - [4ec7386](https://github.com/tauri-apps/wry/commit/4ec7386740ab2edb3b56d72668841af3f329cefd) feat: improve build script panic messages ([#807](https://github.com/tauri-apps/wry/pull/807)) on 2022-12-12 + +## \[0.23.3] + +- Fix the beep sound on macOS + - [94256c3](https://github.com/tauri-apps/wry/commit/94256c3adb1d6c005e0386f8b20f01d597b52f28) Fix beep sound, closes [#799](https://github.com/tauri-apps/wry/pull/799) ([#801](https://github.com/tauri-apps/wry/pull/801)) on 2022-12-10 + +## \[0.23.2] + +- On macOS, remove all custom keydown implementations. This will bring back keydown regression but should allow all accelerator working. + - [fee4bf2](https://github.com/tauri-apps/wry/commit/fee4bf2eb384d9c315530bd8f5af146909706cf6) Remove all keydown implementations ([#798](https://github.com/tauri-apps/wry/pull/798)) on 2022-12-10 +- Suppress `unused_variables` warning reported only in release build. + - [4e23c0f](https://github.com/tauri-apps/wry/commit/4e23c0f84b5a954be78418d56e37366395de030f) fix(macos): suppress `unused_variables` warning reported only in release build ([#790](https://github.com/tauri-apps/wry/pull/790)) on 2022-12-07 +- Add `WebViewBuilderExtWindows::with_browser_accelerator_keys` method to allow disabling browser-specific accelerator keys enabled in WebView2 by default. When `false` is passed, it disables all accelerator keys that access features specific to a web browser. See [the official WebView2 document](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/winrt/microsoft_web_webview2\_core/corewebview2settings#arebrowseracceleratorkeysenabled) for more details. + - [6e622ff](https://github.com/tauri-apps/wry/commit/6e622ffbdad2312bf3906d278a75956a3a6eeadd) feat(windows): Allow disabling browser-specific accelerator keys ([#792](https://github.com/tauri-apps/wry/pull/792)) on 2022-12-07 + +## \[0.23.1] + +- Fixes usage of the `linux-headers` feature. + - [64a72ff](https://github.com/tauri-apps/wry/commit/64a72ffd2369f51d36bdb00973f71326e8395016) fix(wry): correctly use the linux-headers feature on 2022-12-05 + +## \[0.23.0] + +- Properly parse the content type header for the `android.webkit.WebResourceResponse` mime type. + - [1db5ea6](https://github.com/tauri-apps/wry/commit/1db5ea68c2028db77788ec8c78ee0ab75a7a5f7f) fix(android): properly parse content-type for response mime type ([#772](https://github.com/tauri-apps/wry/pull/772)) on 2022-11-27 +- Change typo in `WebViewBuilderExtWindows::with_additionl_browser_args`. to `WebViewBuilderExtWindows::with_additional_browser_args`. + - [db1c290](https://github.com/tauri-apps/wry/commit/db1c290c0d8b58f6612ef9bef244a06261fb2a6e) fix(windows): Fix typo in method name of `WebViewBuilderExtWindows` ([#781](https://github.com/tauri-apps/wry/pull/781)) on 2022-12-02 +- Add `Webiew::load_url`. + - [a2b9531](https://github.com/tauri-apps/wry/commit/a2b9531b0e8397dcf74c049ccf6c7fa125288ca8) feat: add `Webiew::navigate_to_url`, closes [#776](https://github.com/tauri-apps/wry/pull/776) ([#777](https://github.com/tauri-apps/wry/pull/777)) on 2022-11-30 +- Change the type of `WebViewBuilderExtWindows::with_additional_browser_args` argument from `AsRef` to `Into` to reduce extra allocation. + - [b0ff06a](https://github.com/tauri-apps/wry/commit/b0ff06aba5aea77f067aee1e9bf8ac8c245ac5e8) perf: reduce extra allocation at `WebViewBuilderExtWindows::with_additional_browser_args` argument ([#783](https://github.com/tauri-apps/wry/pull/783)) on 2022-12-03 +- Validate custom protocol response status code on Android. + - [7f585c7](https://github.com/tauri-apps/wry/commit/7f585c7dc947936387faf565f3f5cbe62148daaf) feat(android): validate custom protocol response status code ([#779](https://github.com/tauri-apps/wry/pull/779)) on 2022-11-30 +- \[https://github.com/tauri-apps/wry/commit/04422bc1b579d9388ce03c2388b8f415dbc0747b] On macOS, revert content view to native NSView (\[#782])(https://github.com/tauri-apps/wry/pull/782) + +## \[0.22.6] + +- Fixes usage of the `linux-headers` feature. + - [14c5ae7](https://github.com/tauri-apps/wry/commit/14c5ae7d41b506c8a398d4735062b46cd0770447) fix(wry): correctly use the linux-headers feature on 2022-12-05 + +## \[0.22.5] + +- On macOS, fix arrow keys misprint text on textarea. + - [3005e54](https://github.com/tauri-apps/wry/commit/3005e5450339c6c3fbc1c7c67ab8008ed39ec864) On macOS, fix arrow keys misprint texts ([#769](https://github.com/tauri-apps/wry/pull/769)) on 2022-11-25 + +## \[0.22.4] + +- On Linux, add `linux-headers` feature flag to fix version regression. The minimum webkit2gtk version remains v2.22. + - [cf447f6](https://github.com/tauri-apps/wry/commit/cf447f64451fd8345f21440df31601265e0fde86) On Linux, add header feature flag to fix version regression ([#766](https://github.com/tauri-apps/wry/pull/766)) on 2022-11-24 + +## \[0.22.3] + +- On macOS, fix keyinput missing by calling superclass methods. + - [e40e55a](https://github.com/tauri-apps/wry/commit/e40e55a41d8d65ceda5e182c8915d37b5698c7b0) On macOS, fix keyinput missing by calling super class methods ([#764](https://github.com/tauri-apps/wry/pull/764)) on 2022-11-21 + +## \[0.22.2] + +- On macOS, add an API to enable or disable backward and forward navigation gestures. + - [487dff0](https://github.com/tauri-apps/wry/commit/487dff03a103df999e5e0c6286f75b4d1f419d25) Add the ability to navigate with swipe gesture ([#757](https://github.com/tauri-apps/wry/pull/757)) on 2022-11-16 + - [1a0ec19](https://github.com/tauri-apps/wry/commit/1a0ec19fd533c853b744c5e2346542d2e1e5805d) Update gesture change file to patch ([#763](https://github.com/tauri-apps/wry/pull/763)) on 2022-11-21 +- On macOS, pass key event to menu if we have one on key press. + - [2e5e138](https://github.com/tauri-apps/wry/commit/2e5e1381789c332654a5ffee47d578042a9be87b) On macOS, pass key event to menu on key press ([#760](https://github.com/tauri-apps/wry/pull/760)) on 2022-11-21 + +## \[0.22.1] + +- Fix `WebViewBuilder::with_accept_first_mouse` taking behavior of first initalized webview. + - [0647c0e](https://github.com/tauri-apps/wry/commit/0647c0efe131566ffbab0729e9d74355155c3c32) fix(macos): fix `acceptFirstMouse` for subsequent webviews, closes [#751](https://github.com/tauri-apps/wry/pull/751) ([#752](https://github.com/tauri-apps/wry/pull/752)) on 2022-11-13 +- Fix download implementation on macOS older than 11.3. + - [e69ddc6](https://github.com/tauri-apps/wry/commit/e69ddc6943770aa8baa02431bb037bbdcb3cbd80) fix(macos): download breaking app on macOS older than 11.3, closes [#755](https://github.com/tauri-apps/wry/pull/755) ([#756](https://github.com/tauri-apps/wry/pull/756)) on 2022-11-15 +- On macOS, remove webview from window's NSView before dropping. + - [3d3ea80](https://github.com/tauri-apps/wry/commit/3d3ea80808a327c546d8bbd97e06ef4b8feb32d0) On macOS, remove webview from window's NSView before dropping ([#754](https://github.com/tauri-apps/wry/pull/754)) on 2022-11-14 + +## \[0.22.0] + +- Added `WebViewAttributes::with_accept_first_mouse` method for macOS. + - [2c23440](https://github.com/tauri-apps/wry/commit/2c23440f9c194064caa907650df39bf9c96ed99c) feat(macos): add `accept_first_mouse` option, closes [#714](https://github.com/tauri-apps/wry/pull/714) ([#715](https://github.com/tauri-apps/wry/pull/715)) on 2022-10-04 +- **Breaking change** Custom protocol now takes `Request` and returns `Response` types from `http` crate. + - [1510e45](https://github.com/tauri-apps/wry/commit/1510e452547a95af2e42ff5199640877beecdbd7) refactor: use `http` crate primitives instead of a custom impl ([#706](https://github.com/tauri-apps/wry/pull/706)) on 2022-09-29 +- Enabled devtools in debug mode by default. + - [fea0638](https://github.com/tauri-apps/wry/commit/fea0638d9ad100c00b95468aa16fc44d6517ac0d) feat: enable devtools in debug mode by default ([#741](https://github.com/tauri-apps/wry/pull/741)) on 2022-10-27 +- On Desktop, add `download_started_handler` and `download_completed_handler`. See `blob_download` and `download_event` example for their usages. + - [3691c4f](https://github.com/tauri-apps/wry/commit/3691c4f6c88fe43e92597caf3003c8d57b447a7b) feat: Add download started and download completed callbacks ([#530](https://github.com/tauri-apps/wry/pull/530)) on 2022-10-19 +- Fix double permission dialog on macOS 12+ and iOS 15+. + - [8aa7d61](https://github.com/tauri-apps/wry/commit/8aa7d61cdc9fc584805b46c3ffd700aabb633649) Fix: Remove extra soft prompt asking for media permission on every app launch in macOS ([#694](https://github.com/tauri-apps/wry/pull/694)) on 2022-09-29 +- Focus webview when window starts moving or resizing on Windows to automatically close `` dropdown position + - [a1001dd](https://github.com/tauri-apps/wry/commit/a1001dd6361a0629cd1ce2f8063b7c983bf29616) fix(windows): focus webview on `WM_ENTERSIZEMOVE` and call `NotifyParentChanged` on `WM_WINDOWPOSCHANGED`. ([#695](https://github.com/tauri-apps/wry/pull/695)) on 2022-09-16 +- On Windows, hide the webview when the window is minimized to reduce memory and cpu usage. + - [51b49c5](https://github.com/tauri-apps/wry/commit/51b49c54e41c71d1c5f03b568094d43fb9dc32ac) feat(webview2): hide the webview when the window is minimized ([#702](https://github.com/tauri-apps/wry/pull/702)) on 2022-09-27 +- Internally return with error from custom protocol if an invalid uri was requseted such as `wry://` which doesn't contain a host. + - [818ce99](https://github.com/tauri-apps/wry/commit/818ce9989d816bf970ebcf93009b2d693384e436) fix: don't panic on invalid uri ([#712](https://github.com/tauri-apps/wry/pull/712)) on 2022-09-30 +- Support cross compiling ios on a non macos host. + - [cd08410](https://github.com/tauri-apps/wry/commit/cd08410bce326c42e8fc25a74290d254468724fe) Fix cross compilation. ([#731](https://github.com/tauri-apps/wry/pull/731)) on 2022-10-29 +- On Linux, Improve custom protocol with http headers / method added to request, and status code / http headers added to response. This feature is 2.36 only, version below it will fallback to previous implementation. + - [2944d91](https://github.com/tauri-apps/wry/commit/2944d91c763ff105288aa6c1370ba42a54fa8caf) feat(linux): add headers to URL scheme request ([#721](https://github.com/tauri-apps/wry/pull/721)) on 2022-10-17 +- On macOS, add WKWebview as subview of existing NSView directly. + - [008eca8](https://github.com/tauri-apps/wry/commit/008eca871155f393e5de1053bb1a9f63e1eafe82) On macOS, add WKWebview as subview of existing NSView directly ([#745](https://github.com/tauri-apps/wry/pull/745)) on 2022-11-07 +- Keypress on non-input element no longer triggers unsupported key feedback sound. + - [51c7f12](https://github.com/tauri-apps/wry/commit/51c7f12d80e2b51a188fb644a323abaf5df1b3d1) fix(macos): do not trigger unsupported key feedback sound on keypress ([#742](https://github.com/tauri-apps/wry/pull/742)) on 2022-10-30 +- Remove the IPC script message handler when the WebView is dropped on macOS. + - [818ce99](https://github.com/tauri-apps/wry/commit/818ce9989d816bf970ebcf93009b2d693384e436) fix: don't panic on invalid uri ([#712](https://github.com/tauri-apps/wry/pull/712)) on 2022-09-30 +- **Breaking change** Removed http error variants from `wry::Error` and replaced with generic `HttpError` variant that can be used to convert `http` crate errors. + - [1510e45](https://github.com/tauri-apps/wry/commit/1510e452547a95af2e42ff5199640877beecdbd7) refactor: use `http` crate primitives instead of a custom impl ([#706](https://github.com/tauri-apps/wry/pull/706)) on 2022-09-29 +- Disabled Microsoft SmartScreen by default on Windows. + - [a617c5b](https://github.com/tauri-apps/wry/commit/a617c5b29da3d173d43aa814106e1c7ace08d27f) feat(webview2): disable smartscreen & allow disabling internal webview2 args, closes [#704](https://github.com/tauri-apps/wry/pull/704) ([#705](https://github.com/tauri-apps/wry/pull/705)) on 2022-09-28 +- Add `WebView::url` to get the current url. + - [38e49bd](https://github.com/tauri-apps/wry/commit/38e49bd5f1e26e9f9507d1f2af8b0b290aa515ad) feat: add `WebView::url()` to access the current url ([#732](https://github.com/tauri-apps/wry/pull/732)) on 2022-10-25 +- **Breaking change** Removed `http` module and replaced with re-export of `http` crate. + - [1510e45](https://github.com/tauri-apps/wry/commit/1510e452547a95af2e42ff5199640877beecdbd7) refactor: use `http` crate primitives instead of a custom impl ([#706](https://github.com/tauri-apps/wry/pull/706)) on 2022-09-29 +- Add `WebviewBuilderExtWindows::with_additionl_browser_args` method to pass additional browser args to Webview2 On Windows. By default wry passes `--disable-features=msWebOOUI,msPdfOOUI,msSmartScreenProtection` so if you use this method, you also need to disable these components by yourself if you want. + - [683f866](https://github.com/tauri-apps/wry/commit/683f86665366bb333cb03e05a503a69d0f8eb734) feat(webview2): add method to pass additional args, closes [#415](https://github.com/tauri-apps/wry/pull/415) ([#711](https://github.com/tauri-apps/wry/pull/711)) on 2022-09-29 +- On Windows, fix canonical reason for custom protocol response. + - [9d5595c](https://github.com/tauri-apps/wry/commit/9d5595c9c723b3f8046d9582ac086ccebf460a83) fix(webview2): set response reason correctly, closes [#733](https://github.com/tauri-apps/wry/pull/733) ([#734](https://github.com/tauri-apps/wry/pull/734)) on 2022-10-24 +- On macOS, make the webview first responder. + - [e64ad21](https://github.com/tauri-apps/wry/commit/e64ad21ad5ab9bf0b7fb15aec0065c20b61a5a80) fix(wkwebview): make webview first responder ([#740](https://github.com/tauri-apps/wry/pull/740)) on 2022-10-28 + +## \[0.21.1] + +- Fix transparency on Windows + - [e31cd0a](https://github.com/tauri-apps/wry/commit/e31cd0adf4ba881a35dcccd9b5ee78bb5af8828a) fix: fix transparency on Windows, closes [#692](https://github.com/tauri-apps/wry/pull/692) on 2022-09-16 + +## \[0.21.0] + +- Implement `` on Android. + - [bf39d9d](https://github.com/tauri-apps/wry/commit/bf39d9de1e997170e9efb3bb7392710b57c2ae1f) feat(android): implement dialogs and permissions ([#685](https://github.com/tauri-apps/wry/pull/685)) on 2022-09-05 +- Add `WebviewExtAndroid::handle` which can be used to execute some code using JNI context. + - [2bfc6c3](https://github.com/tauri-apps/wry/commit/2bfc6c3d2e0cc6c3922d125f678ab30c00b89483) feat(android): JNI execution handle ([#689](https://github.com/tauri-apps/wry/pull/689)) on 2022-09-07 +- Enable JS alert, confirm, prompt on Android. + - [bf39d9d](https://github.com/tauri-apps/wry/commit/bf39d9de1e997170e9efb3bb7392710b57c2ae1f) feat(android): implement dialogs and permissions ([#685](https://github.com/tauri-apps/wry/pull/685)) on 2022-09-05 +- Prompt for permissions on Android when needed. + - [bf39d9d](https://github.com/tauri-apps/wry/commit/bf39d9de1e997170e9efb3bb7392710b57c2ae1f) feat(android): implement dialogs and permissions ([#685](https://github.com/tauri-apps/wry/pull/685)) on 2022-09-05 +- Implement `webview_version` on Android. + - [9183de4](https://github.com/tauri-apps/wry/commit/9183de4f9d3129e7cba332eebca2afc846f727d0) feat(android): implement webview_version ([#687](https://github.com/tauri-apps/wry/pull/687)) on 2022-09-05 +- Enable storage, geolocation, media playback, `window.open`. + - [9dfffcf](https://github.com/tauri-apps/wry/commit/9dfffcfe12199d7f28bf4b8a837e28253958ac17) feat(android): enable storage, geolocation, media playback, window.open ([#684](https://github.com/tauri-apps/wry/pull/684)) on 2022-09-04 +- Improve Android initialization script implementation. + - [1b26d60](https://github.com/tauri-apps/wry/commit/1b26d605d6e33f5417eb6566a7381d8feb239c8b) feat(android): improve initialization scripts implementation ([#670](https://github.com/tauri-apps/wry/pull/670)) on 2022-08-24 +- WRY will now generate the needed kotlin files at build time but you need to set `WRY_ANDROID_REVERSED_DOMAIN`, `WRY_ANDROID_APP_NAME_SNAKE_CASE` and `WRY_ANDROID_KOTLIN_FILES_OUT_DIR` env vars. + - [b478903](https://github.com/tauri-apps/wry/commit/b4789034dc4d10ab83f6acce6b4152d79f702940) feat(android): generate kotlin files at build time ([#671](https://github.com/tauri-apps/wry/pull/671)) on 2022-08-24 + - [103f255](https://github.com/tauri-apps/wry/commit/103f255903bdf728bf5124fb323293d172c8dd12) chore: change bump to patch on 2022-08-25 +- **Breaking change** Removed `WebView::focus`. + - [f338df7](https://github.com/tauri-apps/wry/commit/f338df7a2716cbbde357b81d9baa108ce679eaa5) feat(windows): auto-focus the webview ([#676](https://github.com/tauri-apps/wry/pull/676)) on 2022-08-27 +- Updated tao to `0.14` + - [483bad0](https://github.com/tauri-apps/wry/commit/483bad0fc7e7564500f7183547c15604fa387258) feat: tao as window dependency ([#230](https://github.com/tauri-apps/wry/pull/230)) on 2021-05-03 + - [51430e9](https://github.com/tauri-apps/wry/commit/51430e97dfb6589c5ff71e5078438be67293d044) publish new versions ([#221](https://github.com/tauri-apps/wry/pull/221)) on 2021-05-09 + - [0cf0089](https://github.com/tauri-apps/wry/commit/0cf0089b6d49aa9e1a8c791ec8883fce48a0dfd1) Update tao to v0.2.6 ([#271](https://github.com/tauri-apps/wry/pull/271)) on 2021-05-18 + - [a76206c](https://github.com/tauri-apps/wry/commit/a76206c11fa0a4ba1d041aa0f25452dd80941ee9) publish new versions ([#272](https://github.com/tauri-apps/wry/pull/272)) on 2021-05-18 + - [3c4f8b8](https://github.com/tauri-apps/wry/commit/3c4f8b8b2bd42e7634b889aa5317d909bfce593c) Update tao to v0.5 ([#365](https://github.com/tauri-apps/wry/pull/365)) on 2021-08-09 + - [44aa1dc](https://github.com/tauri-apps/wry/commit/44aa1dc8fcc20cc5826697d69f763118d45f724a) publish new versions ([#351](https://github.com/tauri-apps/wry/pull/351)) on 2021-08-09 + - [935cc5f](https://github.com/tauri-apps/wry/commit/935cc5fe8b73055279dc107e71a10f2701ea8b3d) Update tao to 0.13 ([#642](https://github.com/tauri-apps/wry/pull/642)) on 2022-07-27 + - [657888a](https://github.com/tauri-apps/wry/commit/657888aac13830d97d2970bdf1c87319dadb2ffa) Publish New Versions ([#632](https://github.com/tauri-apps/wry/pull/632)) on 2022-07-27 + - [3a91376](https://github.com/tauri-apps/wry/commit/3a91376fa2c04783a32804e6f123722749ad595e) chore(deps): update tao to 0.14 ([#691](https://github.com/tauri-apps/wry/pull/691)) on 2022-09-13 +- Allow setting the webview background color. + - [eb1b723](https://github.com/tauri-apps/wry/commit/eb1b7234f731759b5e091f7c88ac18ce4b507017) feat: allow setting webview bg color, closes [#197](https://github.com/tauri-apps/wry/pull/197) ([#682](https://github.com/tauri-apps/wry/pull/682)) on 2022-09-05 +- Added the `RustWebView` class on Android. + - [b1e8560](https://github.com/tauri-apps/wry/commit/b1e8560c3f13f2674528f6ca440ba476ddbef7c2) feat(android): define WebView class in kotlin ([#672](https://github.com/tauri-apps/wry/pull/672)) on 2022-08-24 +- Update the `windows` crate to the latest 0.39.0 release and `webview2-com` to 0.19.1 to match. + - [c7d7e1f](https://github.com/tauri-apps/wry/commit/c7d7e1f9c85a5db9c98aa5ded1e0eaf7fe697817) Update windows to 0.39.0 and webview2-com to 0.19.1 to match ([#679](https://github.com/tauri-apps/wry/pull/679)) on 2022-08-31 +- On Windows, automatically focus the webview when the window gains focus to match other platforms. + - [f338df7](https://github.com/tauri-apps/wry/commit/f338df7a2716cbbde357b81d9baa108ce679eaa5) feat(windows): auto-focus the webview ([#676](https://github.com/tauri-apps/wry/pull/676)) on 2022-08-27 + +## \[0.20.2] + +- Implement custom protocol on Android. + - [dc68289](https://github.com/tauri-apps/wry/commit/dc68289169196419b8c9cda73c73b139ea1301f9) feat(android): implement custom protocol ([#656](https://github.com/tauri-apps/wry/pull/656)) on 2022-08-13 +- Implement `WebView::eval` on Android. + - [690fd26](https://github.com/tauri-apps/wry/commit/690fd26a3b9bd47f9d7b1b5d2aa3dcb1c018a771) feat(android): implement eval ([#658](https://github.com/tauri-apps/wry/pull/658)) on 2022-08-13 +- On iOS, add webview as subview instead of replacing original view. + - [74391e0](https://github.com/tauri-apps/wry/commit/74391e0769d0e0f4be015147ddfa39bf25c90928) fix(ios): addSubview instead of setContentView ([#655](https://github.com/tauri-apps/wry/pull/655)) on 2022-08-13 +- Move WebView logic from tao to wry. + - [aba1ae5](https://github.com/tauri-apps/wry/commit/aba1ae5afcf96c88b1215ef66f38a5a635ecf7c3) refactor(android): move WebView logic from tao to wry ([#659](https://github.com/tauri-apps/wry/pull/659)) on 2022-08-14 + +## \[0.20.1] + +- Add android support + - [3218091](https://github.com/tauri-apps/wry/commit/3218091aa393dca9451840d3baa44bc9371f2e1d) Add real android support [#577](https://github.com/tauri-apps/wry/pull/577) +- Enable private picture-in-picture on macos. + - [3cfd8c9](https://github.com/tauri-apps/wry/commit/3cfd8c9e7a43f6c35a1ea61358521bd62fc70633) fix: add feature flag to enable private picture-in-picture flag on macos ([#645](https://github.com/tauri-apps/wry/pull/645)) on 2022-08-05 +- On macOS, fix devtool warning + - [2eba8c9](https://github.com/tauri-apps/wry/commit/2eba8c9c26ff5f9512b0039ac04bc7fd27a5256f) fix: devtool warning by adding parent view + +## \[0.20.0] + +- Add `WebViewBuilder::with_clipboard`. + - [c798700](https://github.com/tauri-apps/wry/commit/c7987004eaaf5cb7da830d574d81bd96dace0112) fix: Add `WebViewBuilder::with_clipboard`([#631](https://github.com/tauri-apps/wry/pull/631)) on 2022-07-05 +- Fix typos in several files. + - [4466250](https://github.com/tauri-apps/wry/commit/44662506ab01846c7e8767eb2f13bf0bbca7fe9a) Fix typos ([#635](https://github.com/tauri-apps/wry/pull/635)) on 2022-07-11 +- Set webview2 language to match the OS language. This makes i18n functions like `new Date().toLocaleStrin()` behave correctly. + - [e9f04d7](https://github.com/tauri-apps/wry/commit/e9f04d7e7bea576d0283d97e25faf7b356c5e959) fix: set system language to webview on windows, closes [#442](https://github.com/tauri-apps/wry/pull/442) ([#640](https://github.com/tauri-apps/wry/pull/640)) on 2022-07-26 +- Update tao to 0.13.0. + - [935cc5f](https://github.com/tauri-apps/wry/commit/935cc5fe8b73055279dc107e71a10f2701ea8b3d) Update tao to 0.13 ([#642](https://github.com/tauri-apps/wry/pull/642)) on 2022-07-27 + +## \[0.19.0] + +- - Automatically resize the webview on Windows to align with other platforms. +- **Breaking change**: Removed `WebView::resize` +- [d7c9097](https://github.com/tauri-apps/wry/commit/d7c9097256d76de7400032cf27acd7a1874da5cd) feat: auto resize webview on Windows ([#628](https://github.com/tauri-apps/wry/pull/628)) on 2022-06-27 +- Implement new window requested handler + - [fa5456c](https://github.com/tauri-apps/wry/commit/fa5456c6abe16be17073e75f4a0205966be266b2) feat: Implement new window requested event, closes [#527](https://github.com/tauri-apps/wry/pull/527) ([#526](https://github.com/tauri-apps/wry/pull/526)) on 2022-06-19 +- Re-export `url::Url`. + - [0cb6961](https://github.com/tauri-apps/wry/commit/0cb696119b5e25292af9595fd89856116520c049) fix: re-export `url::Url` ([#612](https://github.com/tauri-apps/wry/pull/612)) on 2022-06-17 +- Update tao to 0.12 + - [448837e](https://github.com/tauri-apps/wry/commit/448837e795a8f7f8dc4ac5f34b27063b108fc1f2) Update tao to 0.12 ([#629](https://github.com/tauri-apps/wry/pull/629)) on 2022-06-28 + +## \[0.18.3] + +- Update tao to 0.11 + - [f4b42fb](https://github.com/tauri-apps/wry/commit/f4b42fb412fa557188f20b72ef6c4314d1d6bb91) Update tao to v0.12 ([#609](https://github.com/tauri-apps/wry/pull/609)) on 2022-06-15 + +## \[0.18.2] + +- Fix NSString can not be released. + - [95ca52f](https://github.com/tauri-apps/wry/commit/95ca52f5d8ca86b64f8587a0f96cf0fb7dc22125) fix: NSString isn't released ([#604](https://github.com/tauri-apps/wry/pull/604)) on 2022-06-07 + +## \[0.18.1] + +- Remove unused tray from doc features. + - [5eecb00](https://github.com/tauri-apps/wry/commit/5eecb0074397efa40351b3caa8fd4a6d972c4c85) Remove unused tray from doc features ([#602](https://github.com/tauri-apps/wry/pull/602)) on 2022-05-31 + +## \[0.18.0] + +- Remove trivial tray features. + - [a3fea48](https://github.com/tauri-apps/wry/commit/a3fea48d2d78ebe4fa3f08b40d2c3c8c8135bb12) Remove trivial tray features ([#599](https://github.com/tauri-apps/wry/pull/599)) on 2022-05-31 + +## \[0.17.0] + +- Add option to enable/disable zoom shortcuts for WebView2, disabled by default. + - [494a110](https://github.com/tauri-apps/wry/commit/494a11057f9ddd2bf4bcecdc96b43ed95c5bd08e) WebView2: Enable/disable platform default zooming shortcuts, closes [#569](https://github.com/tauri-apps/wry/pull/569) ([#574](https://github.com/tauri-apps/wry/pull/574)) on 2022-05-15 +- Prevent memory leak on macOS. + - [16d1924](https://github.com/tauri-apps/wry/commit/16d192450ed639f94cf8b7137fa5fea1a319f8b5) fix: prevent memory leak on macOS, closes [#536](https://github.com/tauri-apps/wry/pull/536) ([#587](https://github.com/tauri-apps/wry/pull/587)) on 2022-05-20 +- Update the `windows` crate to the latest 0.37.0 release and `webview2-com` to 0.16.0 to match. + +The `#[implement]` macro in `windows-implement` and the `implement` feature in `windows` depend on some `const` generic features which stabilized in `rustc` 1.61. The MSRV on Windows targets is effectively 1.61, but other targets do not require these features. + +The `webview2-com` crate specifies `rust-version = "1.61"`, so `wry` will inherit that MSRV and developers on Windows should get a clear error message telling them to update their toolchain when building `wry` or anything that depends on `wry`. Developers targeting other platforms should be able to continue using whatever toolchain they were using before. + +- [9d9d9d8](https://github.com/tauri-apps/wry/commit/9d9d9d8f3d37a283bbb707d39c3aac090325a63e) Update windows-rs to 0.37.0 and webview2-com to 0.16.0 to match ([#592](https://github.com/tauri-apps/wry/pull/592)) on 2022-05-23 + +## \[0.16.2] + +- Fixed build on macos. + - [17ab12d](https://github.com/tauri-apps/wry/commit/17ab12ded27949474f687640faebb5cc376327c5) fix: fix build on macos, closes [#580](https://github.com/tauri-apps/wry/pull/580) ([#581](https://github.com/tauri-apps/wry/pull/581)) on 2022-05-10 + +## \[0.16.1] + +- Fixes a crash on macOS below Big Sur due to `titlebarSeparatorStyle` (11+ API) usage. + - [eb2dddb](https://github.com/tauri-apps/wry/commit/eb2dddb611f7fadf35bf7d7c32cb6d054da9fe9e) fix(macos): only use APIs when supported on 2022-05-08 +- Only run `WebView::print` on macOS on v11+. This prevents a crash on older versions. + - [eb2dddb](https://github.com/tauri-apps/wry/commit/eb2dddb611f7fadf35bf7d7c32cb6d054da9fe9e) fix(macos): only use APIs when supported on 2022-05-08 + +## \[0.16.0] + +- Fixes a typo in the `WebviewExtMacOS` conditional compilation. + - [10d7f03](https://github.com/tauri-apps/wry/commit/10d7f03f403e9c373fe80897308393e0bb67a06d) fix(macos): typo in the WebviewExtMacOS conditional compilation ([#568](https://github.com/tauri-apps/wry/pull/568)) on 2022-05-02 +- Fixes a crash when the custom protocol response is empty on macOS. + - [67809f4](https://github.com/tauri-apps/wry/commit/67809f4d8abe1a042b2cdb616b03f6a2c50652b8) fix(macos): crash when custom protocol response is empty ([#567](https://github.com/tauri-apps/wry/pull/567)) on 2022-05-01 +- Add `WebView::zoom` method. + - [34b6cbc](https://github.com/tauri-apps/wry/commit/34b6cbca76811966cedf8050ae0d0fa18c84aa34) feat: add feature to zoom webview contents, closes [#388](https://github.com/tauri-apps/wry/pull/388) ([#564](https://github.com/tauri-apps/wry/pull/564)) on 2022-05-02 +- Set the titlebar separator style in macOS to `none`. + - [9776fc4](https://github.com/tauri-apps/wry/commit/9776fc466b5f3a6ef47956ec5c9cdd9c5164046a) fix(macos): set titlebar style to `none` ([#566](https://github.com/tauri-apps/wry/pull/566)) on 2022-05-01 +- Disable webview2 mini menu + - [ed0b223](https://github.com/tauri-apps/wry/commit/ed0b2230c285991b7a4588c8045111f04a67a16f) fix: disable WebView2 mini menu ("OOUI"), closes [#535](https://github.com/tauri-apps/wry/pull/535) ([#559](https://github.com/tauri-apps/wry/pull/559)) on 2022-04-29 + +## \[0.15.1] + +- Update how android handles url + - [427cf92](https://github.com/tauri-apps/wry/commit/427cf9222d7152f911aa70eb778eb7aa90c83fac) Unify custom protocol across Android/iOS ([#546](https://github.com/tauri-apps/wry/pull/546)) on 2022-04-11 +- Add devtools support on Android/iOS. + - [1c5d77a](https://github.com/tauri-apps/wry/commit/1c5d77a8ce79e75705a71c659af86541d50c5007) Add devtools support on Android/iOS ([#548](https://github.com/tauri-apps/wry/pull/548)) on 2022-04-11 +- Fix to reset process on MacOS when webview is closed, closes #536. + - [fd1dcc3](https://github.com/tauri-apps/wry/commit/fd1dcc3cc5a290bfe4ae8de04064074109902432) fix: reset background process when webview is closed, closes [#536](https://github.com/tauri-apps/wry/pull/536) ([#556](https://github.com/tauri-apps/wry/pull/556)) on 2022-04-24 + +## \[0.15.0] + +- On Windows and Linux, disable resizing maximized borderless windows. + - [313eaea](https://github.com/tauri-apps/wry/commit/313eaea0ff123bddbc8b5c337ded05d464d3dfaa) fix(win,linux): disable resizing maximized borderless windows ([#533](https://github.com/tauri-apps/wry/pull/533)) on 2022-03-30 +- Fixes a memory leak on the custom protocol response body on macOS. + - [36b985e](https://github.com/tauri-apps/wry/commit/36b985e939f4769f9835b4865ee1013229ec7539) fix(macos): custom protocol memory leak ([#539](https://github.com/tauri-apps/wry/pull/539)) on 2022-04-03 +- Update tao to v0.8.0. + - [1c540b0](https://github.com/tauri-apps/wry/commit/1c540b01fa08e84c199b8ded726b6ec77b40f015) feat: update tao to 0.8, refactor tray features ([#541](https://github.com/tauri-apps/wry/pull/541)) on 2022-04-07 +- The `tray` and `ayatana-tray` Cargo features are not enabled by default. + - [1c540b0](https://github.com/tauri-apps/wry/commit/1c540b01fa08e84c199b8ded726b6ec77b40f015) feat: update tao to 0.8, refactor tray features ([#541](https://github.com/tauri-apps/wry/pull/541)) on 2022-04-07 +- **Breaking change:** Renamed the `ayatana` Cargo feature to `ayatana-tray` and added the `gtk-tray` feature. The default tray on Linux is now `libayatana-appindicator`. + - [1c540b0](https://github.com/tauri-apps/wry/commit/1c540b01fa08e84c199b8ded726b6ec77b40f015) feat: update tao to 0.8, refactor tray features ([#541](https://github.com/tauri-apps/wry/pull/541)) on 2022-04-07 + +## \[0.14.0] + +- Added `close_devtools` function to `Webview`. + - [bf3b710](https://github.com/tauri-apps/wry/commit/bf3b7107631f14567b0b5ff1947c2bff1ffa2603) feat: add function to close the devtool and check if it is opened ([#529](https://github.com/tauri-apps/wry/pull/529)) on 2022-03-28 +- Hide the devtool functions behind the `any(debug_assertions, feature = "devtools")` flag. + - [bf3b710](https://github.com/tauri-apps/wry/commit/bf3b7107631f14567b0b5ff1947c2bff1ffa2603) feat: add function to close the devtool and check if it is opened ([#529](https://github.com/tauri-apps/wry/pull/529)) on 2022-03-28 +- **Breaking change:** Renamed the `devtool` function to `open_devtools`. + - [bf3b710](https://github.com/tauri-apps/wry/commit/bf3b7107631f14567b0b5ff1947c2bff1ffa2603) feat: add function to close the devtool and check if it is opened ([#529](https://github.com/tauri-apps/wry/pull/529)) on 2022-03-28 +- Enable tab navigation on macOS. + - [28ebedc](https://github.com/tauri-apps/wry/commit/28ebedc41f9017fed3fe1dc3a6d021c69f88ef5d) fix(macOS): enable tab navigation on all elements, fixes [#406](https://github.com/tauri-apps/wry/pull/406) ([#512](https://github.com/tauri-apps/wry/pull/512)) on 2022-03-03 +- Added `is_devtools_open` function to `Webview`. + - [bf3b710](https://github.com/tauri-apps/wry/commit/bf3b7107631f14567b0b5ff1947c2bff1ffa2603) feat: add function to close the devtool and check if it is opened ([#529](https://github.com/tauri-apps/wry/pull/529)) on 2022-03-28 +- - Expose methods to access the underlying native handles of the webview. +- **Breaking change**: `WebviewExtWindows::controller` now returns the controller directly and not wrapped in an `Option` +- [e54afec](https://github.com/tauri-apps/wry/commit/e54afec43b767ffdb43debbd526d249c3c5b5490) feat: expose webview native handles, closes [#495](https://github.com/tauri-apps/wry/pull/495) ([#513](https://github.com/tauri-apps/wry/pull/513)) on 2022-03-03 +- Add navigation handler to decide if an url is allowed to navigate. + - [aa8af02](https://github.com/tauri-apps/wry/commit/aa8af020ab9d88ad762f2facbfa368effb04f570) feat: Implement navigation event and cancellation, closes [#456](https://github.com/tauri-apps/wry/pull/456) ([#519](https://github.com/tauri-apps/wry/pull/519)) on 2022-03-18 +- **Breaking change**: Renamed the `devtool` feature to `devtools`. + - [bf3b710](https://github.com/tauri-apps/wry/commit/bf3b7107631f14567b0b5ff1947c2bff1ffa2603) feat: add function to close the devtool and check if it is opened ([#529](https://github.com/tauri-apps/wry/pull/529)) on 2022-03-28 +- **Breaking change:** Renamed the `with_dev_tool` function to `with_devtools`. + - [bf3b710](https://github.com/tauri-apps/wry/commit/bf3b7107631f14567b0b5ff1947c2bff1ffa2603) feat: add function to close the devtool and check if it is opened ([#529](https://github.com/tauri-apps/wry/pull/529)) on 2022-03-28 + +## \[0.13.3] + +- Fix rustdoc generation of Windows and Mac on docs.rs. + - [327a019](https://github.com/tauri-apps/wry/commit/327a019a07fd10ca3a42ebfb8d9d626e3b91fd05) Fix rustdoc generation of Windows and Mac on docs.rs, fix [#503](https://github.com/tauri-apps/wry/pull/503) ([#507](https://github.com/tauri-apps/wry/pull/507)) on 2022-02-27 + +## \[0.13.2] + +- Fix cross compilation from `macOS`. + - [c97499f](https://github.com/tauri-apps/wry/commit/c97499fb078c7c65508bf2fa3502ef95c8114ef4) fix: cross compilation from macOS ([#498](https://github.com/tauri-apps/wry/pull/498)) on 2022-02-15 +- Update `webview2-com` to 0.13.0, which bumps the WebView2 SDK to 1.0.1108.44 and improves cross-compilation support. + +Targeting \*-pc-windows-gnu works now, but it has some [limitations](https://github.com/wravery/webview2-rs#cross-compilation). + +- [24a443c](https://github.com/tauri-apps/wry/commit/24a443ca1d90ef091eaceb0ec61bcc648499b743) Add /.changes/webview2-com-0.13.0.md on 2022-02-14 + +## \[0.13.1] + +- Add `devtool` feature flag and configuration option. + - [d0f307b](https://github.com/tauri-apps/wry/commit/d0f307b218c3913520efbb378e9c01a526137fdd) feat: implement `devtools` API, closes [#287](https://github.com/tauri-apps/wry/pull/287) ([#486](https://github.com/tauri-apps/wry/pull/486)) on 2022-02-07 + +- Update the `webview2-com` crate 0.11.0: + +- Fix silent build script errors related to unconfigured nuget in https://github.com/wravery/webview2-rs/pull/4 + +- Update the WebView2 SDK (not the runtime, just the API bindings) to the latest 1.0.1072.54 version + +- [7d4eeb7](https://github.com/tauri-apps/wry/commit/7d4eeb744bf008e43c034e865b383ee4a330e77a) Update webview2-com to 0.11.0 ([#488](https://github.com/tauri-apps/wry/pull/488)) on 2022-02-06 + +## \[0.13.0] + +- Update gtk to 0.15 + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- Add clipboard field in WebViewAttributes. + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- Ignore transparency on Windows 7 to prevent application crash. + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- Remove clipboard property for consistency across platforms. + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- Enable cookie persistence on Linux if the `data_directory` is provided. + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- Enable objc's exception features so they can be treated as panic message. + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- Add inner size method for webview. This can reflect correct size of webview on macOS. + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- Add "transparent" and "fullscreen" feature flags on macOS to toggle private API. + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- Implement WebContextImpl on mac to extend several callback lifetimes. + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- The only thing that private mod shared does is re-export http mod to public, + we can just pub mod http. + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- - Fix hovering over an edge of undecorated window on Linux won't change cursor. +- Undecorated window can be resized using touch on Linux. +- [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- Update webkit2gtk to 0.15 + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- Add `with_user_agent(&str)` to `WebViewBuilder`. + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- Replace all of the `winapi` crate references with the `windows` crate, and replace `webview2` and `webview2-sys` with `webview2-com` and `webview2-com-sys` built with the `windows` crate. The replacement bindings are in the `webview2-com-sys` crate, with `pub use` in the `webview2-com` crate. They can be shared with TAO. + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- Fix null pointer crash on `get_content` of web resource request. This is a temporary fix. + We will switch it back once upstream is updated. + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- Update the `windows` crate to 0.25.0, which comes with pre-built libraries. WRY and Tao can both reference the same types directly from the `windows` crate instead of sharing bindings in `webview2-com-sys`. + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- Update the `windows` crate to 0.29.0 and `webview2-com` to 0.9.0. + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 +- Update the `windows` crate to 0.30.0 and `webview2-com` to 0.10.0. + - [219d20c](https://github.com/tauri-apps/wry/commit/219d20ce66a6bdf6c3e1af6156c9f2a74f2eed29) Merge next back to dev branch ([#477](https://github.com/tauri-apps/wry/pull/477)) on 2022-02-05 + +## \[0.12.2] + +- Fixed a Linux multi-window issue where the internal url loader didn't unlock when flushed while empty + - [5377821](https://github.com/tauri-apps/wry/commit/5377821f43c0e7556ec46f0aaf4d6b0637512493) Fix async multiwindow deadlock ([#382](https://github.com/tauri-apps/wry/pull/382)) on 2021-08-16 + +- The custom protocol now returns a `Request` and expects a `Response`. + +- This allows us to get the complete request from the Webview. (Method, GET, POST, PUT etc..) + Read the complete header. + +- And allow us to be more flexible in the future without bringing breaking changes. + +- [d202573](https://github.com/tauri-apps/wry/commit/d202573c2c68a2ff0411c1aa797ecc10f727e93b) refactor: Custom protocol request/response ([#387](https://github.com/tauri-apps/wry/pull/387)) on 2021-08-22 + +- On Linux, automation callbacks now use the first created webview as the return value + - [f9d7049](https://github.com/tauri-apps/wry/commit/f9d7049978bbad389c99d7a7cce9903a528d871d) Use the first created webview for webkit2gtk automation callbacks ([#383](https://github.com/tauri-apps/wry/pull/383)) on 2021-08-16 + +## \[0.12.1] + +- Add html attributes as another method to load the page. This can provide some other origin header and make CORS request + possible. + - [02ad372](https://github.com/tauri-apps/wry/commit/02ad37219a1f6e5e6ed8e4da61e6a5ac021d410e) feat: html string attributes ([#368](https://github.com/tauri-apps/wry/pull/368)) on 2021-08-12 +- Shorter protocol name on Windows. This can make origin be shorter too. + - [2d9f5c9](https://github.com/tauri-apps/wry/commit/2d9f5c95e3805911d12803122fd1e83be758a769) Shorter protocol name on Windows ([#367](https://github.com/tauri-apps/wry/pull/367)) on 2021-08-12 + +## \[0.12.0] + +- Custom Protocol handlers no longer take a `&Window` parameter. + - [0e2574c](https://github.com/tauri-apps/wry/commit/0e2574c420f778c59bafc164ddee2bc0b7705ee9) Remove `&Window` parameter from Custom Protocol handlers ([#361](https://github.com/tauri-apps/wry/pull/361)) on 2021-07-28 +- Update gtk to version 0.14. This also remove requirement of `clang`. + - [251a80b](https://github.com/tauri-apps/wry/commit/251a80bab49d42f742a3ae6b3ca2cbfc97de98bb) Update gtk to version 0.14 ([#364](https://github.com/tauri-apps/wry/pull/364)) on 2021-08-06 +- Update tao to v0.5. Please see release notes on tao for more information. + - [483bad0](https://github.com/tauri-apps/wry/commit/483bad0fc7e7564500f7183547c15604fa387258) feat: tao as window dependency ([#230](https://github.com/tauri-apps/wry/pull/230)) on 2021-05-03 + - [51430e9](https://github.com/tauri-apps/wry/commit/51430e97dfb6589c5ff71e5078438be67293d044) publish new versions ([#221](https://github.com/tauri-apps/wry/pull/221)) on 2021-05-09 + - [0cf0089](https://github.com/tauri-apps/wry/commit/0cf0089b6d49aa9e1a8c791ec8883fce48a0dfd1) Update tao to v0.2.6 ([#271](https://github.com/tauri-apps/wry/pull/271)) on 2021-05-18 + - [a76206c](https://github.com/tauri-apps/wry/commit/a76206c11fa0a4ba1d041aa0f25452dd80941ee9) publish new versions ([#272](https://github.com/tauri-apps/wry/pull/272)) on 2021-05-18 + - [3c4f8b8](https://github.com/tauri-apps/wry/commit/3c4f8b8b2bd42e7634b889aa5317d909bfce593c) Update tao to v0.5 ([#365](https://github.com/tauri-apps/wry/pull/365)) on 2021-08-09 +- Add flags to support all other possible unix systems. + - [c0d0a78](https://github.com/tauri-apps/wry/commit/c0d0a78b893eecdc45c6cda71264020d6ae17bda) Add flags to support all other unix systems. ([#352](https://github.com/tauri-apps/wry/pull/352)) on 2021-07-21 +- Support having multiple webkit2gtk `WebView`s on a single `WebContext`. + - [3f03d6b](https://github.com/tauri-apps/wry/commit/3f03d6b5ea4e9ba81950245de156f09e72ab40a1) Support multiple webviews on a single WebContext (webkit2gtk) ([#359](https://github.com/tauri-apps/wry/pull/359)) on 2021-07-28 +- On Windows, Fix cursor flickering when Tao window is without decorations + - [e28bcce](https://github.com/tauri-apps/wry/commit/e28bcce0884937365013fda3098f64f9956d569f) fix(windows): fix mouse style flicker when `decorations: false` ([#350](https://github.com/tauri-apps/wry/pull/350)) on 2021-07-20 +- Remove winrt support since it's outdated for a long time. We will reimplement it again once `windws-rs` is stable! + - [c37973e](https://github.com/tauri-apps/wry/commit/c37973e47318e9cff2712eb4a394c07734f58d54) chore(windows): remove winrt support ([#356](https://github.com/tauri-apps/wry/pull/356)) on 2021-07-24 + +## \[0.11.0] + +- Allow resizing of borderless window on Windows + - [bd10b8e](https://github.com/tauri-apps/wry/commit/bd10b8e5fe517edd6234ed03170741f1a51768bf) feat(Windows): resize borderless window ([#333](https://github.com/tauri-apps/wry/pull/333)) on 2021-07-15 +- Mark enums as `#[non_exhaustive]` to prevent breaking changes on enum update. + - [f07ae14](https://github.com/tauri-apps/wry/commit/f07ae144197933c28f8302105b313c2a2afc62af) refactor: add `#[non_exhaustive]` attributes to enums ([#304](https://github.com/tauri-apps/wry/pull/304)) on 2021-07-08 +- Bump tao to `0.4`. Please refer to `tao` changelog for more details. + - [6eb10d4](https://github.com/tauri-apps/wry/commit/6eb10d4e10ce86c8403c80fb41ba5e37072dc61e) bump `tao` to 0.4 and fix examples ([#329](https://github.com/tauri-apps/wry/pull/329)) on 2021-07-14 +- - Add `focus` method to `Webview` +- Add `WebviewExtWindows` trait with `controller` method +- [621ed1f](https://github.com/tauri-apps/wry/commit/621ed1fff35d9389d88664d8084e1a678dfbfc36) feat: add `.focus()` to `Webview` ([#325](https://github.com/tauri-apps/wry/pull/325)) on 2021-07-05 +- [96b7b94](https://github.com/tauri-apps/wry/commit/96b7b943da34ab81872553e65d2f2cd138531a62) Add controller method instead ([#326](https://github.com/tauri-apps/wry/pull/326)) on 2021-07-07 +- macOS: Remove handler in the webview as it should be handled with the menu. + - [5a9df15](https://github.com/tauri-apps/wry/commit/5a9df156f04789d4c89fdb8edf72b301667df127) fix(macos): Remove keypress handler in the webview for copy/paste/cut ([#328](https://github.com/tauri-apps/wry/pull/328)) on 2021-07-07 +- Fixes multiple custom protocols registration on Windows. + - [923d346](https://github.com/tauri-apps/wry/commit/923d3461ce93846af8dd548d4e43ebd0fd6111a3) fix(windows): multiple custom protocols, closes [#323](https://github.com/tauri-apps/wry/pull/323) ([#324](https://github.com/tauri-apps/wry/pull/324)) on 2021-07-02 + +## \[0.10.3] + +- [#315](https://github.com/tauri-apps/wry/pull/315) fixed Webview2 runtime performance issues. + - [d3c9b16](https://github.com/tauri-apps/wry/commit/d3c9b169d81fd8b79e6695d91b3a1d0e8042a81f) Fix Webview2 runtime performance issues ([#316](https://github.com/tauri-apps/wry/pull/316)) on 2021-06-29 + +## \[0.10.2] + +- Fix file explorer getting blocked by automation. + - [0c5cdd8](https://github.com/tauri-apps/wry/commit/0c5cdd8f2a6f4d07d87c6c4d1c51540ff9abfd97) Fix file explorer getting blocked by automation ([#310](https://github.com/tauri-apps/wry/pull/310)) on 2021-06-23 + +## \[0.10.1] + +- `WebContext::set_allows_automation` is now available to specify if the context should allow automation (e.g. WebDriver). + It is only enforced on Linux, but may expand platforms in the future. + - [4ad0bf1](https://github.com/tauri-apps/wry/commit/4ad0bf12d186b3c313131060316aef371f45d455) move set_allows_automation to WebContext method ([#302](https://github.com/tauri-apps/wry/pull/302)) on 2021-06-21 + +## \[0.10.0] + +- Add WebViewAttributes + - [81f3218](https://github.com/tauri-apps/wry/commit/81f3218d9ac55a987b050f574774afcaa0b5c2f7) Add WebViewAttributes ([#286](https://github.com/tauri-apps/wry/pull/286)) on 2021-06-04 +- Add `with_web_context` method that can work well with builder pattern. + - [48f53a3](https://github.com/tauri-apps/wry/commit/48f53a3393b0c016a972a72dec45691959ac9e3b) Add `with_web_context` method ([#292](https://github.com/tauri-apps/wry/pull/292)) on 2021-06-13 +- Change the custom protocol handler on macOS so it returns a response on error and a status code on success. + - [6b869b1](https://github.com/tauri-apps/wry/commit/6b869b1ad5de9c8e9f36c1fc1b7040e10b033b52) fix(macos): custom protocol response with status code + error response ([#279](https://github.com/tauri-apps/wry/pull/279)) on 2021-05-20 +- Update signature of custom protocol closure. It should return a mime type string now. + - [cc9fc4b](https://github.com/tauri-apps/wry/commit/cc9fc4b43df79834c1b8f2c1347accba50356604) Add mimetype to return type of custom protocol ([#296](https://github.com/tauri-apps/wry/pull/296)) on 2021-06-13 +- Fix webview creation when using new_any_thread of event loop. + - [4d62cf5](https://github.com/tauri-apps/wry/commit/4d62cf5a3ddcbed06afb93d9503424a9b8110d57) Fix webview creation when using new_any_thread on Windows ([#298](https://github.com/tauri-apps/wry/pull/298)) on 2021-06-18 +- Remove `Dispatcher`, `dispatch_script` and `dispatcher` in the `webview` module and add a `js` parameter to `evaluate_script`. + - [de4a5fa](https://github.com/tauri-apps/wry/commit/de4a5fa820b1938532223677913e73720885cb54) refactor: remove `Dispatcher` and related methods, closes [#290](https://github.com/tauri-apps/wry/pull/290) ([#291](https://github.com/tauri-apps/wry/pull/291)) on 2021-06-09 +- Removes the `image` dependency. + - [1d5cc59](https://github.com/tauri-apps/wry/commit/1d5cc590856e1be1428f8516595ace6d8099f41f) chore(deps): remove `image` dependency ([#274](https://github.com/tauri-apps/wry/pull/274)) on 2021-05-19 +- Bump tao to `0.3` and add more examples. + +*For more details, please refer to `tao` changelog.* + +- [cd4697e](https://github.com/tauri-apps/wry/commit/cd4697ebdb8eb955f0ed2be4aefea82d2c263a52) bump `tao` to 0.3 with examples ([#294](https://github.com/tauri-apps/wry/pull/294)) on 2021-06-21 +- Add `wry::webview::WebContext`. It's now a required argument on `WebViewBuilder::build`. + - [761b2b5](https://github.com/tauri-apps/wry/commit/761b2b59fe0434b3458d99ed599394af0e1e3962) webdriver support ([#281](https://github.com/tauri-apps/wry/pull/281)) on 2021-06-08 + +## \[0.9.4] + +- Update tao to v0.2.6 + - [483bad0](https://github.com/tauri-apps/wry/commit/483bad0fc7e7564500f7183547c15604fa387258) feat: tao as window dependency ([#230](https://github.com/tauri-apps/wry/pull/230)) on 2021-05-03 + - [51430e9](https://github.com/tauri-apps/wry/commit/51430e97dfb6589c5ff71e5078438be67293d044) publish new versions ([#221](https://github.com/tauri-apps/wry/pull/221)) on 2021-05-09 + - [0cf0089](https://github.com/tauri-apps/wry/commit/0cf0089b6d49aa9e1a8c791ec8883fce48a0dfd1) Update tao to v0.2.6 ([#271](https://github.com/tauri-apps/wry/pull/271)) on 2021-05-18 + +## \[0.9.3] + +- Expose `webview_version` function in the `webview` module. + - [4df310e](https://github.com/tauri-apps/wry/commit/4df310e6bb508854ffc17ec915b3d0ab7c11f03d) feat: get webview version ([#259](https://github.com/tauri-apps/wry/pull/259)) on 2021-05-12 +- Add print method on Linux and Windows. + - [54c5ec7](https://github.com/tauri-apps/wry/commit/54c5ec7ae6166da5ce670ccd2ceaa108233bb845) Implement print method on Linux and Windows ([#264](https://github.com/tauri-apps/wry/pull/264)) on 2021-05-17 +- Disable smooth scrolling on Linux to match behaviour on browsers. + - [3e786bb](https://github.com/tauri-apps/wry/commit/3e786bb28793e939c00ebf0c6758d4f6cf4d3b28) Disable smooth scrolling on Linux ([#268](https://github.com/tauri-apps/wry/pull/268)) on 2021-05-17 + +## \[0.9.2] + +- Add `tray` feature flag from tao. + - [093c25e](https://github.com/tauri-apps/wry/commit/093c25ee68d51849b95a1a3b9341e5ad6021cecf) feat: expose tray feature flag ([#256](https://github.com/tauri-apps/wry/pull/256)) on 2021-05-10 + +## \[0.9.1] + +- Correctly set visibility when building `Window` on gtk-backend + - [4395ad1](https://github.com/tauri-apps/wry/commit/4395ad147b799e67f9802c499346d0ad53554317) fix: only call `show_all` when needed ([#227](https://github.com/tauri-apps/wry/pull/227)) on 2021-05-02 +- Fix `macOS` cursors and other minors UI glitch. + - [d550b2f](https://github.com/tauri-apps/wry/commit/d550b2f0a1c708747537e3a5e6d880fea00e651d) fix(macOS): Window layers ([#220](https://github.com/tauri-apps/wry/pull/220)) on 2021-04-28 +- Expose `print()` function to the webview. Work only on macOS for now. + - [5206db6](https://github.com/tauri-apps/wry/commit/5206db6ca599fe0e146d72b04c908330e3045838) fix(macOS): Printing ([#235](https://github.com/tauri-apps/wry/pull/235)) ([#236](https://github.com/tauri-apps/wry/pull/236)) on 2021-05-06 +- Fix macOS windows order for tray (statusbar) applications. + - [229275f](https://github.com/tauri-apps/wry/commit/229275f106371d79800e0ca1cbc7b6c1827bc2ac) fix: macOS windows order ([#242](https://github.com/tauri-apps/wry/pull/242)) on 2021-05-07 +- Add `request_redraw` method of `Window` on Linux + - [03abfa0](https://github.com/tauri-apps/wry/commit/03abfa06019a78a182c7cd29dc63bf3d9df10e44) Add request_redraw method on Linux ([#222](https://github.com/tauri-apps/wry/pull/222)) on 2021-04-30 +- Add tao as window dependency. + - [483bad0](https://github.com/tauri-apps/wry/commit/483bad0fc7e7564500f7183547c15604fa387258) feat: tao as window dependency ([#230](https://github.com/tauri-apps/wry/pull/230)) on 2021-05-03 +- Close the window when the instance is dropped on Linux and Windows. + - [3f2cc28](https://github.com/tauri-apps/wry/commit/3f2cc28b4fbfcf54c97000a6541e9356440838e8) fix: close window when the instance is dropped ([#228](https://github.com/tauri-apps/wry/pull/228)) on 2021-05-02 +- Remove winit dependency on Linux + - [fa15076](https://github.com/tauri-apps/wry/commit/fa15076207d9e678db4149210aba929044d0ff45) feat: winit interface for gtk ([#163](https://github.com/tauri-apps/wry/pull/163)) on 2021-04-19 + - [39d6f59](https://github.com/tauri-apps/wry/commit/39d6f595d81c857e92aef31cc2559b402e64edd3) publish new versions ([#166](https://github.com/tauri-apps/wry/pull/166)) on 2021-04-29 + - [4ef8330](https://github.com/tauri-apps/wry/commit/4ef8330d856e07d34bf86d1f2903c82c37042556) Remove winit dependency on Linux ([#226](https://github.com/tauri-apps/wry/pull/226)) on 2021-04-30 + +## \[0.9.0] + +- Refactor signatures of most closure types + - [b8823fe](https://github.com/tauri-apps/wry/commit/b8823fe14ee5f95d07cd2cb1f9f673b964c9dc83) refactor: signature of closure types ([#167](https://github.com/tauri-apps/wry/pull/167)) on 2021-04-19 +- Drop handler closures properly on macOS. + - [f905503](https://github.com/tauri-apps/wry/commit/f905503c4a010ed4219c6ad36d14c0dbf0b6e122) fix: [#160](https://github.com/tauri-apps/wry/pull/160) drop handler closures properly ([#211](https://github.com/tauri-apps/wry/pull/211)) on 2021-04-27 +- Fix `history.pushState` in webview2. + - [dd0fa46](https://github.com/tauri-apps/wry/commit/dd0fa46494c1ab8536bcc7ea1dd16341b12856b4) Use http instead of file for windows custom protocol workaround ([#173](https://github.com/tauri-apps/wry/pull/173)) on 2021-04-20 +- The `data_directory` field now affects the IndexedDB and LocalStorage directories on Linux. + - [1a6c821](https://github.com/tauri-apps/wry/commit/1a6c8216ee6865ca14025c229b37342496b38f26) feat(linux): implement custom user data path ([#188](https://github.com/tauri-apps/wry/pull/188)) on 2021-04-22 +- Fix runtime panic on macOS, when no file handler are defined. + - [22a4991](https://github.com/tauri-apps/wry/commit/22a4991aa8ca7c75aa52150a90379c40bcc34d07) bug(macOS): Runtime panic when no file_drop_handler ([#177](https://github.com/tauri-apps/wry/pull/177)) on 2021-04-20 +- Add position field on WindowAttribute + - [2b3be7a](https://github.com/tauri-apps/wry/commit/2b3be7a4db2cbc1612c7105cb698c1f21a05da77) Add position field on WindowAttribute ([#219](https://github.com/tauri-apps/wry/pull/219)) on 2021-04-28 +- Fix panic on multiple custom protocols registration. + - [01647a2](https://github.com/tauri-apps/wry/commit/01647a2a5b769bc192754c2d3806a55112d58d33) Fix custom protocol registry on mac ([#205](https://github.com/tauri-apps/wry/pull/205)) on 2021-04-26 +- Fix SVG render with the custom protocol. + - [890cfe5](https://github.com/tauri-apps/wry/commit/890cfe527996c181d643c9f8e5fc3e79ff0841a0) fix(custom-protocol): SVG mime type - close [#168](https://github.com/tauri-apps/wry/pull/168) ([#169](https://github.com/tauri-apps/wry/pull/169)) on 2021-04-19 +- Initial custom WindowExtWindows trait. + - [1ef1f58](https://github.com/tauri-apps/wry/commit/1ef1f58efb6afa6c6b9eda3a43ee83fc79c3b78e) feat: custom WindowExtWindow trait ([#191](https://github.com/tauri-apps/wry/pull/191)) on 2021-04-23 +- Fix transparency on Windows + - [e278556](https://github.com/tauri-apps/wry/commit/e2785566c69d43f003896b7b5da79b29d2966c13) fix: transparency on Windows ([#217](https://github.com/tauri-apps/wry/pull/217)) on 2021-04-28 +- Add platform module and WindowExtUnix trait on Linux + - [004e298](https://github.com/tauri-apps/wry/commit/004e298e0198e6576a11e6e84fdf6b7c2f66b6ae) feat: WindowExtUnix trait ([#192](https://github.com/tauri-apps/wry/pull/192)) on 2021-04-23 +- Make sure custom protocol on Windows is over HTTPS. + - [c36db35](https://github.com/tauri-apps/wry/commit/c36db35b2b8704eb36bc341cd99abac01abfab87) fix(custom-protocol): Make sure custom protocol on Windows is over HTTPS. ([#179](https://github.com/tauri-apps/wry/pull/179)) on 2021-04-20 +- Initial winit interface for gtk backend + - [fa15076](https://github.com/tauri-apps/wry/commit/fa15076207d9e678db4149210aba929044d0ff45) feat: winit interface for gtk ([#163](https://github.com/tauri-apps/wry/pull/163)) on 2021-04-19 + +## \[0.8.0] + +- Wry now accepts multiple custom protocol registrations. + - [db64fc6](https://github.com/tauri-apps/wry/commit/db64fc69c48a728184fcef001688b94f0294edab) feat/licenses ([#155](https://github.com/tauri-apps/wry/pull/155)) on 2021-04-14 +- Apply license header for SPDX compliance. + - [05e0218](https://github.com/tauri-apps/wry/commit/05e02180c9fe929d3e691185df44257654546935) feat: multiple custom protocols ([#151](https://github.com/tauri-apps/wry/pull/151)) on 2021-04-11 + - [db64fc6](https://github.com/tauri-apps/wry/commit/db64fc69c48a728184fcef001688b94f0294edab) feat/licenses ([#155](https://github.com/tauri-apps/wry/pull/155)) on 2021-04-14 +- Remove bindings crate and use windows-webview2 as dependency instead. + - [c2156a4](https://github.com/tauri-apps/wry/commit/c2156a45d7fbfead956b6d03b2594962e3455e6d) Move to windows-webview2 as dependency for winrt impl ([#144](https://github.com/tauri-apps/wry/pull/144)) on 2021-04-03 + +## \[0.7.0] + +- Add old win32 implementation on windows as default feature flag. + - [1a88cd2](https://github.com/tauri-apps/wry/commit/1a88cd267f2a29c1dd35d7197250972718081847) refactor: Add win32 implementation and feature flag for both backends ([#139](https://github.com/tauri-apps/wry/pull/139)) on 2021-04-02 +- Adds a `WindowProxy` to the file drop handler closure - `WindowFileDropHandler`. + - [20cb051](https://github.com/tauri-apps/wry/commit/20cb051aba28009c70dad838b2a9b1575cb5363a) feat: add WindowProxy to file drop handler closure ([#140](https://github.com/tauri-apps/wry/pull/140)) on 2021-04-01 + +## \[0.6.2] + +- Add pipe back to version check for covector config. This prevents the CI failure on publish if it exists already. The issue was patched in covector (and tests in place so it doesn't break in the future). + - [a32829c](https://github.com/tauri-apps/wry/commit/a32829c527f02b228fa1da45e9710941c5415bfc) chore: add pipe for publish check back in ([#131](https://github.com/tauri-apps/wry/pull/131)) on 2021-03-28 +- Fix messages to the webview from the backend being delayed on Linux/GTK when the user is not actively engaged with the UI. + - [d2a2a9f](https://github.com/tauri-apps/wry/commit/d2a2a9f473d2588b27a95bf627d125caea1b979d) fix: spawn async event loop on gtk to prevent delayed messages ([#135](https://github.com/tauri-apps/wry/pull/135)) on 2021-03-31 +- Add draggable regions, just add `drag-region` class to the html element. + - [b2a0bfc](https://github.com/tauri-apps/wry/commit/b2a0bfc289786d0a23dac0c8d9543771e70e3427) feat/ draggable-region ([#92](https://github.com/tauri-apps/wry/pull/92)) on 2021-03-25 +- Add event listener in application proxy + - [c49846c](https://github.com/tauri-apps/wry/commit/c49846cfc41bb548a685edeac5f8036501f7dcec) feat: event listener ([#129](https://github.com/tauri-apps/wry/pull/129)) on 2021-03-26 +- Better result error handling + - [485035f](https://github.com/tauri-apps/wry/commit/485035f17d28560966b07b512935821814f0e951) chore: better result error handling ([#124](https://github.com/tauri-apps/wry/pull/124)) on 2021-03-21 +- Fix visibility on webview2 when window was invisible previously and then shown. + - [6d31706](https://github.com/tauri-apps/wry/commit/6d31706a6bff43e9b28100675cf8fc12f29db248) Fix visibility on webview2 when window was invisible previously ([#128](https://github.com/tauri-apps/wry/pull/128)) on 2021-03-24 + +## \[0.6.1] + +- Add attribute option to allow WebView on Windows use user_data folder + - [8dd58ee](https://github.com/tauri-apps/wry/commit/8dd58eec77d4c89491b1af427d06c4ee6cfa8e58) feat/ allow webview2 (windows) to use optional user_data folder provided by the attributes ([#120](https://github.com/tauri-apps/wry/pull/120)) on 2021-03-21 + +## \[0.6.0] + +- Initialize covector! + - [33b64ed](https://github.com/tauri-apps/wry/commit/33b64ed5c208b778d03dbb5f3f2808bb417c9f52) chore: covector init ([#55](https://github.com/tauri-apps/wry/pull/55)) on 2021-02-21 +- Support Windows 7, 8, and 10 + - [fbf0d17](https://github.com/tauri-apps/wry/commit/fbf0d17164da455400aaa44104c3925eded09393) Adopt Webview2 on Windows ([#48](https://github.com/tauri-apps/wry/pull/48)) on 2021-02-20 +- Dev tools are enabled on debug build +- Add skip task bar option + - [395b6fb](https://github.com/tauri-apps/wry/commit/395b6fbcd66f6cbd0457cb609bea4afe734fadd4) feat: `skip_taskbar` for windows ([#49](https://github.com/tauri-apps/wry/pull/49)) on 2021-02-20 +- Add custom protocol option + - [a492806](https://github.com/tauri-apps/wry/commit/7a492806d716a30abe15a2104b64152c1ca370bb) Add custom protocol ([#65](https://github.com/tauri-apps/wry/pull/65)) on 2021-02-23 +- Add transparent option to mac and linux +- Error type has Send/Sync traits + - [3536b83](https://github.com/tauri-apps/wry/commit/3536b831ec30ee7436616ba4b262bbdd1e6279c8) Add .changes file in prepare of v0.6 on 2021-02-24 +- Replace Callback with RPC handler + - [e215157](https://github.com/tauri-apps/wry/commit/e215157146f0eab8ee6beab0628b036c68eea108) Implement draft RPC API ([#95](https://github.com/tauri-apps/wry/pull/95)) on 2021-03-04 +- Add File drop handlers + - [fed0ee7](https://github.com/tauri-apps/wry/commit/fed0ee772100ad19a344a85266618c7bcf7cb649) File drop handlers ([#96](https://github.com/tauri-apps/wry/pull/96)) on 2021-03-09 diff --git a/packages/tauri-app/vendor/wry-0.54.4/Cargo.lock b/packages/tauri-app/vendor/wry-0.54.4/Cargo.lock new file mode 100644 index 0000000000..83d0c7eed8 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/Cargo.lock @@ -0,0 +1,4159 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ab_glyph" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01c0457472c38ea5bd1c3b5ada5e368271cb550be7a4ca4a0b4634e9913f6cc2" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.4", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "android-activity" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" +dependencies = [ + "android-properties", + "bitflags 2.11.0", + "cc", + "cesu8", + "jni", + "jni-sys", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys 0.6.0+11769913", + "num_enum", + "thiserror 1.0.69", +] + +[[package]] +name = "android-properties" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" + +[[package]] +name = "ash" +version = "0.38.0+1.3.281" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" +dependencies = [ + "libloading", +] + +[[package]] +name = "atk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" +dependencies = [ + "atk-sys", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2 0.5.2", +] + +[[package]] +name = "block2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2 0.6.4", +] + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "bytemuck" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "cairo-rs" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" +dependencies = [ + "bitflags 2.11.0", + "cairo-sys-rs", + "glib", + "libc", + "once_cell", + "thiserror 1.0.69", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "calloop" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" +dependencies = [ + "bitflags 2.11.0", + "log", + "polling", + "rustix 0.38.44", + "slab", + "thiserror 1.0.69", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" +dependencies = [ + "calloop", + "rustix 0.38.44", + "wayland-backend", + "wayland-client", +] + +[[package]] +name = "cc" +version = "1.2.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "time", + "version_check", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.4", + "core-graphics-types 0.1.3", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97" +dependencies = [ + "bitflags 2.11.0", + "core-foundation 0.10.1", + "core-graphics-types 0.2.0", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.4", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" +dependencies = [ + "bitflags 2.11.0", + "core-foundation 0.10.1", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cssparser" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dae61cf9c0abb83bd659dab65b7e4e38d8236824c85f0f804f173567bda257d2" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "phf", + "smallvec", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +dependencies = [ + "quote", + "syn 2.0.117", +] + +[[package]] +name = "cursor-icon" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.117", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.61.2", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "dispatch2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" +dependencies = [ + "bitflags 2.11.0", + "block2 0.6.2", + "libc", + "objc2 0.6.4", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "dlib" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab8ecd87370524b461f8557c119c405552c396ed91fc0a8eec68679eab26f94a" +dependencies = [ + "libloading", +] + +[[package]] +name = "dlopen2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e2c5bd4158e66d1e215c49b837e11d62f3267b30c92f1d171c4d3105e3dc4d4" +dependencies = [ + "dlopen2_derive", + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "dlopen2_derive" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbbb781877580993a8707ec48672673ec7b81eeba04cfd2310bd28c08e47c8f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "document-features" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" +dependencies = [ + "litrs", +] + +[[package]] +name = "dom_query" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521e380c0c8afb8d9a1e83a1822ee03556fc3e3e7dbc1fd30be14e37f9cb3f89" +dependencies = [ + "bit-set", + "cssparser", + "foldhash 0.2.0", + "html5ever", + "precomputed-hash", + "selectors", + "tendril", +] + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "dpi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" +dependencies = [ + "serde", +] + +[[package]] +name = "dtoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590" + +[[package]] +name = "dtoa-short" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset", + "rustc_version", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "slab", +] + +[[package]] +name = "gdk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" +dependencies = [ + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", + "once_cell", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gdk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkwayland-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140071d506d223f7572b9f09b5e155afbd77428cd5cc7af8f2694c41d98dfe69" +dependencies = [ + "gdk-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkx11" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3caa00e14351bebbc8183b3c36690327eb77c49abc2268dd4bd36b856db3fbfe" +dependencies = [ + "gdk", + "gdkx11-sys", + "gio", + "glib", + "libc", + "x11", +] + +[[package]] +name = "gdkx11-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e7445fe01ac26f11601db260dd8608fe172514eb63b3b5e261ea6b0f4428d" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps", + "x11", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" +dependencies = [ + "rustix 1.1.4", + "windows-link 0.2.1", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", +] + +[[package]] +name = "gio" +version = "0.18.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys", + "glib", + "libc", + "once_cell", + "pin-project-lite", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "gio-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "winapi", +] + +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + +[[package]] +name = "glib" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" +dependencies = [ + "bitflags 2.11.0", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "memchr", + "once_cell", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "glib-macros" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate 2.0.2", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "glib-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "glow" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51fa363f025f5c111e03f13eda21162faeacb6911fe8caa0c0349f9cf0c4483" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glow" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e5ea60d70410161c8bf5da3fdfeaa1c72ed2c15f8bbb9d19fe3a4fad085f08" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e" +dependencies = [ + "gl_generator", +] + +[[package]] +name = "gobject-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gpu-alloc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" +dependencies = [ + "bitflags 2.11.0", + "gpu-alloc-types", +] + +[[package]] +name = "gpu-alloc-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" +dependencies = [ + "bitflags 2.11.0", +] + +[[package]] +name = "gpu-allocator" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd" +dependencies = [ + "log", + "presser", + "thiserror 1.0.69", + "windows 0.58.0", +] + +[[package]] +name = "gpu-descriptor" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b89c83349105e3732062a895becfc71a8f921bb71ecbbdd8ff99263e3b53a0ca" +dependencies = [ + "bitflags 2.11.0", + "gpu-descriptor-types", + "hashbrown 0.15.5", +] + +[[package]] +name = "gpu-descriptor-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" +dependencies = [ + "bitflags 2.11.0", +] + +[[package]] +name = "gtk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" +dependencies = [ + "atk", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "gtk3-macros" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "hexf-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" + +[[package]] +name = "html5ever" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1054432bae2f14e0061e33d23402fbaa67a921d319d56adc6bcf887ddad1cbc2" +dependencies = [ + "log", + "markup5ever", +] + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-range" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" + +[[package]] +name = "icu_collections" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", +] + +[[package]] +name = "itoa" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" + +[[package]] +name = "javascriptcore-rs" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" +dependencies = [ + "bitflags 1.3.2", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "khronos-egl" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" +dependencies = [ + "libc", + "libloading", + "pkg-config", +] + +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + +[[package]] +name = "libc" +version = "0.2.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" + +[[package]] +name = "libloading" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link 0.2.1", +] + +[[package]] +name = "libredox" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1744e39d1d6a9948f4f388969627434e31128196de472883b39f148769bfe30a" +dependencies = [ + "bitflags 2.11.0", + "libc", + "plain", + "redox_syscall 0.7.3", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" + +[[package]] +name = "litrs" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "markup5ever" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8983d30f2915feeaaab2d6babdd6bc7e9ed1a00b66b5e6d74df19aa9c0e91862" +dependencies = [ + "log", + "tendril", + "web_atoms", +] + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "memmap2" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714098028fe011992e1c3962653c96b2d578c4b4bce9036e15ff220319b1e0e3" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "metal" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" +dependencies = [ + "bitflags 2.11.0", + "block", + "core-graphics-types 0.1.3", + "foreign-types", + "log", + "objc", + "paste", +] + +[[package]] +name = "naga" +version = "23.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "364f94bc34f61332abebe8cad6f6cd82a5b65cff22c828d05d0968911462ca4f" +dependencies = [ + "arrayvec", + "bit-set", + "bitflags 2.11.0", + "cfg_aliases 0.1.1", + "codespan-reporting", + "hexf-parse", + "indexmap", + "log", + "rustc-hash 1.1.0", + "spirv", + "termcolor", + "thiserror 1.0.69", + "unicode-xid", +] + +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.11.0", + "jni-sys", + "log", + "ndk-sys 0.6.0+11769913", + "num_enum", + "raw-window-handle", + "thiserror 1.0.69", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.5.0+25.2.9519653" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "num-conv" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" + +[[package]] +name = "num_enum" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f" +dependencies = [ + "objc2-encode", + "objc2-exception-helper", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.11.0", + "block2 0.5.1", + "libc", + "objc2 0.5.2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation 0.2.2", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-app-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" +dependencies = [ + "bitflags 2.11.0", + "objc2 0.6.4", + "objc2-core-foundation", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "objc2-cloud-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" +dependencies = [ + "bitflags 2.11.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-core-location", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-contacts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" +dependencies = [ + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-core-data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.11.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags 2.11.0", + "dispatch2", + "objc2 0.6.4", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", + "objc2-metal", +] + +[[package]] +name = "objc2-core-location" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" +dependencies = [ + "block2 0.5.1", + "objc2 0.5.2", + "objc2-contacts", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-exception-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a1c5fbb72d7735b076bb47b578523aedc40f3c439bea6dfd595c089d79d98a" +dependencies = [ + "cc", +] + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.11.0", + "block2 0.5.1", + "dispatch", + "libc", + "objc2 0.5.2", +] + +[[package]] +name = "objc2-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" +dependencies = [ + "bitflags 2.11.0", + "objc2 0.6.4", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-link-presentation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" +dependencies = [ + "block2 0.5.1", + "objc2 0.5.2", + "objc2-app-kit 0.2.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.11.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.11.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", + "objc2-metal", +] + +[[package]] +name = "objc2-symbols" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" +dependencies = [ + "objc2 0.5.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" +dependencies = [ + "bitflags 2.11.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-image", + "objc2-core-location", + "objc2-foundation 0.2.2", + "objc2-link-presentation", + "objc2-quartz-core", + "objc2-symbols", + "objc2-uniform-type-identifiers", + "objc2-user-notifications", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" +dependencies = [ + "bitflags 2.11.0", + "objc2 0.6.4", + "objc2-core-foundation", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "objc2-uniform-type-identifiers" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" +dependencies = [ + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" +dependencies = [ + "bitflags 2.11.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-core-location", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-web-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" +dependencies = [ + "bitflags 2.11.0", + "block2 0.6.2", + "objc2 0.6.4", + "objc2-app-kit 0.3.2", + "objc2-core-foundation", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "orbclient" +version = "0.3.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59aed3b33578edcfa1bc96a321d590d31832b6ad55a26f0313362ce687e9abd6" +dependencies = [ + "libc", + "libredox", +] + +[[package]] +name = "owned_ttf_parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36820e9051aca1014ddc75770aab4d68bc1e9e632f0f5627c4086bc216fb583b" +dependencies = [ + "ttf-parser", +] + +[[package]] +name = "pango" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" +dependencies = [ + "gio", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.5.18", + "smallvec", + "windows-link 0.2.1", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "phf" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +dependencies = [ + "phf_macros", + "phf_shared", + "serde", +] + +[[package]] +name = "phf_codegen" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" +dependencies = [ + "fastrand", + "phf_shared", +] + +[[package]] +name = "phf_macros" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "phf_shared" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project" +version = "1.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "polling" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix 1.1.4", + "windows-sys 0.61.2", +] + +[[package]] +name = "pollster" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3" + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +dependencies = [ + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit 0.25.4+spec-1.1.0", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "profiling" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773" + +[[package]] +name = "quick-xml" +version = "0.39.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958f21e8e7ceb5a1aa7fa87fab28e7c75976e0bfe7e23ff069e0a260f894067d" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "range-alloc" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca45419789ae5a7899559e9512e58ca889e41f04f1f2445e9f4b290ceccd1d08" + +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.11.0", +] + +[[package]] +name = "redox_syscall" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce70a74e890531977d37e532c34d45e9055d2409ed08ddba14529471ed0be16" +dependencies = [ + "bitflags 2.11.0", +] + +[[package]] +name = "redox_users" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" +dependencies = [ + "getrandom 0.2.17", + "libredox", + "thiserror 2.0.18", +] + +[[package]] +name = "renderdoc-sys" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.11.0", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags 2.11.0", + "errno", + "libc", + "linux-raw-sys 0.12.1", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sctk-adwaita" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec" +dependencies = [ + "ab_glyph", + "log", + "memmap2", + "smithay-client-toolkit", + "tiny-skia", +] + +[[package]] +name = "selectors" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "223b960be86f7d302b7168cdbab137f9bdbf7e04a90c185312fab14dff49dc5f" +dependencies = [ + "bitflags 2.11.0", + "cssparser", + "derive_more", + "log", + "new_debug_unreachable", + "phf", + "phf_codegen", + "precomputed-hash", + "rustc-hash 2.1.1", + "servo_arc", + "smallvec", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "servo_arc" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "siphasher" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "slotmap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "smithay-client-toolkit" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" +dependencies = [ + "bitflags 2.11.0", + "calloop", + "calloop-wayland-source", + "cursor-icon", + "libc", + "log", + "memmap2", + "rustix 0.38.44", + "thiserror 1.0.69", + "wayland-backend", + "wayland-client", + "wayland-csd-frame", + "wayland-cursor", + "wayland-protocols", + "wayland-protocols-wlr", + "wayland-scanner", + "xkeysym", +] + +[[package]] +name = "smol_str" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" +dependencies = [ + "serde", +] + +[[package]] +name = "soup3" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" +dependencies = [ + "futures-channel", + "gio", + "glib", + "libc", + "soup3-sys", +] + +[[package]] +name = "soup3-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "spirv" +version = "0.3.0+sdk-1.3.268.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" +dependencies = [ + "bitflags 2.11.0", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strict-num" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" + +[[package]] +name = "string_cache" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared", + "precomputed-hash", +] + +[[package]] +name = "string_cache_codegen" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck 0.5.0", + "pkg-config", + "toml", + "version-compare", +] + +[[package]] +name = "tao" +version = "0.34.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d52c379e63da659a483a958110bbde891695a0ecb53e48cc7786d5eda7bb" +dependencies = [ + "bitflags 2.11.0", + "block2 0.6.2", + "core-foundation 0.10.1", + "core-graphics 0.25.0", + "crossbeam-channel", + "dispatch2", + "dlopen2", + "dpi", + "gdkwayland-sys", + "gdkx11-sys", + "gtk", + "jni", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys 0.6.0+11769913", + "objc2 0.6.4", + "objc2-app-kit 0.3.2", + "objc2-foundation 0.3.2", + "once_cell", + "parking_lot", + "raw-window-handle", + "tao-macros", + "unicode-segmentation", + "url", + "windows 0.61.3", + "windows-core 0.61.2", + "windows-version", + "x11-dl", +] + +[[package]] +name = "tao-macros" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "tendril" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4790fc369d5a530f4b544b094e31388b9b3a37c0f4652ade4505945f5660d24" +dependencies = [ + "new_debug_unreachable", + "utf-8", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "time" +version = "0.3.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" + +[[package]] +name = "time-macros" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-skia" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "log", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + +[[package]] +name = "tinystr" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "toml" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "1.0.0+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32c2555c699578a4f59f0cc68e5116c8d7cabbd45e1409b989d4be085b53f13e" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.25.4+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7193cbd0ce53dc966037f54351dbbcf0d5a642c7f0038c382ef9e677ce8c13f2" +dependencies = [ + "indexmap", + "toml_datetime 1.0.0+spec-1.1.0", + "toml_parser", + "winnow 0.7.15", +] + +[[package]] +name = "toml_parser" +version = "1.0.9+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "702d4415e08923e7e1ef96cd5727c0dfed80b4d2fa25db9647fe5eb6f7c5a4c4" +dependencies = [ + "winnow 0.7.15", +] + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "ttf-parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "version-compare" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8" +dependencies = [ + "cfg-if", + "futures-util", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.117", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wayland-backend" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa75f400b7f719bcd68b3f47cd939ba654cedeef690f486db71331eec4c6a406" +dependencies = [ + "cc", + "downcast-rs", + "rustix 1.1.4", + "scoped-tls", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab51d9f7c071abeee76007e2b742499e535148035bb835f97aaed1338cf516c3" +dependencies = [ + "bitflags 2.11.0", + "rustix 1.1.4", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-csd-frame" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" +dependencies = [ + "bitflags 2.11.0", + "cursor-icon", + "wayland-backend", +] + +[[package]] +name = "wayland-cursor" +version = "0.31.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b3298683470fbdc6ca40151dfc48c8f2fd4c41a26e13042f801f85002384091" +dependencies = [ + "rustix 1.1.4", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b23b5df31ceff1328f06ac607591d5ba360cf58f90c8fad4ac8d3a55a3c4aec7" +dependencies = [ + "bitflags 2.11.0", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-plasma" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d392fc283a87774afc9beefcd6f931582bb97fe0e6ced0b306a62cb1d026527c" +dependencies = [ + "bitflags 2.11.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78248e4cc0eff8163370ba5c158630dcae1f3497a586b826eca2ef5f348d6235" +dependencies = [ + "bitflags 2.11.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c86287151a309799b821ca709b7345a048a2956af05957c89cb824ab919fa4e3" +dependencies = [ + "proc-macro2", + "quick-xml", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374f6b70e8e0d6bf9461a32988fd553b59ff630964924dad6e4a4eb6bd538d17" +dependencies = [ + "dlib", + "log", + "once_cell", + "pkg-config", +] + +[[package]] +name = "web-sys" +version = "0.3.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web_atoms" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a9779e9f04d2ac1ce317aee707aa2f6b773afba7b931222bff6983843b1576" +dependencies = [ + "phf", + "phf_codegen", + "string_cache", + "string_cache_codegen", +] + +[[package]] +name = "webkit2gtk" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1027150013530fb2eaf806408df88461ae4815a45c541c8975e61d6f2fc4793" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup3", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "916a5f65c2ef0dfe12fff695960a2ec3d4565359fdbb2e9943c974e06c734ea5" +dependencies = [ + "bitflags 1.3.2", + "cairo-sys-rs", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pkg-config", + "soup3-sys", + "system-deps", +] + +[[package]] +name = "webview2-com" +version = "0.38.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7130243a7a5b33c54a444e54842e6a9e133de08b5ad7b5861cd8ed9a6a5bc96a" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows 0.61.3", + "windows-core 0.61.2", + "windows-implement 0.60.2", + "windows-interface 0.59.3", +] + +[[package]] +name = "webview2-com-macros" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a921c1b6914c367b2b823cd4cde6f96beec77d30a939c8199bb377cf9b9b54" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "webview2-com-sys" +version = "0.38.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "381336cfffd772377d291702245447a5251a2ffa5bad679c99e61bc48bacbf9c" +dependencies = [ + "thiserror 2.0.18", + "windows 0.61.3", + "windows-core 0.61.2", +] + +[[package]] +name = "wgpu" +version = "23.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80f70000db37c469ea9d67defdc13024ddf9a5f1b89cb2941b812ad7cde1735a" +dependencies = [ + "arrayvec", + "cfg_aliases 0.1.1", + "document-features", + "js-sys", + "log", + "naga", + "parking_lot", + "profiling", + "raw-window-handle", + "smallvec", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core" +version = "23.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d63c3c478de8e7e01786479919c8769f62a22eec16788d8c2ac77ce2c132778a" +dependencies = [ + "arrayvec", + "bit-vec", + "bitflags 2.11.0", + "cfg_aliases 0.1.1", + "document-features", + "indexmap", + "log", + "naga", + "once_cell", + "parking_lot", + "profiling", + "raw-window-handle", + "rustc-hash 1.1.0", + "smallvec", + "thiserror 1.0.69", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-hal" +version = "23.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89364b8a0b211adc7b16aeaf1bd5ad4a919c1154b44c9ce27838213ba05fd821" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bit-set", + "bitflags 2.11.0", + "block", + "bytemuck", + "cfg_aliases 0.1.1", + "core-graphics-types 0.1.3", + "glow 0.14.2", + "glutin_wgl_sys", + "gpu-alloc", + "gpu-allocator", + "gpu-descriptor", + "js-sys", + "khronos-egl", + "libc", + "libloading", + "log", + "metal", + "naga", + "ndk-sys 0.5.0+25.2.9519653", + "objc", + "once_cell", + "parking_lot", + "profiling", + "range-alloc", + "raw-window-handle", + "renderdoc-sys", + "rustc-hash 1.1.0", + "smallvec", + "thiserror 1.0.69", + "wasm-bindgen", + "web-sys", + "wgpu-types", + "windows 0.58.0", + "windows-core 0.58.0", +] + +[[package]] +name = "wgpu-types" +version = "23.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "610f6ff27778148c31093f3b03abc4840f9636d58d597ca2f5977433acfe0068" +dependencies = [ + "bitflags 2.11.0", + "js-sys", + "web-sys", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.61.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +dependencies = [ + "windows-collections", + "windows-core 0.61.2", + "windows-future", + "windows-link 0.1.3", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.2", +] + +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings 0.1.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement 0.60.2", + "windows-interface 0.59.3", + "windows-link 0.1.3", + "windows-result 0.3.4", + "windows-strings 0.4.2", +] + +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result 0.2.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-version" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winit" +version = "0.30.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6755fa58a9f8350bd1e472d4c3fcc25f824ec358933bba33306d0b63df5978d" +dependencies = [ + "ahash", + "android-activity", + "atomic-waker", + "bitflags 2.11.0", + "block2 0.5.1", + "bytemuck", + "calloop", + "cfg_aliases 0.2.1", + "concurrent-queue", + "core-foundation 0.9.4", + "core-graphics 0.23.2", + "cursor-icon", + "dpi", + "js-sys", + "libc", + "memmap2", + "ndk", + "objc2 0.5.2", + "objc2-app-kit 0.2.2", + "objc2-foundation 0.2.2", + "objc2-ui-kit 0.2.2", + "orbclient", + "percent-encoding", + "pin-project", + "raw-window-handle", + "redox_syscall 0.4.1", + "rustix 0.38.44", + "sctk-adwaita", + "smithay-client-toolkit", + "smol_str", + "tracing", + "unicode-segmentation", + "wasm-bindgen", + "wasm-bindgen-futures", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-plasma", + "web-sys", + "web-time", + "windows-sys 0.52.0", + "x11-dl", + "x11rb", + "xkbcommon-dl", +] + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "wry" +version = "0.54.4" +dependencies = [ + "base64", + "block2 0.6.2", + "cookie", + "crossbeam-channel", + "dirs", + "dom_query", + "dpi", + "dunce", + "gdkx11", + "getrandom 0.3.4", + "glow 0.16.0", + "gtk", + "http", + "http-range", + "javascriptcore-rs", + "jni", + "libc", + "libloading", + "ndk", + "objc2 0.6.4", + "objc2-app-kit 0.3.2", + "objc2-core-foundation", + "objc2-foundation 0.3.2", + "objc2-ui-kit 0.3.2", + "objc2-web-kit", + "once_cell", + "percent-encoding", + "pollster", + "raw-window-handle", + "sha2", + "soup3", + "tao", + "tao-macros", + "thiserror 2.0.18", + "tracing", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "wgpu", + "windows 0.61.3", + "windows-core 0.61.2", + "windows-version", + "winit", + "x11-dl", +] + +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "x11rb" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414" +dependencies = [ + "as-raw-xcb-connection", + "gethostname", + "libc", + "libloading", + "once_cell", + "rustix 1.1.4", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" + +[[package]] +name = "xcursor" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec9e4a500ca8864c5b47b8b482a73d62e4237670e5b5f1d6b9e3cae50f28f2b" + +[[package]] +name = "xkbcommon-dl" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" +dependencies = [ + "bitflags 2.11.0", + "dlib", + "log", + "once_cell", + "xkeysym", +] + +[[package]] +name = "xkeysym" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" + +[[package]] +name = "xml-rs" +version = "0.8.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f" + +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2578b716f8a7a858b7f02d5bd870c14bf4ddbbcf3a4c05414ba6503640505e3" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e6cc098ea4d3bd6246687de65af3f920c430e236bee1e3bf2e441463f08a02f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] diff --git a/packages/tauri-app/vendor/wry-0.54.4/Cargo.toml b/packages/tauri-app/vendor/wry-0.54.4/Cargo.toml new file mode 100644 index 0000000000..bf4b201b63 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/Cargo.toml @@ -0,0 +1,427 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2021" +rust-version = "1.77" +name = "wry" +version = "0.54.4" +authors = ["Tauri Programme within The Commons Conservancy"] +build = "build.rs" +exclude = [ + "/.changes", + "/.github", + "/audits", + "/wry-logo.svg", +] +autolib = false +autobins = false +autoexamples = false +autotests = false +autobenches = false +description = "Cross-platform WebView rendering library" +documentation = "https://docs.rs/wry" +readme = "README.md" +categories = ["gui"] +license = "Apache-2.0 OR MIT" +repository = "https://github.com/tauri-apps/wry" + +[package.metadata.docs.rs] +no-default-features = true +features = [ + "drag-drop", + "protocol", + "os-webview", +] +targets = [ + "x86_64-unknown-linux-gnu", + "x86_64-pc-windows-msvc", + "x86_64-apple-darwin", +] + +[features] +default = [ + "drag-drop", + "protocol", + "os-webview", + "x11", +] +devtools = [] +drag-drop = [] +fullscreen = [] +linux-body = [ + "webkit2gtk/v2_40", + "os-webview", +] +mac-proxy = [] +os-webview = [ + "javascriptcore-rs", + "webkit2gtk", + "webkit2gtk-sys", + "dep:gtk", + "soup3", +] +protocol = [] +serde = ["dpi/serde"] +tracing = ["dep:tracing"] +transparent = [] +x11 = [ + "x11-dl", + "gdkx11", + "tao/x11", +] + +[lib] +name = "wry" +path = "src/lib.rs" + +[[example]] +name = "async_custom_protocol" +path = "examples/async_custom_protocol.rs" + +[[example]] +name = "cookies" +path = "examples/cookies.rs" + +[[example]] +name = "custom_protocol" +path = "examples/custom_protocol.rs" + +[[example]] +name = "custom_titlebar" +path = "examples/custom_titlebar.rs" + +[[example]] +name = "gtk_multiwebview" +path = "examples/gtk_multiwebview.rs" + +[[example]] +name = "gtk_opengl" +path = "examples/gtk_opengl.rs" + +[[example]] +name = "multiwebview" +path = "examples/multiwebview.rs" + +[[example]] +name = "multiwindow" +path = "examples/multiwindow.rs" + +[[example]] +name = "reparent" +path = "examples/reparent.rs" + +[[example]] +name = "simple" +path = "examples/simple.rs" + +[[example]] +name = "streaming" +path = "examples/streaming.rs" + +[[example]] +name = "transparent" +path = "examples/transparent.rs" + +[[example]] +name = "wgpu" +path = "examples/wgpu.rs" + +[[example]] +name = "window_border" +path = "examples/window_border.rs" + +[[example]] +name = "winit" +path = "examples/winit.rs" + +[dependencies.cookie] +version = "0.18" + +[dependencies.dpi] +version = "0.1" + +[dependencies.http] +version = "1.1" + +[dependencies.once_cell] +version = "1" + +[dependencies.raw-window-handle] +version = "0.6" +features = ["std"] + +[dependencies.thiserror] +version = "2.0" + +[dependencies.tracing] +version = "0.1" +optional = true + +[dev-dependencies.base64] +version = "0.22" + +[dev-dependencies.dom_query] +version = "0.27.0" +default-features = false + +[dev-dependencies.getrandom] +version = "0.3" + +[dev-dependencies.glow] +version = "0.16.0" + +[dev-dependencies.http-range] +version = "0.1" + +[dev-dependencies.libloading] +version = "0.8.9" + +[dev-dependencies.percent-encoding] +version = "2.3" + +[dev-dependencies.pollster] +version = "0.4.0" + +[dev-dependencies.sha2] +version = "0.10" + +[dev-dependencies.tao] +version = "0.34" + +[dev-dependencies.wgpu] +version = "23" + +[dev-dependencies.winit] +version = "0.30" + +[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies.dirs] +version = "6" + +[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies.gdkx11] +version = "0.18" +optional = true + +[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies.gtk] +version = "0.18" +optional = true + +[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies.javascriptcore-rs] +version = "=1.1.2" +features = ["v2_28"] +optional = true + +[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies.percent-encoding] +version = "2.3" + +[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies.soup3] +version = "0.5" +optional = true + +[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies.webkit2gtk] +version = "=2.0.2" +features = ["v2_38"] +optional = true + +[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies.webkit2gtk-sys] +version = "=2.0.2" +optional = true + +[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies.x11-dl] +version = "2.21" +optional = true + +[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dev-dependencies.x11-dl] +version = "2.21" + +[target.'cfg(target_os = "android")'.dependencies.base64] +version = "0.22" + +[target.'cfg(target_os = "android")'.dependencies.crossbeam-channel] +version = "0.5" + +[target.'cfg(target_os = "android")'.dependencies.dom_query] +version = "0.27.0" +default-features = false + +[target.'cfg(target_os = "android")'.dependencies.jni] +version = "0.21" + +[target.'cfg(target_os = "android")'.dependencies.libc] +version = "0.2" + +[target.'cfg(target_os = "android")'.dependencies.ndk] +version = "0.9" + +[target.'cfg(target_os = "android")'.dependencies.sha2] +version = "0.10" + +[target.'cfg(target_os = "android")'.dependencies.tao-macros] +version = "0.1" + +[target.'cfg(target_os = "ios")'.dependencies.objc2-ui-kit] +version = "0.3.0" +features = [ + "std", + "objc2-core-foundation", + "UIResponder", + "UIScrollView", + "UIView", + "UIWindow", + "UIApplication", + "UIEvent", + "UIColor", +] +default-features = false + +[target.'cfg(target_os = "macos")'.dependencies.objc2-app-kit] +version = "0.3.0" +features = [ + "std", + "objc2-core-foundation", + "NSApplication", + "NSButton", + "NSControl", + "NSEvent", + "NSWindow", + "NSView", + "NSPasteboard", + "NSPanel", + "NSResponder", + "NSOpenPanel", + "NSSavePanel", + "NSMenu", + "NSGraphics", + "NSScreen", +] +default-features = false + +[target.'cfg(target_os = "windows")'.dependencies.dunce] +version = "1" + +[target.'cfg(target_os = "windows")'.dependencies.webview2-com] +version = "0.38" + +[target.'cfg(target_os = "windows")'.dependencies.windows] +version = "0.61" +features = [ + "Win32_Foundation", + "Win32_Graphics_Gdi", + "Win32_System_Com", + "Win32_System_Com_StructuredStorage", + "Win32_System_LibraryLoader", + "Win32_System_Ole", + "Win32_System_SystemInformation", + "Win32_System_SystemServices", + "Win32_UI_Shell", + "Win32_UI_WindowsAndMessaging", + "Win32_Globalization", + "Win32_UI_HiDpi", + "Win32_UI_Input", + "Win32_UI_Input_KeyboardAndMouse", +] + +[target.'cfg(target_os = "windows")'.dependencies.windows-core] +version = "0.61" + +[target.'cfg(target_os = "windows")'.dependencies.windows-version] +version = "0.1" + +[target.'cfg(target_vendor = "apple")'.dependencies.block2] +version = "0.6" + +[target.'cfg(target_vendor = "apple")'.dependencies.dirs] +version = "6" + +[target.'cfg(target_vendor = "apple")'.dependencies.objc2] +version = "0.6.4" +features = [ + "exception", + "disable-encoding-assertions", +] + +[target.'cfg(target_vendor = "apple")'.dependencies.objc2-core-foundation] +version = "0.3.0" +features = [ + "std", + "CFCGTypes", +] +default-features = false + +[target.'cfg(target_vendor = "apple")'.dependencies.objc2-foundation] +version = "0.3.0" +features = [ + "std", + "objc2-core-foundation", + "NSURLRequest", + "NSURL", + "NSString", + "NSKeyValueCoding", + "NSStream", + "NSDictionary", + "NSObject", + "NSData", + "NSEnumerator", + "NSKeyValueObserving", + "NSThread", + "NSJSONSerialization", + "NSDate", + "NSBundle", + "NSProcessInfo", + "NSValue", + "NSRange", + "NSRunLoop", +] +default-features = false + +[target.'cfg(target_vendor = "apple")'.dependencies.objc2-web-kit] +version = "0.3.0" +features = [ + "std", + "objc2-core-foundation", + "objc2-app-kit", + "block2", + "WKWebView", + "WKWebViewConfiguration", + "WKWebsiteDataStore", + "WKDownload", + "WKDownloadDelegate", + "WKNavigation", + "WKNavigationDelegate", + "WKUserContentController", + "WKURLSchemeHandler", + "WKPreferences", + "WKURLSchemeTask", + "WKScriptMessageHandler", + "WKUIDelegate", + "WKOpenPanelParameters", + "WKFrameInfo", + "WKSecurityOrigin", + "WKScriptMessage", + "WKNavigationAction", + "WKWebpagePreferences", + "WKNavigationResponse", + "WKUserScript", + "WKHTTPCookieStore", + "WKWindowFeatures", +] +default-features = false + +[target.'cfg(target_vendor = "apple")'.dependencies.url] +version = "2.5" + +[lints.rust.unexpected_cfgs] +level = "warn" +priority = 0 +check-cfg = [ + "cfg(linux)", + "cfg(gtk)", +] diff --git a/packages/tauri-app/vendor/wry-0.54.4/Cargo.toml.orig b/packages/tauri-app/vendor/wry-0.54.4/Cargo.toml.orig new file mode 100644 index 0000000000..a1dae2f177 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/Cargo.toml.orig @@ -0,0 +1,223 @@ +workspace = {} + +[package] +name = "wry" +version = "0.54.4" +authors = ["Tauri Programme within The Commons Conservancy"] +edition = "2021" +license = "Apache-2.0 OR MIT" +description = "Cross-platform WebView rendering library" +readme = "README.md" +repository = "https://github.com/tauri-apps/wry" +documentation = "https://docs.rs/wry" +categories = ["gui"] +rust-version = "1.77" +exclude = ["/.changes", "/.github", "/audits", "/wry-logo.svg"] + +[package.metadata.docs.rs] +no-default-features = true +features = ["drag-drop", "protocol", "os-webview"] +targets = [ + "x86_64-unknown-linux-gnu", + "x86_64-pc-windows-msvc", + "x86_64-apple-darwin", +] + +[features] +default = ["drag-drop", "protocol", "os-webview", "x11"] +serde = ["dpi/serde"] +drag-drop = [] +protocol = [] +devtools = [] +transparent = [] +fullscreen = [] +linux-body = ["webkit2gtk/v2_40", "os-webview"] +mac-proxy = [] +os-webview = [ + "javascriptcore-rs", + "webkit2gtk", + "webkit2gtk-sys", + "dep:gtk", + "soup3", +] +x11 = ["x11-dl", "gdkx11", "tao/x11"] +tracing = ["dep:tracing"] + +[dependencies] +tracing = { version = "0.1", optional = true } +once_cell = "1" +thiserror = "2.0" +http = "1.1" +raw-window-handle = { version = "0.6", features = ["std"] } +dpi = "0.1" +cookie = "0.18" + +[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] +javascriptcore-rs = { version = "=1.1.2", features = [ + "v2_28", +], optional = true } +webkit2gtk = { version = "=2.0.2", features = ["v2_38"], optional = true } +webkit2gtk-sys = { version = "=2.0.2", optional = true } +gtk = { version = "0.18", optional = true } +soup3 = { version = "0.5", optional = true } +x11-dl = { version = "2.21", optional = true } +gdkx11 = { version = "0.18", optional = true } +percent-encoding = "2.3" +dirs = "6" + +[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dev-dependencies] +x11-dl = { version = "2.21" } + +[target."cfg(target_os = \"windows\")".dependencies] +webview2-com = "0.38" +windows-version = "0.1" +windows-core = "0.61" +dunce = "1" + +[target."cfg(target_os = \"windows\")".dependencies.windows] +version = "0.61" +features = [ + "Win32_Foundation", + "Win32_Graphics_Gdi", + "Win32_System_Com", + "Win32_System_Com_StructuredStorage", + "Win32_System_LibraryLoader", + "Win32_System_Ole", + "Win32_System_SystemInformation", + "Win32_System_SystemServices", + "Win32_UI_Shell", + "Win32_UI_WindowsAndMessaging", + "Win32_Globalization", + "Win32_UI_HiDpi", + "Win32_UI_Input", + "Win32_UI_Input_KeyboardAndMouse", +] + +[target.'cfg(target_vendor = "apple")'.dependencies] +url = "2.5" +dirs = "6" +block2 = "0.6" +objc2 = { version = "0.6.4", features = [ + "exception", + # because `NSUUID::from_bytes` needs it, + # and `WebViewBuilderExtDarwin.with_data_store_identifier` crashes otherwise, + # see https://github.com/tauri-apps/tauri/issues/12843 + "disable-encoding-assertions", +] } +objc2-web-kit = { version = "0.3.0", default-features = false, features = [ + "std", + "objc2-core-foundation", + "objc2-app-kit", + "block2", + "WKWebView", + "WKWebViewConfiguration", + "WKWebsiteDataStore", + "WKDownload", + "WKDownloadDelegate", + "WKNavigation", + "WKNavigationDelegate", + "WKUserContentController", + "WKURLSchemeHandler", + "WKPreferences", + "WKURLSchemeTask", + "WKScriptMessageHandler", + "WKUIDelegate", + "WKOpenPanelParameters", + "WKFrameInfo", + "WKSecurityOrigin", + "WKScriptMessage", + "WKNavigationAction", + "WKWebpagePreferences", + "WKNavigationResponse", + "WKUserScript", + "WKHTTPCookieStore", + "WKWindowFeatures", +] } +objc2-core-foundation = { version = "0.3.0", default-features = false, features = [ + "std", + "CFCGTypes", +] } +objc2-foundation = { version = "0.3.0", default-features = false, features = [ + "std", + "objc2-core-foundation", + "NSURLRequest", + "NSURL", + "NSString", + "NSKeyValueCoding", + "NSStream", + "NSDictionary", + "NSObject", + "NSData", + "NSEnumerator", + "NSKeyValueObserving", + "NSThread", + "NSJSONSerialization", + "NSDate", + "NSBundle", + "NSProcessInfo", + "NSValue", + "NSRange", + "NSRunLoop", +] } + +[target.'cfg(target_os = "ios")'.dependencies] +objc2-ui-kit = { version = "0.3.0", default-features = false, features = [ + "std", + "objc2-core-foundation", + "UIResponder", + "UIScrollView", + "UIView", + "UIWindow", + "UIApplication", + "UIEvent", + "UIColor", +] } + +[target.'cfg(target_os = "macos")'.dependencies] +objc2-app-kit = { version = "0.3.0", default-features = false, features = [ + "std", + "objc2-core-foundation", + "NSApplication", + "NSButton", + "NSControl", + "NSEvent", + "NSWindow", + "NSView", + "NSPasteboard", + "NSPanel", + "NSResponder", + "NSOpenPanel", + "NSSavePanel", + "NSMenu", + "NSGraphics", + "NSScreen", +] } + +[target."cfg(target_os = \"android\")".dependencies] +crossbeam-channel = "0.5" +sha2 = "0.10" +base64 = "0.22" +jni = "0.21" +ndk = "0.9" +tao-macros = "0.1" +libc = "0.2" +dom_query = { version = "0.27.0", default-features = false } + +[dev-dependencies] +pollster = "0.4.0" +tao = "0.34" +wgpu = "23" +winit = "0.30" +getrandom = "0.3" +http-range = "0.1" +percent-encoding = "2.3" +glow = "0.16.0" +libloading = "0.8.9" +# For unit testing `inject_initialization_scripts` since we can't do it easily on Android +sha2 = "0.10" +base64 = "0.22" +dom_query = { version = "0.27.0", default-features = false } + +[lints.rust.unexpected_cfgs] +level = "warn" +check-cfg = ["cfg(linux)", "cfg(gtk)"] diff --git a/packages/tauri-app/vendor/wry-0.54.4/LICENSE-APACHE b/packages/tauri-app/vendor/wry-0.54.4/LICENSE-APACHE new file mode 100644 index 0000000000..16fe87b06e --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/packages/tauri-app/vendor/wry-0.54.4/LICENSE-MIT b/packages/tauri-app/vendor/wry-0.54.4/LICENSE-MIT new file mode 100644 index 0000000000..94ef8bf765 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/LICENSE-MIT @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020-2023 Ngo Iok Ui & Tauri Programme within The Commons Conservancy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/tauri-app/vendor/wry-0.54.4/LICENSE.spdx b/packages/tauri-app/vendor/wry-0.54.4/LICENSE.spdx new file mode 100644 index 0000000000..7e0eb72a98 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/LICENSE.spdx @@ -0,0 +1,20 @@ +SPDXVersion: SPDX-2.1 +DataLicense: CC0-1.0 +PackageName: wry +DataFormat: SPDXRef-1 +PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy +PackageHomePage: https://tauri.app +PackageLicenseDeclared: Apache-2.0 +PackageLicenseDeclared: MIT +PackageCopyrightText: 2020-2023, The Tauri Programme in the Commons Conservancy +PackageSummary: Wry is the official, rust-based webview +windowing service for Tauri. + +PackageComment: The package includes the following libraries; see +Relationship information. + +Created: 2020-05-20T09:00:00Z +PackageDownloadLocation: git://github.com/tauri-apps/wry +PackageDownloadLocation: git+https://github.com/tauri-apps/wry.git +PackageDownloadLocation: git+ssh://github.com/tauri-apps/wry.git +Creator: Person: Daniel Thompson-Yvetot \ No newline at end of file diff --git a/packages/tauri-app/vendor/wry-0.54.4/MOBILE.md b/packages/tauri-app/vendor/wry-0.54.4/MOBILE.md new file mode 100644 index 0000000000..e164405790 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/MOBILE.md @@ -0,0 +1,332 @@ +# Mobile Setup for Wry + +We use [cargo-mobile2](https://github.com/tauri-apps/cargo-mobile2) to create a mobile project for both Xcode and Android studio. + +## Prerequisite + +- Works on **Linux**, **Windows**, **macOS**, and **WSL**(Windows subsystem for Linux). +- **Xcode** and [**Android Studio**](https://developer.android.com/studio) installed properly. This is **the most difficult** part IMHO. This means all toolchains and SDK are all installed. Please report an issue with **comprehensive** steps if you encounter any problem. + +## Setting up Android Environment + +### 1. Installing JDK + +#### Using Android Studio: + +If you have Android Studio installed, it ships with a version of JDK so you don't have to install it manually. It is usually at `/jre`. It will be used for `JAVA_HOME` env var. + +> On macOS, it can be found at `/Applications/Android\ Studio.app/Contents/jbr/Contents/Home` +> On Windows, it can be found at `C:\Program Files\Android\Android Studio\jre` + +#### Using the terminal: + +##### Linux/WSL + +- Install it by running the following command based on your distro to install JDK: + + - debian-based + ``` + sudo apt install default-jdk + ``` + - arch-based + ``` + sudo pacman -S jdk-openjdk + ``` + +- Set the `JAVA_HOME` env variable for this current shell (we will make it permanent later on) + ```bash + export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64" + ``` + +#### macOS + +- Install openjdk from Homebrew: + +``` +brew install openjdk +``` + +- Link to system Java wrapper and set the `JAVA_HOME` env: + +``` +sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk +export JAVA_HOME="/Library/Java/JavaVirtualMachines/openjdk.jdk/Contents/Home" +``` + +##### Windows + +- Download openjdk-11 + ```powershell + cd $HOME\downloads + Invoke-WebRequest https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_windows-x64_bin.zip -o openjdk-11.zip + Expand-Archive openjdk-11.zip -d . + mkdir $env:LocalAppData\Java + mv jdk-11.0.2 $env:LocalAppData\Java + ``` +- Set the `JAVA_HOME` env variable for this current shell (we will make it permanent later on) + ```powershell + $env:JAVA_HOME="$env:LocalAppData\Java\jdk-11.0.2" + ``` + +### 2. Installing Android SDK and NDK + +There are two ways to install the sdk and ndk. + +#### Using Android Studio: + +You can use the SDK Manager in Android Studio to install: + +1. Android Sdk Platform 33 +2. Android SDK Platform-Tools +3. NDK (Side by side) 25.0.8775105 +4. Android SDK Build-Tools 33.0. +5. Android SDK Command-line Tools + +> Note: you may need to tick `Show Package Details` in the right bottom corner to be able to see some of these components + +#### Using the terminal: + +If you don't want or can't use Android Studio you can still get the SDK Manager cli quite easily and use it to install other components. + +> Note: The SDK Manager is part of the "Command line tools only" that can be downloaded from [here](https://developer.android.com/studio#command-tools) + +##### Linux/WSL/macOS + +Download the `cmdline-tools` + +```bash +cd ~/Downloads + +# if you are on Linux/WSL: +wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip -O +# if you are on macos: +wget https://dl.google.com/android/repository/commandlinetools-mac-8512546_latest.zip -O + +unzip cmdline-tools.zip +cd cmdline-tools +mkdir latest +mv bin latest/ +mv lib latest/ +mv NOTICE.txt latest/ +mv source.properties latest/ +cd .. +mkdir ~/.android # You can use another location for your SDK but I prefer using ~/.android +mv cmdline-tools ~/.android +``` + +Install required SDK and NDK components + +```bash +export ANDROID_HOME="$HOME/.android" +~/.android/cmdline-tools/latest/bin/sdkmanager "platforms;android-33" "platform-tools" "ndk;25.0.8775105" "build-tools;33.0.0" +# Install the emulator if you plan on using a virtual device later +~/.android/cmdline-tools/latest/bin/sdkmanager "emulator" +``` + +##### Windows + +Download the `cmdline-tools` + +```powershell +cd $HOME\downloads +Invoke-WebRequest https://dl.google.com/android/repository/commandlinetools-win-8512546_latest.zip -o cmdline-tools.zip +Expand-Archive cmdline-tools.zip -d . +cd cmdline-tools +mkdir latest +mv bin latest/ +mv lib latest/ +mv NOTICE.txt latest/ +mv source.properties latest/ +cd .. +mkdir $HOME\.android # You can use another location for your SDK but I prefer using $HOME\.android +mv cmdline-tools $HOME\.android +``` + +Install required SDK and NDK components + +```powershell +$env:ANDROID_HOME="$HOME\.android" +&"$env:ANDROID_HOME\cmdline-tools\latest\bin\sdkmanager.exe" "platforms;android-33" "platform-tools" "ndk;25.0.8775105" "build-tools;33.0.0" +# Install the emulator if you plan on using a virtual device later +&"$env:ANDROID_HOME\cmdline-tools\latest\bin\sdkmanager.exe" "emulator" +``` + +> Note: the location you moved the `cmdline-tools` directory into will be the location of your android SDK. + +### 3. Setting up Environment Variables + +You'll need to set up some environment variables to get everything to work properly. The environment variables below should be all the ones your need to be able to use [cargo-mobile2](https://github.com/tauri-apps/cargo-mobile2) to build/run your android app. + +##### Linux/WSL/macOS + +- Setting `JAVA_HOME`: + +```bash +# In .bashrc or .zshrc: +export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64" +# If you are using Android studio, on Linux, it is: +export JAVA_HOME=/opt/android-studio/jre +# And on macOS, it is: +export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home +``` + +- Setting `ANDROID_HOME`: + +```bash +export ANDROID_HOME="$HOME/.android" +# If you are using Android studio, on Linux, it is: +export ANDROID_HOME="$HOME/Android/Sdk" +# And on macOS, it is: +export ANDROID_HOME="$HOME/Library/Android/sdk" +``` + +- Setting `PATH`: + +```bash +export NDK_HOME="$ANDROID_HOME/ndk/25.0.8775105" # The patch version might be different +export PATH="$PATH:$ANDROID_HOME/cmdline-tools/latest/bin" +export PATH="$PATH:$ANDROID_HOME/platform-tools" +``` + +> For WSL: +> you also need to get ADB to connect to your emulator that is running on Windows +> +> ```bash +> export WSL_HOST="192.168.1.2" # Run `ipconfig` in windows to get your computer IP +> export ADB_SERVER_SOCKET=tcp:$WSL_HOST:5037 +> ``` + +After updating `.bashrc` either run `source ~/.bashrc` or reopen your terminal to apply the changes. + +##### Windows + +Open a powershell instance and run the following commands in order + +```powershell +Function Add-EnvVar($name, $value) { [System.Environment]::SetEnvironmentVariable("$name", "$value", "User") } +Function Add-PATHEntry($path) { $newPath = [System.Environment]::GetEnvironmentVariable("Path", "User") + ";" + $path; [System.Environment]::SetEnvironmentVariable("Path", "$newPath", "User") } + +Add-EnvVar JAVA_HOME "$env:LocalAppData\Java\jdk-11.0.2" # if you are using Android studio, the location is different, see the section above about JDK +$env:SDK_ROOT="$HOME\.android"# if you are using Android studio, the sdk location will be at `$env:LocalAppData\Android\Sdk` +Add-EnvVar ANDROID_HOME "$env:SDK_ROOT" +Add-EnvVar NDK_HOME "$env:SDK_ROOT\ndk\25.0.8775105" + +Add-PATHEntry "$env:SDK_ROOT\cmdline-tools\latest\bin" +Add-PATHEntry "$env:SDK_ROOT\platform-tools" +``` + +> IMPORTANT: you need to reboot your Windows machine in order for the environement variables to be loaded correctly. + +You should now have all the environment variables required and the cmdline-tools available in your PATH. You can verify this by running `sdkmanager` which should now be showing its help info. + +### 4. Install Rust android targets: + +```shell +rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android +``` + +## Getting Started + +Now lets bootstrap a project to develop a tauri or wry project for mobile. + +- Install [cargo-mobile2](https://github.com/tauri-apps/cargo-mobile2) CLI by running: + ```bash + cargo install --git https://github.com/tauri-apps/cargo-mobile2 + ``` +- Create a directory and init the project. + ```bash + mkdir hello + cd hello + cargo mobile init + # Project name (hello): + # Stylized name (Hello): + # Domain (example.com): tauri.app + # Detected template packs: + # [0] bevy + # [1] bevy-demo + # [2] wgpu + # [3] winit + # [4] wry + # Enter an index for a template pack above. + # Template pack (0): 4 + ``` + +## Build and Run on Device + +### Android + +> Make sure you're device is connected to adb +> you can check by running `cargo android list` or `adb devices` + +- `cargo android run` + +### iOS + +- `cargo build --target aarch64-apple-ios` +- `cargo apple run` + +First time running the app will be blocked. Go to your phone's `Settings > Privacy & Security > Developer Mode` to enable developer mode. And then go to `Settings -> General -> VPN and device management -> From "Developer App"` section to press "Apple Development: APPLE_ID" -> Trust. + +## Build and Run on Emulator + +### Android + +##### Using Android Studio + +- Open the project in Android Studio `cargo android open` +- Click `Trust Project`, `Use Embedded JDK` +- Choose an emulator. I usually choose Pixel 4 API 32 +- (optional) if you face this error `Device supports x86, but APK only supports armeabi-v7a` then check this [Stack Overflow answer](https://stackoverflow.com/questions/41775988/what-is-the-reason-for-the-error-device-supports-x86-but-apk-only-supports-arm/43742161#43742161) to fix it. +- Press run button. + +##### Without Android Studio + +If you don't have access to Android Studio or don't want or when running in WSL, you can build and run the generated project directly from the terminal + +1. List available emulators + - Linux/WSL/macOS: + ```bash + $ANDROID_HOME/emulator/emulator -list-avds + ``` + - Windows: + ```powershell + &"$env:ANDROID_HOME\emulator\emulator" -list-avds + ``` + you should now see a list of available emulators like the following, you'll need one of them for the next step: + ``` + Resizable_API_33 + Pixel_5_API_33 + ``` +2. Start the emulator with the name of the desired emulator: + - Linux/WSL/macOS: + ```bash + $ANDROID_HOME/emulator/emulator -avd Resizable_API_33 + ``` + - Windows: + ```powershell + &"$env:ANDROID_HOME\emulator\emulator" -avd Resizable_API_33 + ``` +3. In a new terminal window, run: + ```bash + cargo android run + ``` + +### iOS + +- If you are on x86_64: `cargo build --target x86_64-apple-ios` +- If you are on M1: `cargo build --target aarch64-apple-ios-sim` +- `cargo apple open` +- Choose a simulator. +- Press run button. + +## Devtools + +Set `devtools` attribute to true when building webview. + +### Android + +Open `chrome://inspect/#devices` in Chrome to get the devtools window. + +### iOS + +Open Safari > Develop > [Your Device Name] > [Your WebView]. diff --git a/packages/tauri-app/vendor/wry-0.54.4/README.md b/packages/tauri-app/vendor/wry-0.54.4/README.md new file mode 100644 index 0000000000..3228a7299e --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/README.md @@ -0,0 +1,317 @@ +

WRY Webview Rendering library

+ +[![](https://img.shields.io/crates/v/wry?style=flat-square)](https://crates.io/crates/wry) [![](https://img.shields.io/docsrs/wry?style=flat-square)](https://docs.rs/wry/) +[![License](https://img.shields.io/badge/License-MIT%20or%20Apache%202-green.svg)](https://opencollective.com/tauri) +[![Chat Server](https://img.shields.io/badge/chat-discord-7289da.svg)](https://discord.gg/SpmNs4S) +[![website](https://img.shields.io/badge/website-tauri.app-purple.svg)](https://tauri.app) +[![https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg](https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg)](https://good-labs.github.io/greater-good-affirmation) +[![support](https://img.shields.io/badge/sponsor-Open%20Collective-blue.svg)](https://opencollective.com/tauri) + +Wry is a cross-platform WebView rendering library. + +The webview requires a running event loop and a window type that implements [`HasWindowHandle`], +or a gtk container widget if you need to support X11 and Wayland. +You can use a windowing library like [`tao`] or [`winit`]. + +### Examples + +This example leverages the [`HasWindowHandle`] and supports Windows, macOS, iOS, Android and Linux (X11 Only). +See the following example using [`winit`]: + +```rust +#[derive(Default)] +struct App { + window: Option, + webview: Option, +} + +impl ApplicationHandler for App { + fn resumed(&mut self, event_loop: &ActiveEventLoop) { + let window = event_loop.create_window(Window::default_attributes()).unwrap(); + let webview = WebViewBuilder::new() + .with_url("https://tauri.app") + .build(&window) + .unwrap(); + + self.window = Some(window); + self.webview = Some(webview); + } + + fn window_event(&mut self, _event_loop: &ActiveEventLoop, _window_id: WindowId, event: WindowEvent) {} +} + +let event_loop = EventLoop::new().unwrap(); +let mut app = App::default(); +event_loop.run_app(&mut app).unwrap(); +``` + +If you also want to support Wayland too, then we recommend you use [`WebViewBuilderExtUnix::new_gtk`] on Linux. +See the following example using [`tao`]: + +```rust +let event_loop = EventLoop::new(); +let window = WindowBuilder::new().build(&event_loop).unwrap(); + +let builder = WebViewBuilder::new().with_url("https://tauri.app"); + +#[cfg(not(target_os = "linux"))] +let webview = builder.build(&window).unwrap(); +#[cfg(target_os = "linux")] +let webview = builder.build_gtk(window.gtk_window()).unwrap(); +``` + +### Child webviews + +You can use [`WebView::new_as_child`] or [`WebViewBuilder::build_as_child`] to create the webview as a child inside another window. This is supported on +macOS, Windows and Linux (X11 Only). + +```rust +#[derive(Default)] +struct App { + window: Option, + webview: Option, +} + +impl ApplicationHandler for App { + fn resumed(&mut self, event_loop: &ActiveEventLoop) { + let window = event_loop.create_window(Window::default_attributes()).unwrap(); + let webview = WebViewBuilder::new() + .with_url("https://tauri.app") + .with_bounds(Rect { + position: LogicalPosition::new(100, 100).into(), + size: LogicalSize::new(200, 200).into(), + }) + .build_as_child(&window) + .unwrap(); + + self.window = Some(window); + self.webview = Some(webview); + } + + fn window_event(&mut self, _event_loop: &ActiveEventLoop, _window_id: WindowId, event: WindowEvent) {} +} + +let event_loop = EventLoop::new().unwrap(); +let mut app = App::default(); +event_loop.run_app(&mut app).unwrap(); +``` + +If you want to support X11 and Wayland at the same time, we recommend using +[`WebViewExtUnix::new_gtk`] or [`WebViewBuilderExtUnix::new_gtk`] with [`gtk::Fixed`]. + +```rust +let event_loop = EventLoop::new(); +let window = WindowBuilder::new().build(&event_loop).unwrap(); + +let builder = WebViewBuilder::new() + .with_url("https://tauri.app") + .with_bounds(Rect { + position: LogicalPosition::new(100, 100).into(), + size: LogicalSize::new(200, 200).into(), + }); + +#[cfg(not(target_os = "linux"))] +let webview = builder.build_as_child(&window).unwrap(); +#[cfg(target_os = "linux")] +let webview = { + # use gtk::prelude::*; + let vbox = window.default_vbox().unwrap(); // tao adds a gtk::Box by default + let fixed = gtk::Fixed::new(); + fixed.show_all(); + vbox.pack_start(&fixed, true, true, 0); + builder.build_gtk(&fixed).unwrap() +}; +``` + +### Platform Considerations + +Here is the underlying web engine each platform uses, and some dependencies you might need to install. + +#### Linux + +[WebKitGTK](https://webkitgtk.org/) is used to provide webviews on Linux which requires GTK, +so if the windowing library doesn't support GTK (as in [`winit`]) +you'll need to call [`gtk::init`] before creating the webview and then call [`gtk::main_iteration_do`] alongside +your windowing library event loop. + +```rust +#[derive(Default)] +struct App { + webview_window: Option<(Window, WebView)>, +} + +impl ApplicationHandler for App { + fn resumed(&mut self, event_loop: &ActiveEventLoop) { + let window = event_loop.create_window(Window::default_attributes()).unwrap(); + let webview = WebViewBuilder::new() + .with_url("https://tauri.app") + .build(&window) + .unwrap(); + + self.webview_window = Some((window, webview)); + } + + fn window_event(&mut self, _event_loop: &ActiveEventLoop, _window_id: WindowId, event: WindowEvent) {} + + // Advance GTK event loop + + + + + + + + + + +

Welcome to WRY!

+

Page 1

+ +

+ Link + + + + diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/custom_protocol/script.js b/packages/tauri-app/vendor/wry-0.54.4/examples/custom_protocol/script.js new file mode 100644 index 0000000000..f6f257dcb3 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/examples/custom_protocol/script.js @@ -0,0 +1,22 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT +if (window.location.pathname.startsWith("/page2")) { + console.log("hello from javascript in page2"); +} else { + console.log("hello from javascript in page1"); + + if (typeof WebAssembly.instantiateStreaming !== "undefined") { + WebAssembly.instantiateStreaming(fetch("/wasm.wasm")).then((wasm) => { + console.log(wasm.instance.exports.main()); // should log 42 + }); + } else { + // Older WKWebView may not support `WebAssembly.instantiateStreaming` yet. + fetch("/wasm.wasm") + .then((response) => response.arrayBuffer()) + .then((bytes) => WebAssembly.instantiate(bytes)) + .then((wasm) => { + console.log(wasm.instance.exports.main()); // should log 42 + }); + } +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/custom_protocol/subpage.html b/packages/tauri-app/vendor/wry-0.54.4/examples/custom_protocol/subpage.html new file mode 100644 index 0000000000..db373d554a --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/examples/custom_protocol/subpage.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + +

Page 2

+ Back home + + + + \ No newline at end of file diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/custom_protocol/wasm.wasm b/packages/tauri-app/vendor/wry-0.54.4/examples/custom_protocol/wasm.wasm new file mode 100644 index 0000000000000000000000000000000000000000..8ffac94b9fd56b2180377331b063485aa0b4c86c GIT binary patch literal 92 zcmZQbEY4+QU|?WuZD?pZlGZ|P~z;pov18XxxgpsWg#9&~b2%?zSa#M5j Ziz=BISaK6H^B5Soy1>f7+87+QxB)4*7p(vQ literal 0 HcmV?d00001 diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/custom_titlebar.rs b/packages/tauri-app/vendor/wry-0.54.4/examples/custom_titlebar.rs new file mode 100644 index 0000000000..226207ac84 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/examples/custom_titlebar.rs @@ -0,0 +1,304 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use tao::{ + dpi::PhysicalSize, + event::{Event, StartCause, WindowEvent}, + event_loop::{ControlFlow, EventLoopBuilder}, + window::{CursorIcon, ResizeDirection, Window, WindowBuilder}, +}; +use wry::{http::Request, WebViewBuilder}; + +#[derive(Debug)] +enum HitTestResult { + Client, + Left, + Right, + Top, + Bottom, + TopLeft, + TopRight, + BottomLeft, + BottomRight, + NoWhere, +} + +impl HitTestResult { + fn drag_resize_window(&self, window: &Window) { + let _ = window.drag_resize_window(match self { + HitTestResult::Left => ResizeDirection::West, + HitTestResult::Right => ResizeDirection::East, + HitTestResult::Top => ResizeDirection::North, + HitTestResult::Bottom => ResizeDirection::South, + HitTestResult::TopLeft => ResizeDirection::NorthWest, + HitTestResult::TopRight => ResizeDirection::NorthEast, + HitTestResult::BottomLeft => ResizeDirection::SouthWest, + HitTestResult::BottomRight => ResizeDirection::SouthEast, + _ => unreachable!(), + }); + } + + fn change_cursor(&self, window: &Window) { + window.set_cursor_icon(match self { + HitTestResult::Left => CursorIcon::WResize, + HitTestResult::Right => CursorIcon::EResize, + HitTestResult::Top => CursorIcon::NResize, + HitTestResult::Bottom => CursorIcon::SResize, + HitTestResult::TopLeft => CursorIcon::NwResize, + HitTestResult::TopRight => CursorIcon::NeResize, + HitTestResult::BottomLeft => CursorIcon::SwResize, + HitTestResult::BottomRight => CursorIcon::SeResize, + _ => CursorIcon::Default, + }); + } +} + +fn hit_test(window_size: PhysicalSize, x: i32, y: i32, scale: f64) -> HitTestResult { + const BORDERLESS_RESIZE_INSET: f64 = 5.0; + + const CLIENT: isize = 0b0000; + const LEFT: isize = 0b0001; + const RIGHT: isize = 0b0010; + const TOP: isize = 0b0100; + const BOTTOM: isize = 0b1000; + const TOPLEFT: isize = TOP | LEFT; + const TOPRIGHT: isize = TOP | RIGHT; + const BOTTOMLEFT: isize = BOTTOM | LEFT; + const BOTTOMRIGHT: isize = BOTTOM | RIGHT; + + let top = 0; + let left = 0; + let bottom = top + window_size.height as i32; + let right = left + window_size.width as i32; + + let inset = (BORDERLESS_RESIZE_INSET * scale) as i32; + + #[rustfmt::skip] + let result = + (LEFT * (if x < (left + inset) { 1 } else { 0 })) + | (RIGHT * (if x >= (right - inset) { 1 } else { 0 })) + | (TOP * (if y < (top + inset) { 1 } else { 0 })) + | (BOTTOM * (if y >= (bottom - inset) { 1 } else { 0 })); + + match result { + CLIENT => HitTestResult::Client, + LEFT => HitTestResult::Left, + RIGHT => HitTestResult::Right, + TOP => HitTestResult::Top, + BOTTOM => HitTestResult::Bottom, + TOPLEFT => HitTestResult::TopLeft, + TOPRIGHT => HitTestResult::TopRight, + BOTTOMLEFT => HitTestResult::BottomLeft, + BOTTOMRIGHT => HitTestResult::BottomRight, + _ => HitTestResult::NoWhere, + } +} + +enum UserEvent { + Minimize, + Maximize, + DragWindow, + CloseWindow, + MouseDown(i32, i32), + MouseMove(i32, i32), +} + +fn main() -> wry::Result<()> { + let event_loop = EventLoopBuilder::::with_user_event().build(); + let window = WindowBuilder::new() + .with_decorations(false) + .build(&event_loop) + .unwrap(); + + const HTML: &str = r#" + + + + + + + +
+
Custom Titlebar
+
+
+ +
+
+ +
+
+ +
+
+
+
+

WRYYYYYYYYYYYYYYYYYYYYYY!

+
+ + + + +"#; + + let proxy = event_loop.create_proxy(); + let handler = move |req: Request| { + let body = req.body(); + let mut req = body.split([':', ',']); + match req.next().unwrap() { + "minimize" => { + let _ = proxy.send_event(UserEvent::Minimize); + } + "maximize" => { + let _ = proxy.send_event(UserEvent::Maximize); + } + "drag_window" => { + let _ = proxy.send_event(UserEvent::DragWindow); + } + "close" => { + let _ = proxy.send_event(UserEvent::CloseWindow); + } + "mousedown" => { + let x = req.next().unwrap().parse().unwrap(); + let y = req.next().unwrap().parse().unwrap(); + let _ = proxy.send_event(UserEvent::MouseDown(x, y)); + } + "mousemove" => { + let x = req.next().unwrap().parse().unwrap(); + let y = req.next().unwrap().parse().unwrap(); + let _ = proxy.send_event(UserEvent::MouseMove(x, y)); + } + _ => {} + } + }; + + let builder = WebViewBuilder::new() + .with_html(HTML) + .with_ipc_handler(handler) + .with_accept_first_mouse(true); + + #[cfg(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + ))] + let webview = builder.build(&window)?; + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + )))] + let webview = { + use tao::platform::unix::WindowExtUnix; + use wry::WebViewBuilderExtUnix; + let vbox = window.default_vbox().unwrap(); + builder.build_gtk(vbox)? + }; + + let mut webview = Some(webview); + + event_loop.run(move |event, _, control_flow| { + *control_flow = ControlFlow::Wait; + + match event { + Event::NewEvents(StartCause::Init) => println!("Wry application started!"), + Event::WindowEvent { + event: WindowEvent::CloseRequested, + .. + } + | Event::UserEvent(UserEvent::CloseWindow) => { + let _ = webview.take(); + *control_flow = ControlFlow::Exit + } + + Event::UserEvent(e) => match e { + UserEvent::Minimize => window.set_minimized(true), + UserEvent::Maximize => window.set_maximized(!window.is_maximized()), + UserEvent::DragWindow => window.drag_window().unwrap(), + UserEvent::MouseDown(x, y) => { + let res = hit_test(window.inner_size(), x, y, window.scale_factor()); + match res { + HitTestResult::Client | HitTestResult::NoWhere => {} + _ => res.drag_resize_window(&window), + } + } + UserEvent::MouseMove(x, y) => { + hit_test(window.inner_size(), x, y, window.scale_factor()).change_cursor(&window); + } + UserEvent::CloseWindow => { /* handled above */ } + }, + _ => (), + } + }); +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/gtk_multiwebview.rs b/packages/tauri-app/vendor/wry-0.54.4/examples/gtk_multiwebview.rs new file mode 100644 index 0000000000..3e47efd4ea --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/examples/gtk_multiwebview.rs @@ -0,0 +1,133 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use tao::{ + event::{Event, WindowEvent}, + event_loop::{ControlFlow, EventLoop}, + window::WindowBuilder, +}; +use wry::{ + dpi::{LogicalPosition, LogicalSize}, + Rect, WebViewBuilder, +}; + +fn main() -> wry::Result<()> { + let event_loop = EventLoop::new(); + let window = WindowBuilder::new().build(&event_loop).unwrap(); + + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + )))] + let fixed = { + use gtk::prelude::*; + use tao::platform::unix::WindowExtUnix; + let fixed = gtk::Fixed::new(); + let vbox = window.default_vbox().unwrap(); + vbox.pack_start(&fixed, true, true, 0); + fixed.show_all(); + fixed + }; + + let build_webview = |builder: WebViewBuilder<'_>| -> wry::Result { + #[cfg(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + ))] + let webview = builder.build(&window)?; + + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + )))] + let webview = { + use wry::WebViewBuilderExtUnix; + builder.build_gtk(&fixed)? + }; + + Ok(webview) + }; + + let size = window.inner_size().to_logical::(window.scale_factor()); + + let builder = WebViewBuilder::new() + .with_bounds(Rect { + position: LogicalPosition::new(0, 0).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .with_url("https://tauri.app"); + let webview = build_webview(builder)?; + + let builder2 = WebViewBuilder::new() + .with_bounds(Rect { + position: LogicalPosition::new(size.width / 2, 0).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .with_url("https://github.com/tauri-apps/wry"); + let webview2 = build_webview(builder2)?; + + let builder3 = WebViewBuilder::new() + .with_bounds(Rect { + position: LogicalPosition::new(0, size.height / 2).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .with_url("https://twitter.com/TauriApps"); + let webview3 = build_webview(builder3)?; + + let builder4 = WebViewBuilder::new() + .with_bounds(Rect { + position: LogicalPosition::new(size.width / 2, size.height / 2).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .with_url("https://google.com"); + let webview4 = build_webview(builder4)?; + + event_loop.run(move |event, _, control_flow| { + *control_flow = ControlFlow::Wait; + + match event { + Event::WindowEvent { + event: WindowEvent::Resized(size), + .. + } => { + let size = size.to_logical::(window.scale_factor()); + webview + .set_bounds(Rect { + position: LogicalPosition::new(0, 0).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .unwrap(); + webview2 + .set_bounds(Rect { + position: LogicalPosition::new(size.width / 2, 0).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .unwrap(); + webview3 + .set_bounds(Rect { + position: LogicalPosition::new(0, size.height / 2).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .unwrap(); + webview4 + .set_bounds(Rect { + position: LogicalPosition::new(size.width / 2, size.height / 2).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .unwrap(); + } + Event::WindowEvent { + event: WindowEvent::CloseRequested, + .. + } => *control_flow = ControlFlow::Exit, + _ => {} + } + }); +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/gtk_opengl.rs b/packages/tauri-app/vendor/wry-0.54.4/examples/gtk_opengl.rs new file mode 100644 index 0000000000..20b94fc2d9 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/examples/gtk_opengl.rs @@ -0,0 +1,241 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::cell::RefCell; +use std::rc::Rc; +use tao::{ + event::{Event, WindowEvent}, + event_loop::{ControlFlow, EventLoop}, + window::WindowBuilder, +}; +use wry::{ + dpi::{LogicalPosition, LogicalSize}, + Rect, WebViewBuilder, +}; + +fn main() -> wry::Result<()> { + let event_loop = EventLoop::new(); + let window = WindowBuilder::new() + .with_title("GTK OpenGL with Webview") + .with_inner_size(LogicalSize::new(800, 600)) + .build(&event_loop) + .unwrap(); + + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + )))] + let (fixed, _) = { + use gtk::prelude::*; + use tao::platform::unix::WindowExtUnix; + + let overlay = gtk::Overlay::new(); + let vbox = window.default_vbox().unwrap(); + vbox.pack_start(&overlay, true, true, 0); + + let gl_area = gtk::GLArea::new(); + gl_area.set_has_alpha(true); + gl_area.set_auto_render(true); + + struct AppState { + gl: glow::Context, + program: glow::Program, + vertex_array: glow::VertexArray, + } + + let state: Rc>> = Rc::new(RefCell::new(None)); + let state_realize = state.clone(); + + gl_area.connect_realize(move |gl_area| { + gl_area.make_current(); + if gl_area.error().is_some() { + println!("Error creating GLArea context"); + return; + } + + let gl = unsafe { + glow::Context::from_loader_function(|s| { + let mut ptr = std::ptr::null(); + let name = std::ffi::CString::new(s).unwrap(); + + if let Ok(lib) = libloading::Library::new("libGL.so.1") { + if let Ok(sym) = lib.get:: *const std::ffi::c_void>( + b"glXGetProcAddress\0", + ) { + ptr = sym(name.as_ptr()); + } + } + if ptr.is_null() { + if let Ok(lib) = libloading::Library::new("libEGL.so.1") { + if let Ok(sym) = lib + .get:: *const std::ffi::c_void>( + b"eglGetProcAddress\0", + ) + { + ptr = sym(name.as_ptr()); + } + } + } + ptr + }) + }; + + unsafe { + use glow::HasContext as _; + + let vertex_array = gl.create_vertex_array().unwrap(); + gl.bind_vertex_array(Some(vertex_array)); + + let program = gl.create_program().expect("Cannot create program"); + + let vertex_shader_source = r#" + #version 330 core + void main() { + if (gl_VertexID == 0) gl_Position = vec4(-0.5, -0.5, 0.0, 1.0); + else if (gl_VertexID == 1) gl_Position = vec4(0.5, -0.5, 0.0, 1.0); + else gl_Position = vec4(0.0, 0.5, 0.0, 1.0); + } + "#; + + let fragment_shader_source = r#" + #version 330 core + out vec4 FragColor; + void main() { + FragColor = vec4(1.0, 0.5, 0.2, 1.0); + } + "#; + + let vs = gl.create_shader(glow::VERTEX_SHADER).unwrap(); + gl.shader_source(vs, vertex_shader_source); + gl.compile_shader(vs); + if !gl.get_shader_compile_status(vs) { + panic!("{}", gl.get_shader_info_log(vs)); + } + + let fs = gl.create_shader(glow::FRAGMENT_SHADER).unwrap(); + gl.shader_source(fs, fragment_shader_source); + gl.compile_shader(fs); + if !gl.get_shader_compile_status(fs) { + panic!("{}", gl.get_shader_info_log(fs)); + } + + gl.attach_shader(program, vs); + gl.attach_shader(program, fs); + gl.link_program(program); + if !gl.get_program_link_status(program) { + panic!("{}", gl.get_program_info_log(program)); + } + + gl.detach_shader(program, vs); + gl.delete_shader(vs); + gl.detach_shader(program, fs); + gl.delete_shader(fs); + + *state_realize.borrow_mut() = Some(AppState { + gl, + program, + vertex_array, + }); + } + }); + + let state_render = state.clone(); + gl_area.connect_render(move |_gl_area, _gl_context| { + if let Some(state) = state_render.borrow().as_ref() { + unsafe { + use glow::HasContext as _; + state.gl.clear_color(0.1, 0.2, 0.3, 1.0); + state.gl.clear(glow::COLOR_BUFFER_BIT); + + state.gl.use_program(Some(state.program)); + state.gl.bind_vertex_array(Some(state.vertex_array)); + state.gl.draw_arrays(glow::TRIANGLES, 0, 3); + } + } + gtk::glib::Propagation::Proceed + }); + + gl_area.connect_unrealize(move |gl_area| { + gl_area.make_current(); + if let Some(state) = state.borrow_mut().take() { + unsafe { + use glow::HasContext as _; + state.gl.delete_program(state.program); + state.gl.delete_vertex_array(state.vertex_array); + } + } + }); + + overlay.add(&gl_area); + + let fixed = gtk::Fixed::new(); + overlay.add_overlay(&fixed); + + overlay.show_all(); + (fixed, gl_area) + }; + + let builder = WebViewBuilder::new() + .with_bounds(Rect { + position: LogicalPosition::new(100, 100).into(), + size: LogicalSize::new(400, 300).into(), + }) + .with_transparent(true) + .with_html( + r#" + +

Hello World!

+ + "#, + ); + + #[cfg(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + ))] + let webview = builder.build(&window)?; + + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + )))] + let webview = { + use wry::WebViewBuilderExtUnix; + builder.build_gtk(&fixed)? + }; + + event_loop.run(move |event, _, control_flow| { + *control_flow = ControlFlow::Wait; + + match event { + Event::WindowEvent { + event: WindowEvent::Resized(size), + .. + } => { + let size = size.to_logical::(window.scale_factor()); + webview + .set_bounds(Rect { + position: LogicalPosition::new(100, 100).into(), + size: LogicalSize::new( + size.width.saturating_sub(200).max(100), + size.height.saturating_sub(200).max(100), + ) + .into(), + }) + .unwrap(); + } + Event::WindowEvent { + event: WindowEvent::CloseRequested, + .. + } => *control_flow = ControlFlow::Exit, + _ => {} + } + }); +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/multiwebview.rs b/packages/tauri-app/vendor/wry-0.54.4/examples/multiwebview.rs new file mode 100644 index 0000000000..6540c15418 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/examples/multiwebview.rs @@ -0,0 +1,168 @@ +use winit::{ + application::ApplicationHandler, + event::WindowEvent, + event_loop::{ActiveEventLoop, EventLoop}, + window::{Window, WindowId}, +}; +use wry::{ + dpi::{LogicalPosition, LogicalSize}, + Rect, WebViewBuilder, +}; + +#[derive(Default)] +struct State { + window: Option, + webview1: Option, + webview2: Option, + webview3: Option, + webview4: Option, +} + +impl ApplicationHandler for State { + fn resumed(&mut self, event_loop: &ActiveEventLoop) { + let mut attributes = Window::default_attributes(); + attributes.inner_size = Some(LogicalSize::new(800, 800).into()); + let window = event_loop.create_window(attributes).unwrap(); + + let size = window.inner_size().to_logical::(window.scale_factor()); + + let webview1 = WebViewBuilder::new() + .with_bounds(Rect { + position: LogicalPosition::new(0, 0).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .with_url("https://tauri.app") + .build_as_child(&window) + .unwrap(); + + let webview2 = WebViewBuilder::new() + .with_bounds(Rect { + position: LogicalPosition::new(size.width / 2, 0).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .with_url("https://github.com/tauri-apps/wry") + .build_as_child(&window) + .unwrap(); + + let webview3 = WebViewBuilder::new() + .with_bounds(Rect { + position: LogicalPosition::new(0, size.height / 2).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .with_url("https://twitter.com/TauriApps") + .build_as_child(&window) + .unwrap(); + + let webview4 = WebViewBuilder::new() + .with_bounds(Rect { + position: LogicalPosition::new(size.width / 2, size.height / 2).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .with_url("https://google.com") + .build_as_child(&window) + .unwrap(); + + self.window = Some(window); + self.webview1 = Some(webview1); + self.webview2 = Some(webview2); + self.webview3 = Some(webview3); + self.webview4 = Some(webview4); + } + + fn window_event( + &mut self, + _event_loop: &ActiveEventLoop, + _window_id: WindowId, + event: WindowEvent, + ) { + match event { + WindowEvent::Resized(size) => { + if let (Some(window), Some(webview1), Some(webview2), Some(webview3), Some(webview4)) = ( + &self.window, + &self.webview1, + &self.webview2, + &self.webview3, + &self.webview4, + ) { + let size = size.to_logical::(window.scale_factor()); + + webview1 + .set_bounds(Rect { + position: LogicalPosition::new(0, 0).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .unwrap(); + + webview2 + .set_bounds(Rect { + position: LogicalPosition::new(size.width / 2, 0).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .unwrap(); + + webview3 + .set_bounds(Rect { + position: LogicalPosition::new(0, size.height / 2).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .unwrap(); + + webview4 + .set_bounds(Rect { + position: LogicalPosition::new(size.width / 2, size.height / 2).into(), + size: LogicalSize::new(size.width / 2, size.height / 2).into(), + }) + .unwrap(); + } + } + WindowEvent::CloseRequested => { + std::process::exit(0); + } + _ => {} + } + } + + fn about_to_wait(&mut self, _event_loop: &ActiveEventLoop) { + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd", + ))] + { + while gtk::events_pending() { + gtk::main_iteration_do(false); + } + } + } +} + +fn main() -> wry::Result<()> { + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd", + ))] + { + use gtk::prelude::DisplayExtManual; + + gtk::init()?; + if gtk::gdk::Display::default().unwrap().backend().is_wayland() { + panic!("This example doesn't support wayland!"); + } + + winit::platform::x11::register_xlib_error_hook(Box::new(|_display, error| { + let error = error as *mut x11_dl::xlib::XErrorEvent; + (unsafe { (*error).error_code }) == 170 + })); + } + + let event_loop = EventLoop::new().unwrap(); + let mut state = State::default(); + event_loop.run_app(&mut state).unwrap(); + + Ok(()) +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/multiwindow.rs b/packages/tauri-app/vendor/wry-0.54.4/examples/multiwindow.rs new file mode 100644 index 0000000000..0514f99e86 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/examples/multiwindow.rs @@ -0,0 +1,125 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::collections::HashMap; +use tao::{ + event::{Event, WindowEvent}, + event_loop::{ControlFlow, EventLoopBuilder, EventLoopProxy, EventLoopWindowTarget}, + window::{Window, WindowBuilder, WindowId}, +}; +use wry::{http::Request, WebView, WebViewBuilder}; + +enum UserEvent { + CloseWindow(WindowId), + NewTitle(WindowId, String), + NewWindow, +} + +fn main() -> wry::Result<()> { + let event_loop = EventLoopBuilder::::with_user_event().build(); + let mut webviews = HashMap::new(); + let proxy = event_loop.create_proxy(); + + let (window, webview) = create_new_window( + format!("Window {}", webviews.len() + 1), + &event_loop, + proxy.clone(), + ); + webviews.insert(window.id(), (window, webview)); + + event_loop.run(move |event, event_loop, control_flow| { + *control_flow = ControlFlow::Wait; + + match event { + Event::WindowEvent { + event: WindowEvent::CloseRequested, + window_id, + .. + } => { + webviews.remove(&window_id); + if webviews.is_empty() { + *control_flow = ControlFlow::Exit + } + } + Event::UserEvent(UserEvent::NewWindow) => { + let (window, webview) = create_new_window( + format!("Window {}", webviews.len() + 1), + event_loop, + proxy.clone(), + ); + webviews.insert(window.id(), (window, webview)); + } + Event::UserEvent(UserEvent::CloseWindow(id)) => { + webviews.remove(&id); + if webviews.is_empty() { + *control_flow = ControlFlow::Exit + } + } + + Event::UserEvent(UserEvent::NewTitle(id, title)) => { + webviews.get(&id).unwrap().0.set_title(&title); + } + _ => (), + } + }); +} + +fn create_new_window( + title: String, + event_loop: &EventLoopWindowTarget, + proxy: EventLoopProxy, +) -> (Window, WebView) { + let window = WindowBuilder::new() + .with_title(title) + .build(event_loop) + .unwrap(); + let window_id = window.id(); + let handler = move |req: Request| { + let body = req.body(); + match body.as_str() { + "new-window" => { + let _ = proxy.send_event(UserEvent::NewWindow); + } + "close" => { + let _ = proxy.send_event(UserEvent::CloseWindow(window_id)); + } + _ if body.starts_with("change-title") => { + let title = body.replace("change-title:", ""); + let _ = proxy.send_event(UserEvent::NewTitle(window_id, title)); + } + _ => {} + } + }; + + let builder = WebViewBuilder::new() + .with_html( + r#" + + + + "#, + ) + .with_ipc_handler(handler); + + #[cfg(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + ))] + let webview = builder.build(&window).unwrap(); + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + )))] + let webview = { + use tao::platform::unix::WindowExtUnix; + use wry::WebViewBuilderExtUnix; + let vbox = window.default_vbox().unwrap(); + builder.build_gtk(vbox).unwrap() + }; + (window, webview) +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/reparent.rs b/packages/tauri-app/vendor/wry-0.54.4/examples/reparent.rs new file mode 100644 index 0000000000..1b5476508d --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/examples/reparent.rs @@ -0,0 +1,111 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use tao::{ + event::{ElementState, Event, KeyEvent, WindowEvent}, + event_loop::{ControlFlow, EventLoop}, + keyboard::Key, + window::WindowBuilder, +}; +use wry::WebViewBuilder; + +#[cfg(target_os = "macos")] +use {objc2_app_kit::NSWindow, tao::platform::macos::WindowExtMacOS, wry::WebViewExtMacOS}; +#[cfg(target_os = "windows")] +use {tao::platform::windows::WindowExtWindows, wry::WebViewExtWindows}; + +#[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" +)))] +#[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" +)))] +use { + tao::platform::unix::WindowExtUnix, + wry::{WebViewBuilderExtUnix, WebViewExtUnix}, +}; + +fn main() -> wry::Result<()> { + let event_loop = EventLoop::new(); + let window = WindowBuilder::new().build(&event_loop).unwrap(); + let window2 = WindowBuilder::new().build(&event_loop).unwrap(); + + let builder = WebViewBuilder::new().with_url("https://tauri.app"); + + #[cfg(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + ))] + let webview = builder.build(&window)?; + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + )))] + let webview = { + use tao::platform::unix::WindowExtUnix; + let vbox = window.default_vbox().unwrap(); + builder.build_gtk(vbox)? + }; + + let mut webview_container = window.id(); + + event_loop.run(move |event, _event_loop, control_flow| { + *control_flow = ControlFlow::Wait; + + match event { + Event::WindowEvent { + event: WindowEvent::CloseRequested, + .. + } => *control_flow = ControlFlow::Exit, + + Event::WindowEvent { + event: + WindowEvent::KeyboardInput { + event: + KeyEvent { + logical_key: Key::Character("x"), + state: ElementState::Pressed, + .. + }, + .. + }, + .. + } => { + let new_parent = if webview_container == window.id() { + &window2 + } else { + &window + }; + webview_container = new_parent.id(); + + #[cfg(target_os = "macos")] + webview + .reparent(new_parent.ns_window() as *mut NSWindow) + .unwrap(); + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + )))] + webview + .reparent(new_parent.default_vbox().unwrap()) + .unwrap(); + #[cfg(target_os = "windows")] + webview.reparent(new_parent.hwnd()).unwrap(); + } + _ => {} + } + }); +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/simple.rs b/packages/tauri-app/vendor/wry-0.54.4/examples/simple.rs new file mode 100644 index 0000000000..6b3657338c --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/examples/simple.rs @@ -0,0 +1,71 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use tao::{ + event::{Event, WindowEvent}, + event_loop::{ControlFlow, EventLoop}, + window::WindowBuilder, +}; +use wry::WebViewBuilder; + +fn main() -> wry::Result<()> { + let event_loop = EventLoop::new(); + let window = WindowBuilder::new().build(&event_loop).unwrap(); + + let builder = WebViewBuilder::new() + .with_url("http://tauri.app") + .with_new_window_req_handler(|url, features| { + println!("new window req: {url} {features:?}"); + wry::NewWindowResponse::Allow + }); + + #[cfg(feature = "drag-drop")] + let builder = builder.with_drag_drop_handler(|e| { + match e { + wry::DragDropEvent::Enter { paths, position } => { + println!("DragEnter: {position:?} {paths:?} ") + } + wry::DragDropEvent::Over { position } => println!("DragOver: {position:?} "), + wry::DragDropEvent::Drop { paths, position } => { + println!("DragDrop: {position:?} {paths:?} ") + } + wry::DragDropEvent::Leave => println!("DragLeave"), + _ => {} + } + + true + }); + + #[cfg(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + ))] + let _webview = builder.build(&window)?; + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + )))] + let _webview = { + use tao::platform::unix::WindowExtUnix; + use wry::WebViewBuilderExtUnix; + let vbox = window.default_vbox().unwrap(); + builder.build_gtk(vbox)? + }; + + event_loop.run(move |event, _, control_flow| { + *control_flow = ControlFlow::Wait; + + if let Event::WindowEvent { + event: WindowEvent::CloseRequested, + .. + } = event + { + *control_flow = ControlFlow::Exit; + } + }); +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/streaming.rs b/packages/tauri-app/vendor/wry-0.54.4/examples/streaming.rs new file mode 100644 index 0000000000..f7e6e5abea --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/examples/streaming.rs @@ -0,0 +1,277 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +fn main() -> wry::Result<()> { + imp::main() +} + +#[cfg(not(feature = "protocol"))] +mod imp { + pub fn main() -> wry::Result<()> { + unimplemented!() + } +} + +#[cfg(feature = "protocol")] +mod imp { + + use std::{ + io::{Read, Seek, SeekFrom, Write}, + path::PathBuf, + }; + + use http::{header, StatusCode}; + use http_range::HttpRange; + use tao::{ + event::{Event, WindowEvent}, + event_loop::{ControlFlow, EventLoop}, + window::WindowBuilder, + }; + use wry::{ + http::{header::*, Request, Response}, + WebViewBuilder, + }; + + pub fn main() -> wry::Result<()> { + let event_loop = EventLoop::new(); + let window = WindowBuilder::new().build(&event_loop).unwrap(); + + let builder = WebViewBuilder::new() + .with_custom_protocol( + "wry".into(), + move |_webview_id, request| match wry_protocol(request) { + Ok(r) => r.map(Into::into), + Err(e) => http::Response::builder() + .header(CONTENT_TYPE, "text/plain") + .status(500) + .body(e.to_string().as_bytes().to_vec()) + .unwrap() + .map(Into::into), + }, + ) + .with_custom_protocol( + "stream".into(), + move |_webview_id, request| match stream_protocol(request) { + Ok(r) => r.map(Into::into), + Err(e) => http::Response::builder() + .header(CONTENT_TYPE, "text/plain") + .status(500) + .body(e.to_string().as_bytes().to_vec()) + .unwrap() + .map(Into::into), + }, + ) + // tell the webview to load the custom protocol + .with_url("wry://localhost"); + + #[cfg(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + ))] + let _webview = builder.build(&window)?; + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + )))] + let _webview = { + use tao::platform::unix::WindowExtUnix; + use wry::WebViewBuilderExtUnix; + let vbox = window.default_vbox().unwrap(); + builder.build_gtk(vbox)? + }; + + event_loop.run(move |event, _, control_flow| { + *control_flow = ControlFlow::Wait; + + if let Event::WindowEvent { + event: WindowEvent::CloseRequested, + .. + } = event + { + *control_flow = ControlFlow::Exit + } + }); + } + + fn wry_protocol( + request: Request>, + ) -> Result>, Box> { + let path = request.uri().path(); + // Read the file content from file path + let root = PathBuf::from("examples/streaming"); + let path = if path == "/" { + "index.html" + } else { + // removing leading slash + &path[1..] + }; + let content = std::fs::read(std::fs::canonicalize(root.join(path))?)?; + + // Return asset contents and mime types based on file extentions + // If you don't want to do this manually, there are some crates for you. + // Such as `infer` and `mime_guess`. + let mimetype = if path.ends_with(".html") || path == "/" { + "text/html" + } else if path.ends_with(".js") { + "text/javascript" + } else { + unimplemented!(); + }; + + Response::builder() + .header(CONTENT_TYPE, mimetype) + .body(content) + .map_err(Into::into) + } + + fn stream_protocol( + request: http::Request>, + ) -> Result>, Box> { + // skip leading `/` + let path = percent_encoding::percent_decode(&request.uri().path().as_bytes()[1..]) + .decode_utf8_lossy() + .to_string(); + + let mut file = std::fs::File::open(path)?; + + // get file length + let len = { + let old_pos = file.stream_position()?; + let len = file.seek(SeekFrom::End(0))?; + file.seek(SeekFrom::Start(old_pos))?; + len + }; + + let mut resp = Response::builder().header(CONTENT_TYPE, "video/mp4"); + + // if the webview sent a range header, we need to send a 206 in return + // Actually only macOS and Windows are supported. Linux will ALWAYS return empty headers. + let http_response = if let Some(range_header) = request.headers().get("range") { + let not_satisfiable = || { + Response::builder() + .status(StatusCode::RANGE_NOT_SATISFIABLE) + .header(header::CONTENT_RANGE, format!("bytes */{len}")) + .body(vec![]) + }; + + // parse range header + let ranges = if let Ok(ranges) = HttpRange::parse(range_header.to_str()?, len) { + ranges + .iter() + // map the output back to spec range , example: 0-499 + .map(|r| (r.start, r.start + r.length - 1)) + .collect::>() + } else { + return Ok(not_satisfiable()?); + }; + + /// The Maximum bytes we send in one range + const MAX_LEN: u64 = 1000 * 1024; + + if ranges.len() == 1 { + let &(start, mut end) = ranges.first().unwrap(); + + // check if a range is not satisfiable + // + // this should be already taken care of by HttpRange::parse + // but checking here again for extra assurance + if start >= len || end >= len || end < start { + return Ok(not_satisfiable()?); + } + + // adjust end byte for MAX_LEN + end = start + (end - start).min(len - start).min(MAX_LEN - 1); + + // calculate number of bytes needed to be read + let bytes_to_read = end + 1 - start; + + // allocate a buf with a suitable capacity + let mut buf = Vec::with_capacity(bytes_to_read as usize); + // seek the file to the starting byte + file.seek(SeekFrom::Start(start))?; + // read the needed bytes + file.take(bytes_to_read).read_to_end(&mut buf)?; + + resp = resp.header(CONTENT_RANGE, format!("bytes {start}-{end}/{len}")); + resp = resp.header(CONTENT_LENGTH, end + 1 - start); + resp = resp.status(StatusCode::PARTIAL_CONTENT); + resp.body(buf) + } else { + let mut buf = Vec::new(); + let ranges = ranges + .iter() + .filter_map(|&(start, mut end)| { + // filter out unsatisfiable ranges + // + // this should be already taken care of by HttpRange::parse + // but checking here again for extra assurance + if start >= len || end >= len || end < start { + None + } else { + // adjust end byte for MAX_LEN + end = start + (end - start).min(len - start).min(MAX_LEN - 1); + Some((start, end)) + } + }) + .collect::>(); + + let boundary = random_boundary(); + let boundary_sep = format!("\r\n--{boundary}\r\n"); + let boundary_closer = format!("\r\n--{boundary}\r\n"); + + resp = resp.header( + CONTENT_TYPE, + format!("multipart/byteranges; boundary={boundary}"), + ); + + for (end, start) in ranges { + // a new range is being written, write the range boundary + buf.write_all(boundary_sep.as_bytes())?; + + // write the needed headers `Content-Type` and `Content-Range` + buf.write_all(format!("{CONTENT_TYPE}: video/mp4\r\n").as_bytes())?; + buf.write_all(format!("{CONTENT_RANGE}: bytes {start}-{end}/{len}\r\n").as_bytes())?; + + // write the separator to indicate the start of the range body + buf.write_all("\r\n".as_bytes())?; + + // calculate number of bytes needed to be read + let bytes_to_read = end + 1 - start; + + let mut local_buf = vec![0_u8; bytes_to_read as usize]; + file.seek(SeekFrom::Start(start))?; + file.read_exact(&mut local_buf)?; + buf.extend_from_slice(&local_buf); + } + // all ranges have been written, write the closing boundary + buf.write_all(boundary_closer.as_bytes())?; + + resp.body(buf) + } + } else { + resp = resp.header(CONTENT_LENGTH, len); + let mut buf = Vec::with_capacity(len as usize); + file.read_to_end(&mut buf)?; + resp.body(buf) + }; + + http_response.map_err(Into::into) + } + + fn random_boundary() -> String { + let mut x = [0_u8; 30]; + getrandom::fill(&mut x).expect("failed to get random bytes"); + (x[..]) + .iter() + .map(|&x| format!("{x:x}")) + .fold(String::new(), |mut a, x| { + a.push_str(x.as_str()); + a + }) + } +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/streaming/index.html b/packages/tauri-app/vendor/wry-0.54.4/examples/streaming/index.html new file mode 100644 index 0000000000..547cef0d82 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/examples/streaming/index.html @@ -0,0 +1,38 @@ + + + + + + Document + + +

Enter a path to a video to play, then hit Enter or click Start

+
+ + +
+ + + + + diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/transparent.rs b/packages/tauri-app/vendor/wry-0.54.4/examples/transparent.rs new file mode 100644 index 0000000000..0802012dc7 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/examples/transparent.rs @@ -0,0 +1,80 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use tao::{ + event::{Event, WindowEvent}, + event_loop::{ControlFlow, EventLoop}, + window::WindowBuilder, +}; +use wry::WebViewBuilder; + +fn main() -> wry::Result<()> { + let event_loop = EventLoop::new(); + #[allow(unused_mut)] + let mut builder = WindowBuilder::new() + .with_decorations(false) + // There are actually three layer of background color when creating webview window. + // The first is window background... + .with_transparent(true); + #[cfg(target_os = "windows")] + { + use tao::platform::windows::WindowBuilderExtWindows; + builder = builder.with_undecorated_shadow(false); + } + let window = builder.build(&event_loop).unwrap(); + + #[cfg(target_os = "windows")] + { + use tao::platform::windows::WindowExtWindows; + window.set_undecorated_shadow(true); + } + + let builder = WebViewBuilder::new() + // The second is on webview... + // Feature `transparent` is required for transparency to work. + .with_transparent(true) + // And the last is in html. + .with_html( + r#" + + + "#, + ); + + #[cfg(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + ))] + let _webview = builder.build(&window)?; + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + )))] + let _webview = { + use tao::platform::unix::WindowExtUnix; + use wry::WebViewBuilderExtUnix; + let vbox = window.default_vbox().unwrap(); + builder.build_gtk(vbox)? + }; + + event_loop.run(move |event, _, control_flow| { + *control_flow = ControlFlow::Wait; + + if let Event::WindowEvent { + event: WindowEvent::CloseRequested, + .. + } = event + { + *control_flow = ControlFlow::Exit + } + }); +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/wgpu.rs b/packages/tauri-app/vendor/wry-0.54.4/examples/wgpu.rs new file mode 100644 index 0000000000..2b9ce1ea3f --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/examples/wgpu.rs @@ -0,0 +1,273 @@ +use std::{borrow::Cow, sync::Arc}; +use winit::{ + application::ApplicationHandler, + event::WindowEvent, + event_loop::{ActiveEventLoop, EventLoop}, + window::{Window, WindowId}, +}; +use wry::{ + dpi::{LogicalPosition, LogicalSize}, + Rect, WebViewBuilder, +}; + +#[derive(Default)] +struct State { + window: Option>, + webview: Option, + gfx_state: Option, +} + +struct GfxState { + surface: wgpu::Surface<'static>, + device: wgpu::Device, + queue: wgpu::Queue, + config: wgpu::SurfaceConfiguration, + render_pipeline: wgpu::RenderPipeline, +} + +impl GfxState { + fn new(window: Arc) -> Self { + let instance = wgpu::Instance::default(); + let window_size = window.inner_size(); + let surface = instance.create_surface(window).unwrap(); + + let adapter = pollster::block_on(instance.request_adapter(&wgpu::RequestAdapterOptions { + power_preference: wgpu::PowerPreference::default(), + force_fallback_adapter: false, + compatible_surface: Some(&surface), + })) + .expect("Failed to find an appropriate adapter"); + + let (device, queue) = pollster::block_on(adapter.request_device( + &wgpu::DeviceDescriptor { + label: None, + required_features: wgpu::Features::empty(), + required_limits: + wgpu::Limits::downlevel_webgl2_defaults().using_resolution(adapter.limits()), + memory_hints: wgpu::MemoryHints::Performance, + }, + None, + )) + .expect("Failed to create device"); + + let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor { + label: None, + source: wgpu::ShaderSource::Wgsl(Cow::Borrowed( + r#" + @vertex + fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> @builtin(position) vec4 { + let x = f32(i32(in_vertex_index) - 1); + let y = f32(i32(in_vertex_index & 1u) * 2 - 1); + return vec4(x, y, 0.0, 1.0); + } + + @fragment + fn fs_main() -> @location(0) vec4 { + return vec4(1.0, 0.0, 0.0, 1.0); + } + "#, + )), + }); + + let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { + label: None, + bind_group_layouts: &[], + push_constant_ranges: &[], + }); + + let swapchain_capabilities = surface.get_capabilities(&adapter); + let swapchain_format = swapchain_capabilities.formats[0]; + + let render_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { + label: None, + layout: Some(&pipeline_layout), + vertex: wgpu::VertexState { + module: &shader, + entry_point: Some("vs_main"), + buffers: &[], + compilation_options: Default::default(), + }, + fragment: Some(wgpu::FragmentState { + module: &shader, + entry_point: Some("fs_main"), + targets: &[Some(swapchain_format.into())], + compilation_options: Default::default(), + }), + primitive: wgpu::PrimitiveState::default(), + depth_stencil: None, + multisample: wgpu::MultisampleState::default(), + multiview: None, + cache: None, + }); + + let config = wgpu::SurfaceConfiguration { + usage: wgpu::TextureUsages::RENDER_ATTACHMENT, + format: swapchain_format, + width: window_size.width, + height: window_size.height, + present_mode: wgpu::PresentMode::Fifo, + desired_maximum_frame_latency: 2, + alpha_mode: swapchain_capabilities.alpha_modes[0], + view_formats: vec![], + }; + + surface.configure(&device, &config); + + Self { + surface, + device, + queue, + config, + render_pipeline, + } + } + + fn render(&mut self) { + let frame = self + .surface + .get_current_texture() + .expect("Failed to acquire next swap chain texture"); + let view = frame + .texture + .create_view(&wgpu::TextureViewDescriptor::default()); + let mut encoder = self + .device + .create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None }); + { + let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { + label: None, + color_attachments: &[Some(wgpu::RenderPassColorAttachment { + view: &view, + resolve_target: None, + ops: wgpu::Operations { + load: wgpu::LoadOp::Clear(wgpu::Color::TRANSPARENT), + store: wgpu::StoreOp::Store, + }, + })], + depth_stencil_attachment: None, + timestamp_writes: None, + occlusion_query_set: None, + }); + render_pass.set_pipeline(&self.render_pipeline); + render_pass.draw(0..3, 0..1); + } + + self.queue.submit(Some(encoder.finish())); + frame.present(); + } +} + +impl ApplicationHandler for State { + fn resumed(&mut self, event_loop: &ActiveEventLoop) { + let mut attributes = Window::default_attributes(); + attributes.transparent = true; + #[cfg(windows)] + { + use winit::platform::windows::WindowAttributesExtWindows; + attributes = attributes.with_clip_children(false); + } + + let window = Arc::new(event_loop.create_window(attributes).unwrap()); + + let gfx_state = GfxState::new(Arc::clone(&window)); + + let webview = WebViewBuilder::new() + .with_bounds(Rect { + position: LogicalPosition::new(100, 100).into(), + size: LogicalSize::new(200, 200).into(), + }) + .with_transparent(true) + .with_html( + r#" + + + "#, + ) + .build_as_child(&window) + .unwrap(); + + window.request_redraw(); + + self.window = Some(window); + self.webview = Some(webview); + self.gfx_state = Some(gfx_state); + } + + fn window_event( + &mut self, + _event_loop: &ActiveEventLoop, + _window_id: WindowId, + event: WindowEvent, + ) { + match event { + WindowEvent::Resized(size) => { + if let Some(gfx_state) = &mut self.gfx_state { + gfx_state.config.width = size.width; + gfx_state.config.height = size.height; + gfx_state + .surface + .configure(&gfx_state.device, &gfx_state.config); + + if let Some(window) = &self.window { + window.request_redraw(); + } + } + } + WindowEvent::RedrawRequested => { + if let Some(gfx_state) = &mut self.gfx_state { + gfx_state.render(); + } + } + WindowEvent::CloseRequested => { + std::process::exit(0); + } + _ => {} + } + } + + fn about_to_wait(&mut self, _event_loop: &ActiveEventLoop) { + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd", + ))] + { + while gtk::events_pending() { + gtk::main_iteration_do(false); + } + } + } +} + +fn main() { + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd", + ))] + { + use gtk::prelude::DisplayExtManual; + + gtk::init().unwrap(); + if gtk::gdk::Display::default().unwrap().backend().is_wayland() { + panic!("This example doesn't support wayland!"); + } + + winit::platform::x11::register_xlib_error_hook(Box::new(|_display, error| { + let error = error as *mut x11_dl::xlib::XErrorEvent; + (unsafe { (*error).error_code }) == 170 + })); + } + + let event_loop = EventLoop::new().unwrap(); + let mut state = State::default(); + event_loop.run_app(&mut state).unwrap(); +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/window_border.rs b/packages/tauri-app/vendor/wry-0.54.4/examples/window_border.rs new file mode 100644 index 0000000000..2520caf4e2 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/examples/window_border.rs @@ -0,0 +1,122 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use dpi::LogicalSize; +use tao::{ + event::{Event, StartCause, WindowEvent}, + event_loop::{ControlFlow, EventLoopBuilder}, + window::WindowBuilder, +}; +use wry::{http::Request, WebViewBuilder}; + +#[derive(Debug)] +enum UserEvent { + TogglShadows, +} + +fn main() -> wry::Result<()> { + let event_loop = EventLoopBuilder::::with_user_event().build(); + let window = WindowBuilder::new() + .with_inner_size(LogicalSize::new(500, 500)) + .with_decorations(false) + .build(&event_loop) + .unwrap(); + + const HTML: &str = r#" + + + + + + + +

+ Click the window to toggle shadows. +

+ + + + + +"#; + + let proxy = event_loop.create_proxy(); + let handler = move |req: Request| { + if req.body().as_str() == "toggleShadows" { + proxy.send_event(UserEvent::TogglShadows).unwrap(); + } + }; + + let builder = WebViewBuilder::new() + .with_html(HTML) + .with_ipc_handler(handler) + .with_accept_first_mouse(true); + + #[cfg(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + ))] + let webview = builder.build(&window)?; + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + )))] + let webview = { + use tao::platform::unix::WindowExtUnix; + use wry::WebViewBuilderExtUnix; + let vbox = window.default_vbox().unwrap(); + builder.build_gtk(vbox)? + }; + + let mut webview = Some(webview); + + let mut shadow = true; + + event_loop.run(move |event, _, control_flow| { + *control_flow = ControlFlow::Wait; + + match event { + Event::NewEvents(StartCause::Init) => println!("Wry application started!"), + Event::WindowEvent { + event: WindowEvent::CloseRequested, + .. + } => { + let _ = webview.take(); + *control_flow = ControlFlow::Exit + } + + Event::UserEvent(e) => match e { + UserEvent::TogglShadows => { + shadow = !shadow; + #[cfg(windows)] + { + use tao::platform::windows::WindowExtWindows; + window.set_undecorated_shadow(shadow); + } + } + }, + _ => (), + } + }); +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/examples/winit.rs b/packages/tauri-app/vendor/wry-0.54.4/examples/winit.rs new file mode 100644 index 0000000000..7299487009 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/examples/winit.rs @@ -0,0 +1,100 @@ +use dpi::{LogicalPosition, LogicalSize}; +use winit::{ + application::ApplicationHandler, + event::WindowEvent, + event_loop::{ActiveEventLoop, EventLoop}, + window::{Window, WindowId}, +}; +use wry::{Rect, WebViewBuilder}; + +#[derive(Default)] +struct State { + window: Option, + webview: Option, +} + +impl ApplicationHandler for State { + fn resumed(&mut self, event_loop: &ActiveEventLoop) { + let mut attributes = Window::default_attributes(); + attributes.inner_size = Some(LogicalSize::new(800, 800).into()); + let window = event_loop.create_window(attributes).unwrap(); + + let webview = WebViewBuilder::new() + .with_url("https://tauri.app") + .build_as_child(&window) + .unwrap(); + + self.window = Some(window); + self.webview = Some(webview); + } + + fn window_event( + &mut self, + _event_loop: &ActiveEventLoop, + _window_id: WindowId, + event: WindowEvent, + ) { + match event { + WindowEvent::Resized(size) => { + let window = self.window.as_ref().unwrap(); + let webview = self.webview.as_ref().unwrap(); + + let size = size.to_logical::(window.scale_factor()); + webview + .set_bounds(Rect { + position: LogicalPosition::new(0, 0).into(), + size: LogicalSize::new(size.width, size.height).into(), + }) + .unwrap(); + } + WindowEvent::CloseRequested => { + std::process::exit(0); + } + _ => {} + } + } + + fn about_to_wait(&mut self, _event_loop: &ActiveEventLoop) { + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd", + ))] + { + while gtk::events_pending() { + gtk::main_iteration_do(false); + } + } + } +} + +fn main() -> wry::Result<()> { + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd", + ))] + { + use gtk::prelude::DisplayExtManual; + + gtk::init().unwrap(); + if gtk::gdk::Display::default().unwrap().backend().is_wayland() { + panic!("This example doesn't support wayland!"); + } + + winit::platform::x11::register_xlib_error_hook(Box::new(|_display, error| { + let error = error as *mut x11_dl::xlib::XErrorEvent; + (unsafe { (*error).error_code }) == 170 + })); + } + + let event_loop = EventLoop::new().unwrap(); + let mut state = State::default(); + event_loop.run_app(&mut state).unwrap(); + + Ok(()) +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/renovate.json b/packages/tauri-app/vendor/wry-0.54.4/renovate.json new file mode 100644 index 0000000000..e0493a29a7 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/renovate.json @@ -0,0 +1,10 @@ +{ + "extends": ["config:recommended"], + "rangeStrategy": "replace", + "packageRules": [ + { + "semanticCommitType": "chore", + "matchPackageNames": ["*"] + } + ] +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/rustfmt.toml b/packages/tauri-app/vendor/wry-0.54.4/rustfmt.toml new file mode 100644 index 0000000000..a90653d108 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/rustfmt.toml @@ -0,0 +1,15 @@ +max_width = 100 +hard_tabs = false +tab_spaces = 2 +newline_style = "Unix" +use_small_heuristics = "Default" +reorder_imports = true +reorder_modules = true +remove_nested_parens = true +edition = "2018" +merge_derives = true +use_try_shorthand = false +use_field_init_shorthand = false +force_explicit_abi = true +imports_granularity = "Crate" +#license_template_path = ".license_template" diff --git a/packages/tauri-app/vendor/wry-0.54.4/src/android/binding.rs b/packages/tauri-app/vendor/wry-0.54.4/src/android/binding.rs new file mode 100644 index 0000000000..8e71568344 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/src/android/binding.rs @@ -0,0 +1,415 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use http::{ + header::{HeaderName, HeaderValue, CONTENT_LENGTH, CONTENT_TYPE}, + Request, +}; +use jni::errors::Result as JniResult; +pub use jni::{ + self, + objects::{GlobalRef, JClass, JMap, JObject, JString}, + sys::{jboolean, jint, jobject, jstring}, + JNIEnv, +}; +pub use ndk; + +use super::{ + ASSET_LOADER_DOMAIN, EVAL_CALLBACKS, IPC, ON_LOAD_HANDLER, REQUEST_HANDLER, TITLE_CHANGE_HANDLER, + URL_LOADING_OVERRIDE, WITH_ASSET_LOADER, +}; + +use crate::PageLoadEvent; + +#[macro_export] +macro_rules! android_binding { + ($domain:ident, $package:ident) => { + ::wry::android_binding!($domain, $package, ::wry) + }; + // use imported `android_setup` just to force the import path to use `wry::{}` + // as the macro breaks without braces + ($domain:ident, $package:ident, $wry:path) => {{ + use $wry::{android_setup as _, prelude::*}; + + android_fn!($domain, $package, WryActivity, onActivityDestroy, [JObject]); + + android_fn!( + $domain, + $package, + RustWebViewClient, + handleRequest, + [JString, JObject, jboolean], + jobject + ); + android_fn!( + $domain, + $package, + RustWebViewClient, + withAssetLoader, + [], + jboolean + ); + android_fn!( + $domain, + $package, + RustWebViewClient, + assetLoaderDomain, + [], + jstring + ); + android_fn!( + $domain, + $package, + RustWebViewClient, + shouldOverride, + [JString], + jboolean + ); + android_fn!( + $domain, + $package, + RustWebView, + shouldOverride, + [JString], + jboolean + ); + android_fn!($domain, $package, RustWebView, onEval, [jint, JString]); + android_fn!( + $domain, + $package, + RustWebViewClient, + onPageLoading, + [JString] + ); + android_fn!( + $domain, + $package, + RustWebViewClient, + onPageLoaded, + [JString] + ); + android_fn!($domain, $package, Ipc, ipc, [JString, JString]); + android_fn!( + $domain, + $package, + RustWebChromeClient, + handleReceivedTitle, + [JObject, JString], + ); + }}; +} + +fn handle_request( + env: &mut JNIEnv, + webview_id: JString, + request: JObject, + is_document_start_script_enabled: jboolean, +) -> JniResult { + if let Some(handler) = REQUEST_HANDLER.lock().unwrap().as_ref() { + #[cfg(feature = "tracing")] + let span = + tracing::info_span!(parent: None, "wry::custom_protocol::handle", uri = tracing::field::Empty).entered(); + + let mut request_builder = Request::builder(); + + let uri = env + .call_method(&request, "getUrl", "()Landroid/net/Uri;", &[])? + .l()?; + let url: JString = env + .call_method(&uri, "toString", "()Ljava/lang/String;", &[])? + .l()? + .into(); + let url = env.get_string(&url)?.to_string_lossy().to_string(); + + #[cfg(feature = "tracing")] + span.record("uri", &url); + + request_builder = request_builder.uri(&url); + + let method = env + .call_method(&request, "getMethod", "()Ljava/lang/String;", &[])? + .l() + .map(JString::from)?; + request_builder = request_builder.method( + env + .get_string(&method)? + .to_string_lossy() + .to_string() + .as_str(), + ); + + let request_headers = env + .call_method(request, "getRequestHeaders", "()Ljava/util/Map;", &[])? + .l()?; + let request_headers = JMap::from_env(env, &request_headers)?; + let mut iter = request_headers.iter(env)?; + while let Some((header, value)) = iter.next(env)? { + let header = JString::from(header); + let value = JString::from(value); + let header = env.get_string(&header)?; + let value = env.get_string(&value)?; + if let (Ok(header), Ok(value)) = ( + HeaderName::from_bytes(header.to_bytes()), + HeaderValue::from_bytes(value.to_bytes()), + ) { + request_builder = request_builder.header(header, value); + } + } + + let final_request = match request_builder.body(Vec::new()) { + Ok(req) => req, + Err(e) => { + #[cfg(feature = "tracing")] + tracing::warn!("Failed to build response: {}", e); + return Ok(*JObject::null()); + } + }; + + let webview_id = env.get_string(&webview_id)?; + let webview_id = webview_id.to_str().ok().unwrap_or_default(); + + let response = { + #[cfg(feature = "tracing")] + let _span = tracing::info_span!("wry::custom_protocol::call_handler").entered(); + (handler.handler)( + webview_id, + final_request, + is_document_start_script_enabled != 0, + ) + }; + if let Some(response) = response { + let status = response.status(); + let status_code = status.as_u16() as i32; + let status_err = if status_code < 100 { + Some("Status code can't be less than 100") + } else if status_code > 599 { + Some("statusCode can't be greater than 599.") + } else if status_code > 299 && status_code < 400 { + Some("statusCode can't be in the [300, 399] range.") + } else { + None + }; + if let Some(err) = status_err { + #[cfg(feature = "tracing")] + tracing::warn!("{}", err); + return Ok(*JObject::null()); + } + + let reason_phrase = status.canonical_reason().unwrap_or("OK"); + let (mime_type, encoding) = if let Some(content_type) = response.headers().get(CONTENT_TYPE) { + let content_type = content_type.to_str().unwrap().trim(); + let mut s = content_type.split(';'); + let mime_type = s.next().unwrap().trim(); + let mut encoding = None; + for token in s { + let token = token.trim(); + if token.starts_with("charset=") { + encoding.replace(token.split('=').nth(1).unwrap()); + break; + } + } + ( + env.new_string(mime_type)?, + if let Some(encoding) = encoding { + env.new_string(encoding)? + } else { + JString::default() + }, + ) + } else { + (JString::default(), JString::default()) + }; + + let headers = response.headers(); + let obj = env.new_object("java/util/HashMap", "()V", &[])?; + let response_headers = { + let headers_map = JMap::from_env(env, &obj)?; + for (name, value) in headers.iter() { + // WebResourceResponse will automatically generate Content-Type and + // Content-Length headers so we should skip them to avoid duplication. + if name == CONTENT_TYPE || name == CONTENT_LENGTH { + continue; + } + let key = env.new_string(name)?; + let value = env.new_string(value.to_str().unwrap_or_default())?; + headers_map.put(env, &key, &value)?; + } + headers_map + }; + + let bytes = response.body(); + + let byte_array_input_stream = env.find_class("java/io/ByteArrayInputStream")?; + let byte_array = env.byte_array_from_slice(bytes)?; + let stream = env.new_object(byte_array_input_stream, "([B)V", &[(&byte_array).into()])?; + + let reason_phrase = env.new_string(reason_phrase)?; + + let web_resource_response_class = env.find_class("android/webkit/WebResourceResponse")?; + let web_resource_response = env.new_object( + web_resource_response_class, + "(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/util/Map;Ljava/io/InputStream;)V", + &[(&mime_type).into(), (&encoding).into(), status_code.into(), (&reason_phrase).into(), (&response_headers).into(), (&stream).into()], + )?; + + return Ok(*web_resource_response); + } + } + + Ok(*JObject::null()) +} + +#[allow(non_snake_case)] +pub unsafe fn onActivityDestroy(_: JNIEnv, _: JClass, _: JObject) { + super::MainPipe::send(super::WebViewMessage::OnDestroy); +} + +#[allow(non_snake_case)] +pub unsafe fn handleRequest( + mut env: JNIEnv, + _: JClass, + webview_id: JString, + request: JObject, + is_document_start_script_enabled: jboolean, +) -> jobject { + match handle_request( + &mut env, + webview_id, + request, + is_document_start_script_enabled, + ) { + Ok(response) => response, + Err(e) => { + #[cfg(feature = "tracing")] + tracing::warn!("Failed to handle request: {}", e); + JObject::null().as_raw() + } + } +} + +#[allow(non_snake_case)] +pub unsafe fn shouldOverride(mut env: JNIEnv, _: JClass, url: JString) -> jboolean { + match env.get_string(&url) { + Ok(url) => { + let url = url.to_string_lossy().to_string(); + URL_LOADING_OVERRIDE + .lock() + .unwrap() + .as_ref() + // We negate the result of the function because the logic for the android + // client is different from how the navigation_handler is defined. + // + // https://developer.android.com/reference/android/webkit/WebViewClient#shouldOverrideUrlLoading(android.webkit.WebView,%20android.webkit.WebResourceRequest) + .map(|f| !(f.handler)(url)) + .unwrap_or(false) + } + Err(e) => { + #[cfg(feature = "tracing")] + tracing::warn!("Failed to parse JString: {}", e); + false + } + } + .into() +} + +#[allow(non_snake_case)] +pub unsafe fn onEval(mut env: JNIEnv, _: JClass, id: jint, result: JString) { + match env.get_string(&result) { + Ok(result) => { + if let Some(cb) = EVAL_CALLBACKS + .get_or_init(Default::default) + .lock() + .unwrap() + .get(&id) + { + cb(result.into()); + } + } + Err(e) => { + #[cfg(feature = "tracing")] + tracing::warn!("Failed to parse JString: {}", e); + } + } +} + +pub unsafe fn ipc(mut env: JNIEnv, _: JClass, url: JString, body: JString) { + match (env.get_string(&url), env.get_string(&body)) { + (Ok(url), Ok(body)) => { + #[cfg(feature = "tracing")] + let _span = tracing::info_span!(parent: None, "wry::ipc::handle").entered(); + + let url = url.to_string_lossy().to_string(); + let body = body.to_string_lossy().to_string(); + if let Some(ipc) = IPC.lock().unwrap().as_ref() { + (ipc.handler)(Request::builder().uri(url).body(body).unwrap()) + } + } + (Err(e), _) | (_, Err(e)) => { + #[cfg(feature = "tracing")] + tracing::warn!("Failed to parse JString: {}", e) + } + } +} + +#[allow(non_snake_case)] +pub unsafe fn handleReceivedTitle(mut env: JNIEnv, _: JClass, _webview: JObject, title: JString) { + match env.get_string(&title) { + Ok(title) => { + let title = title.to_string_lossy().to_string(); + if let Some(title_handler) = TITLE_CHANGE_HANDLER.lock().unwrap().as_ref() { + (title_handler.handler)(title) + } + } + Err(e) => { + #[cfg(feature = "tracing")] + tracing::warn!("Failed to parse JString: {}", e) + } + } +} + +#[allow(non_snake_case)] +pub unsafe fn withAssetLoader(_: JNIEnv, _: JClass) -> jboolean { + (*WITH_ASSET_LOADER.lock().unwrap().as_ref().unwrap_or(&false)).into() +} + +#[allow(non_snake_case)] +pub unsafe fn assetLoaderDomain(env: JNIEnv, _: JClass) -> jstring { + if let Some(domain) = ASSET_LOADER_DOMAIN.lock().unwrap().as_ref() { + env.new_string(domain).unwrap().as_raw() + } else { + env.new_string("wry.assets").unwrap().as_raw() + } +} + +#[allow(non_snake_case)] +pub unsafe fn onPageLoading(mut env: JNIEnv, _: JClass, url: JString) { + match env.get_string(&url) { + Ok(url) => { + let url = url.to_string_lossy().to_string(); + if let Some(on_load) = ON_LOAD_HANDLER.lock().unwrap().as_ref() { + (on_load.handler)(PageLoadEvent::Started, url) + } + } + Err(e) => { + #[cfg(feature = "tracing")] + tracing::warn!("Failed to parse JString: {}", e) + } + } +} + +#[allow(non_snake_case)] +pub unsafe fn onPageLoaded(mut env: JNIEnv, _: JClass, url: JString) { + match env.get_string(&url) { + Ok(url) => { + let url = url.to_string_lossy().to_string(); + if let Some(on_load) = ON_LOAD_HANDLER.lock().unwrap().as_ref() { + (on_load.handler)(PageLoadEvent::Finished, url) + } + } + Err(e) => { + #[cfg(feature = "tracing")] + tracing::warn!("Failed to parse JString: {}", e) + } + } +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/Ipc.kt b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/Ipc.kt new file mode 100644 index 0000000000..e8f87612f7 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/Ipc.kt @@ -0,0 +1,31 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +@file:Suppress("unused") + +package {{package}} + +import android.webkit.* + +class Ipc(val webViewClient: RustWebViewClient) { + @JavascriptInterface + fun postMessage(message: String?) { + message?.let {m -> + // we're not using WebView::getUrl() here because it needs to be executed on the main thread + // and it would slow down the Ipc + // so instead we track the current URL on the webview client + this.ipc(webViewClient.currentUrl, m) + } + } + + companion object { + init { + System.loadLibrary("{{library}}") + } + } + + private external fun ipc(url: String, message: String) + + {{class-extension}} +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/Logger.kt b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/Logger.kt new file mode 100644 index 0000000000..3666ad2aac --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/Logger.kt @@ -0,0 +1,87 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +@file:Suppress("unused", "MemberVisibilityCanBePrivate") + +package {{package}} + +// taken from https://github.com/ionic-team/capacitor/blob/6658bca41e78239347e458175b14ca8bd5c1d6e8/android/capacitor/src/main/java/com/getcapacitor/Logger.java + +import android.text.TextUtils +import android.util.Log + +class Logger { + companion object { + private const val LOG_TAG_CORE = "Tauri" + + fun tags(vararg subtags: String): String { + return if (subtags.isNotEmpty()) { + LOG_TAG_CORE + "/" + TextUtils.join("/", subtags) + } else LOG_TAG_CORE + } + + fun verbose(message: String) { + verbose(LOG_TAG_CORE, message) + } + + private fun verbose(tag: String, message: String) { + if (!shouldLog()) { + return + } + Log.v(tag, message) + } + + fun debug(message: String) { + debug(LOG_TAG_CORE, message) + } + + fun debug(tag: String, message: String) { + if (!shouldLog()) { + return + } + Log.d(tag, message) + } + + fun info(message: String) { + info(LOG_TAG_CORE, message) + } + + fun info(tag: String, message: String) { + if (!shouldLog()) { + return + } + Log.i(tag, message) + } + + fun warn(message: String) { + warn(LOG_TAG_CORE, message) + } + + fun warn(tag: String, message: String) { + if (!shouldLog()) { + return + } + Log.w(tag, message) + } + + fun error(message: String) { + error(LOG_TAG_CORE, message, null) + } + + fun error(message: String, e: Throwable?) { + error(LOG_TAG_CORE, message, e) + } + + fun error(tag: String, message: String, e: Throwable?) { + if (!shouldLog()) { + return + } + Log.e(tag, message, e) + } + + private fun shouldLog(): Boolean { + return BuildConfig.DEBUG + } + } +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/PermissionHelper.kt b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/PermissionHelper.kt new file mode 100644 index 0000000000..b2471e515e --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/PermissionHelper.kt @@ -0,0 +1,115 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package {{package}} + +// taken from https://github.com/ionic-team/capacitor/blob/6658bca41e78239347e458175b14ca8bd5c1d6e8/android/capacitor/src/main/java/com/getcapacitor/PermissionHelper.java + +import android.content.Context +import android.content.pm.PackageManager +import android.os.Build +import androidx.core.app.ActivityCompat +import java.util.ArrayList + +object PermissionHelper { + /** + * Checks if a list of given permissions are all granted by the user + * + * @param permissions Permissions to check. + * @return True if all permissions are granted, false if at least one is not. + */ + fun hasPermissions(context: Context?, permissions: Array): Boolean { + for (perm in permissions) { + if (ActivityCompat.checkSelfPermission( + context!!, + perm + ) != PackageManager.PERMISSION_GRANTED + ) { + return false + } + } + return true + } + + /** + * Check whether the given permission has been defined in the AndroidManifest.xml + * + * @param permission A permission to check. + * @return True if the permission has been defined in the Manifest, false if not. + */ + fun hasDefinedPermission(context: Context, permission: String): Boolean { + var hasPermission = false + val requestedPermissions = getManifestPermissions(context) + if (!requestedPermissions.isNullOrEmpty()) { + val requestedPermissionsList = listOf(*requestedPermissions) + val requestedPermissionsArrayList = ArrayList(requestedPermissionsList) + if (requestedPermissionsArrayList.contains(permission)) { + hasPermission = true + } + } + return hasPermission + } + + /** + * Check whether all of the given permissions have been defined in the AndroidManifest.xml + * @param context the app context + * @param permissions a list of permissions + * @return true only if all permissions are defined in the AndroidManifest.xml + */ + fun hasDefinedPermissions(context: Context, permissions: Array): Boolean { + for (permission in permissions) { + if (!hasDefinedPermission(context, permission)) { + return false + } + } + return true + } + + /** + * Get the permissions defined in AndroidManifest.xml + * + * @return The permissions defined in AndroidManifest.xml + */ + private fun getManifestPermissions(context: Context): Array? { + var requestedPermissions: Array? = null + try { + val pm = context.packageManager + val packageInfo = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + pm.getPackageInfo(context.packageName, PackageManager.PackageInfoFlags.of(PackageManager.GET_PERMISSIONS.toLong())) + } else { + @Suppress("DEPRECATION") + pm.getPackageInfo(context.packageName, PackageManager.GET_PERMISSIONS) + } + if (packageInfo != null) { + requestedPermissions = packageInfo.requestedPermissions + } + } catch (_: Exception) { + } + return requestedPermissions + } + + /** + * Given a list of permissions, return a new list with the ones not present in AndroidManifest.xml + * + * @param neededPermissions The permissions needed. + * @return The permissions not present in AndroidManifest.xml + */ + fun getUndefinedPermissions(context: Context, neededPermissions: Array): Array { + val undefinedPermissions = ArrayList() + val requestedPermissions = getManifestPermissions(context) + if (!requestedPermissions.isNullOrEmpty()) { + val requestedPermissionsList = listOf(*requestedPermissions) + val requestedPermissionsArrayList = ArrayList(requestedPermissionsList) + for (permission in neededPermissions) { + if (!requestedPermissionsArrayList.contains(permission)) { + undefinedPermissions.add(permission) + } + } + var undefinedPermissionArray = arrayOfNulls(undefinedPermissions.size) + undefinedPermissionArray = undefinedPermissions.toArray(undefinedPermissionArray) + return undefinedPermissionArray + } + return neededPermissions + } +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/RustWebChromeClient.kt b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/RustWebChromeClient.kt new file mode 100644 index 0000000000..b89192602c --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/RustWebChromeClient.kt @@ -0,0 +1,493 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +@file:Suppress("ObsoleteSdkInt", "RedundantOverride", "QueryPermissionsNeeded", "SimpleDateFormat") + +package {{package}} + +// taken from https://github.com/ionic-team/capacitor/blob/6658bca41e78239347e458175b14ca8bd5c1d6e8/android/capacitor/src/main/java/com/getcapacitor/BridgeWebChromeClient.java + +import android.Manifest +import android.app.Activity +import android.app.AlertDialog +import android.content.ActivityNotFoundException +import android.content.DialogInterface +import android.content.Intent +import android.net.Uri +import android.os.Build +import android.os.Environment +import android.provider.MediaStore +import android.view.View +import android.webkit.* +import android.widget.EditText +import androidx.activity.result.ActivityResult +import androidx.activity.result.ActivityResultCallback +import androidx.activity.result.ActivityResultLauncher +import androidx.activity.result.contract.ActivityResultContracts +import androidx.core.content.FileProvider +import java.io.File +import java.io.IOException +import java.text.SimpleDateFormat +import java.util.* + +class RustWebChromeClient(appActivity: WryActivity) : WebChromeClient() { + private interface PermissionListener { + fun onPermissionSelect(isGranted: Boolean?) + } + + private interface ActivityResultListener { + fun onActivityResult(result: ActivityResult?) + } + + private val activity: WryActivity + private var permissionLauncher: ActivityResultLauncher> + private var activityLauncher: ActivityResultLauncher + private var permissionListener: PermissionListener? = null + private var activityListener: ActivityResultListener? = null + + init { + activity = appActivity + val permissionCallback = + ActivityResultCallback { isGranted: Map -> + if (permissionListener != null) { + var granted = true + for ((_, value) in isGranted) { + if (!value) granted = false + } + permissionListener!!.onPermissionSelect(granted) + } + } + permissionLauncher = + activity.registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions(), permissionCallback) + activityLauncher = activity.registerForActivityResult( + ActivityResultContracts.StartActivityForResult() + ) { result -> + if (activityListener != null) { + activityListener!!.onActivityResult(result) + } + } + } + + /** + * Render web content in `view`. + * + * Both this method and [.onHideCustomView] are required for + * rendering web content in full screen. + * + * @see [](https://developer.android.com/reference/android/webkit/WebChromeClient.onShowCustomView + ) */ + override fun onShowCustomView(view: View, callback: CustomViewCallback) { + callback.onCustomViewHidden() + super.onShowCustomView(view, callback) + } + + /** + * Render web content in the original Web View again. + * + * Do not remove this method--@see #onShowCustomView(View, CustomViewCallback). + */ + override fun onHideCustomView() { + super.onHideCustomView() + } + + override fun onPermissionRequest(request: PermissionRequest) { + val isRequestPermissionRequired = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M + val permissionList: MutableList = ArrayList() + if (listOf(*request.resources).contains("android.webkit.resource.VIDEO_CAPTURE")) { + permissionList.add(Manifest.permission.CAMERA) + } + if (listOf(*request.resources).contains("android.webkit.resource.AUDIO_CAPTURE")) { + permissionList.add(Manifest.permission.MODIFY_AUDIO_SETTINGS) + permissionList.add(Manifest.permission.RECORD_AUDIO) + } + if (permissionList.isNotEmpty() && isRequestPermissionRequired) { + val permissions = permissionList.toTypedArray() + permissionListener = object : PermissionListener { + override fun onPermissionSelect(isGranted: Boolean?) { + if (isGranted == true) { + request.grant(request.resources) + } else { + request.deny() + } + } + } + permissionLauncher.launch(permissions) + } else { + request.grant(request.resources) + } + } + + /** + * Show the browser alert modal + * @param view + * @param url + * @param message + * @param result + * @return + */ + override fun onJsAlert(view: WebView, url: String, message: String, result: JsResult): Boolean { + if (activity.isFinishing) { + return true + } + val builder = AlertDialog.Builder(view.context) + builder + .setMessage(message) + .setPositiveButton( + "OK" + ) { dialog: DialogInterface, _: Int -> + dialog.dismiss() + result.confirm() + } + .setOnCancelListener { dialog: DialogInterface -> + dialog.dismiss() + result.cancel() + } + val dialog = builder.create() + dialog.show() + return true + } + + /** + * Show the browser confirm modal + * @param view + * @param url + * @param message + * @param result + * @return + */ + override fun onJsConfirm(view: WebView, url: String, message: String, result: JsResult): Boolean { + if (activity.isFinishing) { + return true + } + val builder = AlertDialog.Builder(view.context) + builder + .setMessage(message) + .setPositiveButton( + "OK" + ) { dialog: DialogInterface, _: Int -> + dialog.dismiss() + result.confirm() + } + .setNegativeButton( + "Cancel" + ) { dialog: DialogInterface, _: Int -> + dialog.dismiss() + result.cancel() + } + .setOnCancelListener { dialog: DialogInterface -> + dialog.dismiss() + result.cancel() + } + val dialog = builder.create() + dialog.show() + return true + } + + /** + * Show the browser prompt modal + * @param view + * @param url + * @param message + * @param defaultValue + * @param result + * @return + */ + override fun onJsPrompt( + view: WebView, + url: String, + message: String, + defaultValue: String, + result: JsPromptResult + ): Boolean { + if (activity.isFinishing) { + return true + } + val builder = AlertDialog.Builder(view.context) + val input = EditText(view.context) + builder + .setMessage(message) + .setView(input) + .setPositiveButton( + "OK" + ) { dialog: DialogInterface, _: Int -> + dialog.dismiss() + val inputText1 = input.text.toString().trim { it <= ' ' } + result.confirm(inputText1) + } + .setNegativeButton( + "Cancel" + ) { dialog: DialogInterface, _: Int -> + dialog.dismiss() + result.cancel() + } + .setOnCancelListener { dialog: DialogInterface -> + dialog.dismiss() + result.cancel() + } + val dialog = builder.create() + dialog.show() + return true + } + + /** + * Handle the browser geolocation permission prompt + * @param origin + * @param callback + */ + override fun onGeolocationPermissionsShowPrompt( + origin: String, + callback: GeolocationPermissions.Callback + ) { + super.onGeolocationPermissionsShowPrompt(origin, callback) + Logger.debug("onGeolocationPermissionsShowPrompt: DOING IT HERE FOR ORIGIN: $origin") + val geoPermissions = + arrayOf(Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION) + if (!PermissionHelper.hasPermissions(activity, geoPermissions)) { + permissionListener = object : PermissionListener { + override fun onPermissionSelect(isGranted: Boolean?) { + if (isGranted == true) { + callback.invoke(origin, true, false) + } else { + val coarsePermission = + arrayOf(Manifest.permission.ACCESS_COARSE_LOCATION) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && + PermissionHelper.hasPermissions(activity, coarsePermission) + ) { + callback.invoke(origin, true, false) + } else { + callback.invoke(origin, false, false) + } + } + } + } + permissionLauncher.launch(geoPermissions) + } else { + // permission is already granted + callback.invoke(origin, true, false) + Logger.debug("onGeolocationPermissionsShowPrompt: has required permission") + } + } + + override fun onShowFileChooser( + webView: WebView, + filePathCallback: ValueCallback?>, + fileChooserParams: FileChooserParams + ): Boolean { + val acceptTypes = listOf(*fileChooserParams.acceptTypes) + val captureEnabled = fileChooserParams.isCaptureEnabled + val capturePhoto = captureEnabled && acceptTypes.contains("image/*") + val captureVideo = captureEnabled && acceptTypes.contains("video/*") + if (capturePhoto || captureVideo) { + if (isMediaCaptureSupported) { + showMediaCaptureOrFilePicker(filePathCallback, fileChooserParams, captureVideo) + } else { + permissionListener = object : PermissionListener { + override fun onPermissionSelect(isGranted: Boolean?) { + if (isGranted == true) { + showMediaCaptureOrFilePicker(filePathCallback, fileChooserParams, captureVideo) + } else { + Logger.warn(Logger.tags("FileChooser"), "Camera permission not granted") + filePathCallback.onReceiveValue(null) + } + } + } + val camPermission = arrayOf(Manifest.permission.CAMERA) + permissionLauncher.launch(camPermission) + } + } else { + showFilePicker(filePathCallback, fileChooserParams) + } + return true + } + + private val isMediaCaptureSupported: Boolean + get() { + val permissions = arrayOf(Manifest.permission.CAMERA) + return PermissionHelper.hasPermissions(activity, permissions) || + !PermissionHelper.hasDefinedPermission(activity, Manifest.permission.CAMERA) + } + + private fun showMediaCaptureOrFilePicker( + filePathCallback: ValueCallback?>, + fileChooserParams: FileChooserParams, + isVideo: Boolean + ) { + val isVideoCaptureSupported = true + val shown = if (isVideo && isVideoCaptureSupported) { + showVideoCapturePicker(filePathCallback) + } else { + showImageCapturePicker(filePathCallback) + } + if (!shown) { + Logger.warn( + Logger.tags("FileChooser"), + "Media capture intent could not be launched. Falling back to default file picker." + ) + showFilePicker(filePathCallback, fileChooserParams) + } + } + + private fun showImageCapturePicker(filePathCallback: ValueCallback?>): Boolean { + val takePictureIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE) + if (takePictureIntent.resolveActivity(activity.packageManager) == null) { + return false + } + val imageFileUri: Uri = try { + createImageFileUri() + } catch (ex: Exception) { + Logger.error("Unable to create temporary media capture file: " + ex.message) + return false + } + takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageFileUri) + activityListener = object : ActivityResultListener { + override fun onActivityResult(result: ActivityResult?) { + var res: Array? = null + if (result?.resultCode == Activity.RESULT_OK) { + res = arrayOf(imageFileUri) + } + filePathCallback.onReceiveValue(res) + } + } + activityLauncher.launch(takePictureIntent) + return true + } + + private fun showVideoCapturePicker(filePathCallback: ValueCallback?>): Boolean { + val takeVideoIntent = Intent(MediaStore.ACTION_VIDEO_CAPTURE) + if (takeVideoIntent.resolveActivity(activity.packageManager) == null) { + return false + } + activityListener = object : ActivityResultListener { + override fun onActivityResult(result: ActivityResult?) { + var res: Array? = null + if (result?.resultCode == Activity.RESULT_OK) { + res = arrayOf(result.data!!.data) + } + filePathCallback.onReceiveValue(res) + } + } + activityLauncher.launch(takeVideoIntent) + return true + } + + private fun showFilePicker( + filePathCallback: ValueCallback?>, + fileChooserParams: FileChooserParams + ) { + val intent = fileChooserParams.createIntent() + if (fileChooserParams.mode == FileChooserParams.MODE_OPEN_MULTIPLE) { + intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true) + } + if (fileChooserParams.acceptTypes.size > 1 || intent.type!!.startsWith(".")) { + val validTypes = getValidTypes(fileChooserParams.acceptTypes) + intent.putExtra(Intent.EXTRA_MIME_TYPES, validTypes) + if (intent.type!!.startsWith(".")) { + intent.type = validTypes[0] + } + } + try { + activityListener = object : ActivityResultListener { + override fun onActivityResult(result: ActivityResult?) { + val res: Array? + val resultIntent = result?.data + if (result?.resultCode == Activity.RESULT_OK && resultIntent!!.clipData != null) { + val numFiles = resultIntent.clipData!!.itemCount + res = arrayOfNulls(numFiles) + for (i in 0 until numFiles) { + res[i] = resultIntent.clipData!!.getItemAt(i).uri + } + } else { + res = FileChooserParams.parseResult( + result?.resultCode ?: 0, + resultIntent + ) + } + filePathCallback.onReceiveValue(res) + } + } + activityLauncher.launch(intent) + } catch (e: ActivityNotFoundException) { + filePathCallback.onReceiveValue(null) + } + } + + private fun getValidTypes(currentTypes: Array): Array { + val validTypes: MutableList = ArrayList() + val mtm = MimeTypeMap.getSingleton() + for (mime in currentTypes) { + if (mime.startsWith(".")) { + val extension = mime.substring(1) + val extensionMime = mtm.getMimeTypeFromExtension(extension) + if (extensionMime != null && !validTypes.contains(extensionMime)) { + validTypes.add(extensionMime) + } + } else if (!validTypes.contains(mime)) { + validTypes.add(mime) + } + } + val validObj: Array = validTypes.toTypedArray() + return Arrays.copyOf( + validObj, validObj.size, + Array::class.java + ) + } + + override fun onConsoleMessage(consoleMessage: ConsoleMessage): Boolean { + val tag: String = Logger.tags("Console") + if (consoleMessage.message() != null && isValidMsg(consoleMessage.message())) { + val msg = String.format( + "File: %s - Line %d - Msg: %s", + consoleMessage.sourceId(), + consoleMessage.lineNumber(), + consoleMessage.message() + ) + val level = consoleMessage.messageLevel().name + if ("ERROR".equals(level, ignoreCase = true)) { + Logger.error(tag, msg, null) + } else if ("WARNING".equals(level, ignoreCase = true)) { + Logger.warn(tag, msg) + } else if ("TIP".equals(level, ignoreCase = true)) { + Logger.debug(tag, msg) + } else { + Logger.info(tag, msg) + } + } + return true + } + + private fun isValidMsg(msg: String): Boolean { + return !(msg.contains("%cresult %c") || + msg.contains("%cnative %c") || + msg.equals("[object Object]", ignoreCase = true) || + msg.equals("console.groupEnd", ignoreCase = true)) + } + + @Throws(IOException::class) + private fun createImageFileUri(): Uri { + val photoFile = createImageFile(activity) + return FileProvider.getUriForFile( + activity, + activity.packageName.toString() + ".fileprovider", + photoFile + ) + } + + @Throws(IOException::class) + private fun createImageFile(activity: Activity): File { + // Create an image file name + val timeStamp = SimpleDateFormat("yyyyMMdd_HHmmss").format(Date()) + val imageFileName = "JPEG_" + timeStamp + "_" + val storageDir = activity.getExternalFilesDir(Environment.DIRECTORY_PICTURES) + return File.createTempFile(imageFileName, ".jpg", storageDir) + } + + override fun onReceivedTitle( + view: WebView, + title: String + ) { + handleReceivedTitle(view, title) + } + + private external fun handleReceivedTitle(webview: WebView, title: String) +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/RustWebView.kt b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/RustWebView.kt new file mode 100644 index 0000000000..8debc1c7ad --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/RustWebView.kt @@ -0,0 +1,99 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +@file:Suppress("unused", "SetJavaScriptEnabled") + +package {{package}} + +import android.annotation.SuppressLint +import android.webkit.* +import android.content.Context +import androidx.webkit.WebViewCompat +import androidx.webkit.WebViewFeature +import kotlin.collections.Map + +@SuppressLint("RestrictedApi") +class RustWebView(context: Context, val initScripts: Array, val id: String): WebView(context) { + val isDocumentStartScriptEnabled: Boolean + + init { + settings.javaScriptEnabled = true + settings.domStorageEnabled = true + settings.setGeolocationEnabled(true) + settings.databaseEnabled = true + settings.mediaPlaybackRequiresUserGesture = false + settings.javaScriptCanOpenWindowsAutomatically = true + + if (WebViewFeature.isFeatureSupported(WebViewFeature.DOCUMENT_START_SCRIPT)) { + isDocumentStartScriptEnabled = true + for (script in initScripts) { + WebViewCompat.addDocumentStartJavaScript(this, script, setOf("*")); + } + } else { + isDocumentStartScriptEnabled = false + } + + {{class-init}} + } + + fun loadUrlMainThread(url: String) { + post { + loadUrl(url) + } + } + + fun loadUrlMainThread(url: String, additionalHttpHeaders: Map) { + post { + loadUrl(url, additionalHttpHeaders) + } + } + + override fun loadUrl(url: String) { + if (!shouldOverride(url)) { + super.loadUrl(url); + } + } + + override fun loadUrl(url: String, additionalHttpHeaders: Map) { + if (!shouldOverride(url)) { + super.loadUrl(url, additionalHttpHeaders); + } + } + + fun loadHTMLMainThread(html: String) { + post { + super.loadData(html, "text/html", null) + } + } + + fun evalScript(id: Int, script: String) { + post { + super.evaluateJavascript(script) { result -> + onEval(id, result) + } + } + } + + fun clearAllBrowsingData() { + try { + super.getContext().deleteDatabase("webviewCache.db") + super.getContext().deleteDatabase("webview.db") + super.clearCache(true) + super.clearHistory() + super.clearFormData() + } catch (ex: Exception) { + Logger.error("Unable to create temporary media capture file: " + ex.message) + } + } + + fun getCookies(url: String): String { + val cookieManager = CookieManager.getInstance() + return cookieManager.getCookie(url) + } + + private external fun shouldOverride(url: String): Boolean + private external fun onEval(id: Int, result: String) + + {{class-extension}} +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/RustWebViewClient.kt b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/RustWebViewClient.kt new file mode 100644 index 0000000000..343ad1490c --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/RustWebViewClient.kt @@ -0,0 +1,105 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package {{package}} + +import android.net.Uri +import android.webkit.* +import android.content.Context +import android.graphics.Bitmap +import android.os.Handler +import android.os.Looper +import androidx.webkit.WebViewAssetLoader + +class RustWebViewClient(context: Context): WebViewClient() { + private val interceptedState = mutableMapOf() + var currentUrl: String = "about:blank" + private var lastInterceptedUrl: Uri? = null + private var pendingUrlRedirect: String? = null + + private val assetLoader = WebViewAssetLoader.Builder() + .setDomain(assetLoaderDomain()) + .addPathHandler("/", WebViewAssetLoader.AssetsPathHandler(context)) + .build() + + override fun shouldInterceptRequest( + view: WebView, + request: WebResourceRequest + ): WebResourceResponse? { + pendingUrlRedirect?.let { + Handler(Looper.getMainLooper()).post { + view.loadUrl(it) + } + pendingUrlRedirect = null + return null + } + + lastInterceptedUrl = request.url + return if (withAssetLoader()) { + assetLoader.shouldInterceptRequest(request.url) + } else { + val rustWebview = view as RustWebView; + val response = handleRequest(rustWebview.id, request, rustWebview.isDocumentStartScriptEnabled) + interceptedState[request.url.toString()] = response != null + return response + } + } + + override fun shouldOverrideUrlLoading( + view: WebView, + request: WebResourceRequest + ): Boolean { + return shouldOverride(request.url.toString()) + } + + override fun onPageStarted(view: WebView, url: String, favicon: Bitmap?) { + currentUrl = url + if (interceptedState[url] == false) { + val webView = view as RustWebView + for (script in webView.initScripts) { + view.evaluateJavascript(script, null) + } + } + return onPageLoading(url) + } + + override fun onPageFinished(view: WebView, url: String) { + onPageLoaded(url) + } + + override fun onReceivedError( + view: WebView, + request: WebResourceRequest, + error: WebResourceError + ) { + // we get a net::ERR_CONNECTION_REFUSED when an external URL redirects to a custom protocol + // e.g. oauth flow, because shouldInterceptRequest is not called on redirects + // so we must force retry here with loadUrl() to get a chance of the custom protocol to kick in + if (error.errorCode == ERROR_CONNECT && request.isForMainFrame && request.url != lastInterceptedUrl) { + // prevent the default error page from showing + view.stopLoading() + // without this initial loadUrl the app is stuck + view.loadUrl(request.url.toString()) + // ensure the URL is actually loaded - for some reason there's a race condition and we need to call loadUrl() again later + pendingUrlRedirect = request.url.toString() + } else { + super.onReceivedError(view, request, error) + } + } + + companion object { + init { + System.loadLibrary("{{library}}") + } + } + + private external fun assetLoaderDomain(): String + private external fun withAssetLoader(): Boolean + private external fun handleRequest(webviewId: String, request: WebResourceRequest, isDocumentStartScriptEnabled: Boolean): WebResourceResponse? + private external fun shouldOverride(url: String): Boolean + private external fun onPageLoading(url: String) + private external fun onPageLoaded(url: String) + + {{class-extension}} +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/WryActivity.kt b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/WryActivity.kt new file mode 100644 index 0000000000..73291e44f4 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/WryActivity.kt @@ -0,0 +1,144 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +package {{package}} + +import {{package}}.RustWebView +import android.annotation.SuppressLint +import android.os.Build +import android.os.Bundle +import android.webkit.WebView +import android.view.KeyEvent +import androidx.activity.OnBackPressedCallback +import androidx.appcompat.app.AppCompatActivity + +abstract class WryActivity : AppCompatActivity() { + private lateinit var mWebView: RustWebView + open val handleBackNavigation: Boolean = true + + open fun onWebViewCreate(webView: WebView) { } + + fun setWebView(webView: RustWebView) { + mWebView = webView + + if (handleBackNavigation) { + val callback = object : OnBackPressedCallback(true) { + override fun handleOnBackPressed() { + if (this@WryActivity.mWebView.canGoBack()) { + this@WryActivity.mWebView.goBack() + } else { + this.isEnabled = false + this@WryActivity.onBackPressed() + this.isEnabled = true + } + } + } + onBackPressedDispatcher.addCallback(this, callback) + } + + onWebViewCreate(webView) + } + + val version: String + @SuppressLint("WebViewApiAvailability", "ObsoleteSdkInt") + get() { + // Check getCurrentWebViewPackage() directly if above Android 8 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + return WebView.getCurrentWebViewPackage()?.versionName ?: "" + } + + // Otherwise manually check WebView versions + var webViewPackage = "com.google.android.webview" + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + webViewPackage = "com.android.chrome" + } + try { + @Suppress("DEPRECATION") + val info = packageManager.getPackageInfo(webViewPackage, 0) + return info.versionName.toString() + } catch (ex: Exception) { + Logger.warn("Unable to get package info for '$webViewPackage'$ex") + } + + try { + @Suppress("DEPRECATION") + val info = packageManager.getPackageInfo("com.android.webview", 0) + return info.versionName.toString() + } catch (ex: Exception) { + Logger.warn("Unable to get package info for 'com.android.webview'$ex") + } + + // Could not detect any webview, return empty string + return "" + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + create(this) + } + + override fun onStart() { + super.onStart() + start() + } + + override fun onResume() { + super.onResume() + resume() + } + + override fun onPause() { + super.onPause() + pause() + } + + override fun onStop() { + super.onStop() + stop() + } + + override fun onWindowFocusChanged(hasFocus: Boolean) { + super.onWindowFocusChanged(hasFocus) + focus(hasFocus) + } + + override fun onSaveInstanceState(outState: Bundle) { + super.onSaveInstanceState(outState) + save() + } + + override fun onDestroy() { + super.onDestroy() + destroy() + onActivityDestroy() + } + + override fun onLowMemory() { + super.onLowMemory() + memory() + } + + fun getAppClass(name: String): Class<*> { + return Class.forName(name) + } + + companion object { + init { + System.loadLibrary("{{library}}") + } + } + + private external fun create(activity: WryActivity) + private external fun start() + private external fun resume() + private external fun pause() + private external fun stop() + private external fun save() + private external fun destroy() + private external fun onActivityDestroy() + private external fun memory() + private external fun focus(focus: Boolean) + + {{class-extension}} +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/proguard-wry.pro b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/proguard-wry.pro new file mode 100644 index 0000000000..064ca362bb --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/src/android/kotlin/proguard-wry.pro @@ -0,0 +1,33 @@ +# Copyright 2020-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT + +-keep class {{package-unescaped}}.* { + native ; +} + +-keep class {{package-unescaped}}.WryActivity { + public (...); + + void setWebView({{package-unescaped}}.RustWebView); + java.lang.Class getAppClass(...); + java.lang.String getVersion(); +} + +-keep class {{package-unescaped}}.Ipc { + public (...); + + @android.webkit.JavascriptInterface public ; +} + +-keep class {{package-unescaped}}.RustWebView { + public (...); + + void loadUrlMainThread(...); + void loadHTMLMainThread(...); + void evalScript(...); +} + +-keep class {{package-unescaped}}.RustWebChromeClient,{{package-unescaped}}.RustWebViewClient { + public (...); +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/src/android/main_pipe.rs b/packages/tauri-app/vendor/wry-0.54.4/src/android/main_pipe.rs new file mode 100644 index 0000000000..5b81048ef0 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/src/android/main_pipe.rs @@ -0,0 +1,484 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use crate::{Error, InitializationScript, RGBA}; +use crossbeam_channel::*; +use jni::{ + errors::Result as JniResult, + objects::{GlobalRef, JMap, JObject, JString}, + JNIEnv, +}; +use once_cell::sync::Lazy; +use std::os::unix::prelude::*; + +use super::{find_class, EvalCallback, EVAL_CALLBACKS, EVAL_ID_GENERATOR, PACKAGE}; + +static CHANNEL: Lazy<(Sender, Receiver)> = Lazy::new(|| bounded(8)); +pub static MAIN_PIPE: Lazy<[OwnedFd; 2]> = Lazy::new(|| { + let mut pipe: [RawFd; 2] = Default::default(); + unsafe { libc::pipe(pipe.as_mut_ptr()) }; + unsafe { pipe.map(|fd| OwnedFd::from_raw_fd(fd)) } +}); + +pub enum MainPipeState { + Alive, + Destroyed, +} + +pub struct MainPipe<'a> { + pub env: JNIEnv<'a>, + pub activity: GlobalRef, + pub webview: Option, + pub webchrome_client: GlobalRef, +} + +impl<'a> MainPipe<'a> { + pub(crate) fn send(message: WebViewMessage) { + let size = std::mem::size_of::(); + if let Ok(()) = CHANNEL.0.send(message) { + unsafe { + libc::write( + MAIN_PIPE[1].as_raw_fd(), + &true as *const _ as *const _, + size, + ) + }; + } + } + + pub fn recv(&mut self) -> JniResult { + let activity = self.activity.as_obj(); + if let Ok(message) = CHANNEL.1.recv() { + match message { + WebViewMessage::CreateWebView(attrs) => { + let CreateWebViewAttributes { + url, + html, + #[cfg(any(debug_assertions, feature = "devtools"))] + devtools, + transparent, + background_color, + headers, + on_webview_created, + autoplay, + user_agent, + initialization_scripts, + id, + javascript_disabled, + .. + } = attrs; + + let string_class = self.env.find_class("java/lang/String")?; + let initialization_scripts_array = self.env.new_object_array( + initialization_scripts.len() as i32, + string_class, + self.env.new_string("")?, + )?; + for (i, init_script) in initialization_scripts.into_iter().enumerate() { + self.env.set_object_array_element( + &initialization_scripts_array, + i as i32, + self.env.new_string(init_script.script)?, + )?; + } + + let id = self.env.new_string(id)?; + + // Create webview + let rust_webview_class = find_class( + &mut self.env, + activity, + format!("{}/RustWebView", PACKAGE.get().unwrap()), + )?; + let webview = self.env.new_object( + &rust_webview_class, + "(Landroid/content/Context;[Ljava/lang/String;Ljava/lang/String;)V", + &[ + activity.into(), + (&initialization_scripts_array).into(), + (&id).into(), + ], + )?; + + // get settings + let web_settings = self + .env + .call_method( + &webview, + "getSettings", + "()Landroid/webkit/WebSettings;", + &[], + )? + .l()?; + + // set media autoplay + self.env.call_method( + &web_settings, + "setMediaPlaybackRequiresUserGesture", + "(Z)V", + &[(!autoplay).into()], + )?; + + // set user-agent + if let Some(user_agent) = user_agent { + let user_agent = self.env.new_string(user_agent)?; + self.env.call_method( + &web_settings, + "setUserAgentString", + "(Ljava/lang/String;)V", + &[(&user_agent).into()], + )?; + } + + // disable javascript + if javascript_disabled { + self.env.call_method( + &web_settings, + "setJavaScriptEnabled", + "(Z)V", + &[false.into()], + )?; + } + + self.env.call_method( + activity, + "setWebView", + format!("(L{}/RustWebView;)V", PACKAGE.get().unwrap()), + &[(&webview).into()], + )?; + + // Navigation + if let Some(u) = url { + if let Ok(url) = self.env.new_string(u) { + load_url(&mut self.env, &webview, &url, headers, true)?; + } + } else if let Some(h) = html { + if let Ok(html) = self.env.new_string(h) { + load_html(&mut self.env, &webview, &html)?; + } + } + + // Enable devtools + #[cfg(any(debug_assertions, feature = "devtools"))] + self.env.call_static_method( + &rust_webview_class, + "setWebContentsDebuggingEnabled", + "(Z)V", + &[devtools.into()], + )?; + + if transparent { + set_background_color(&mut self.env, &webview, (0, 0, 0, 0))?; + } else if let Some(color) = background_color { + set_background_color(&mut self.env, &webview, color)?; + } + + // Create and set webview client + let client_class_name = format!("{}/RustWebViewClient", PACKAGE.get().unwrap()); + let rust_webview_client_class = + find_class(&mut self.env, activity, client_class_name.clone())?; + let webview_client = self.env.new_object( + &rust_webview_client_class, + "(Landroid/content/Context;)V", + &[activity.into()], + )?; + self.env.call_method( + &webview, + "setWebViewClient", + "(Landroid/webkit/WebViewClient;)V", + &[(&webview_client).into()], + )?; + + // set webchrome client + self.env.call_method( + &webview, + "setWebChromeClient", + "(Landroid/webkit/WebChromeClient;)V", + &[self.webchrome_client.as_obj().into()], + )?; + + // Add javascript interface (IPC) + let ipc_class = find_class( + &mut self.env, + activity, + format!("{}/Ipc", PACKAGE.get().unwrap()), + )?; + let ipc = self.env.new_object( + ipc_class, + format!("(L{client_class_name};)V"), + &[(&webview_client).into()], + )?; + let ipc_str = self.env.new_string("ipc")?; + self.env.call_method( + &webview, + "addJavascriptInterface", + "(Ljava/lang/Object;Ljava/lang/String;)V", + &[(&ipc).into(), (&ipc_str).into()], + )?; + + // Set content view + self.env.call_method( + activity, + "setContentView", + "(Landroid/view/View;)V", + &[(&webview).into()], + )?; + + if let Some(on_webview_created) = on_webview_created { + if let Err(e) = on_webview_created(super::Context { + env: &mut self.env, + activity, + webview: &webview, + }) { + #[cfg(feature = "tracing")] + tracing::warn!("failed to run webview created hook: {e}"); + } + } + + let webview = self.env.new_global_ref(webview)?; + + self.webview = Some(webview); + } + WebViewMessage::Eval(script, callback) => { + if let Some(webview) = &self.webview { + let id = EVAL_ID_GENERATOR.next() as i32; + + #[cfg(feature = "tracing")] + let span = std::sync::Mutex::new(Some(SendEnteredSpan( + tracing::debug_span!("wry::eval").entered(), + ))); + + EVAL_CALLBACKS + .get_or_init(Default::default) + .lock() + .unwrap() + .insert( + id, + Box::new(move |result| { + #[cfg(feature = "tracing")] + span.lock().unwrap().take(); + + if let Some(callback) = &callback { + callback(result); + } + }), + ); + + let s = self.env.new_string(script)?; + self.env.call_method( + webview.as_obj(), + "evalScript", + "(ILjava/lang/String;)V", + &[id.into(), (&s).into()], + )?; + } + } + WebViewMessage::SetBackgroundColor(background_color) => { + if let Some(webview) = &self.webview { + set_background_color(&mut self.env, webview.as_obj(), background_color)?; + } + } + WebViewMessage::GetWebViewVersion(tx) => { + match self + .env + .call_method(activity, "getVersion", "()Ljava/lang/String;", &[]) + .and_then(|v| v.l()) + .and_then(|s| { + let s = JString::from(s); + self + .env + .get_string(&s) + .map(|v| v.to_string_lossy().to_string()) + }) { + Ok(version) => { + tx.send(Ok(version)).unwrap(); + } + Err(e) => tx.send(Err(e.into())).unwrap(), + } + } + WebViewMessage::GetUrl(tx) => { + if let Some(webview) = &self.webview { + let url = self + .env + .call_method(webview.as_obj(), "getUrl", "()Ljava/lang/String;", &[]) + .and_then(|v| v.l()) + .and_then(|s| { + let s = JString::from(s); + self + .env + .get_string(&s) + .map(|v| v.to_string_lossy().to_string()) + }) + .unwrap_or_default(); + + tx.send(url).unwrap() + } + } + WebViewMessage::Jni(f) => { + if let Some(w) = &self.webview { + f(&mut self.env, activity, w.as_obj()); + } else { + f(&mut self.env, activity, &JObject::null()); + } + } + WebViewMessage::LoadUrl(url, headers) => { + if let Some(webview) = &self.webview { + let url = self.env.new_string(url)?; + load_url(&mut self.env, webview.as_obj(), &url, headers, false)?; + } + } + WebViewMessage::ClearAllBrowsingData => { + if let Some(webview) = &self.webview { + self + .env + .call_method(webview, "clearAllBrowsingData", "()V", &[])?; + } + } + WebViewMessage::LoadHtml(html) => { + if let Some(webview) = &self.webview { + let html = self.env.new_string(html)?; + load_html(&mut self.env, webview.as_obj(), &html)?; + } + } + WebViewMessage::Reload => { + if let Some(webview) = &self.webview { + reload(&mut self.env, webview.as_obj())?; + } + } + WebViewMessage::GetCookies(tx, url) => { + if let Some(webview) = &self.webview { + let url = self.env.new_string(url)?; + let cookies = self + .env + .call_method( + webview, + "getCookies", + "(Ljava/lang/String;)Ljava/lang/String;", + &[(&url).into()], + ) + .and_then(|v| v.l()) + .and_then(|s| { + let s = JString::from(s); + self + .env + .get_string(&s) + .map(|v| v.to_string_lossy().to_string()) + }) + .unwrap_or_default(); + + tx.send( + cookies + .split("; ") + .flat_map(|c| cookie::Cookie::parse(c.to_string())) + .collect(), + ) + .unwrap(); + } + } + WebViewMessage::OnDestroy => { + return Ok(MainPipeState::Destroyed); + } + } + } + Ok(MainPipeState::Alive) + } +} + +fn load_url<'a>( + env: &mut JNIEnv<'a>, + webview: &JObject<'a>, + url: &JString<'a>, + headers: Option, + main_thread: bool, +) -> JniResult<()> { + let function = if main_thread { + "loadUrlMainThread" + } else { + "loadUrl" + }; + if let Some(headers) = headers { + let obj = env.new_object("java/util/HashMap", "()V", &[])?; + let headers_map = { + let headers_map = JMap::from_env(env, &obj)?; + for (name, value) in headers.iter() { + let key = env.new_string(name)?; + let value = env.new_string(value.to_str().unwrap_or_default())?; + headers_map.put(env, &key, &value)?; + } + headers_map + }; + env.call_method( + webview, + function, + "(Ljava/lang/String;Ljava/util/Map;)V", + &[url.into(), (&headers_map).into()], + )?; + } else { + env.call_method(webview, function, "(Ljava/lang/String;)V", &[url.into()])?; + } + Ok(()) +} + +fn load_html<'a>(env: &mut JNIEnv<'a>, webview: &JObject<'a>, html: &JString<'a>) -> JniResult<()> { + env.call_method( + webview, + "loadHTMLMainThread", + "(Ljava/lang/String;)V", + &[html.into()], + )?; + Ok(()) +} + +fn reload<'a>(env: &mut JNIEnv<'a>, webview: &JObject<'a>) -> JniResult<()> { + env.call_method(webview, "reload", "()V", &[])?; + Ok(()) +} + +fn set_background_color<'a>( + env: &mut JNIEnv<'a>, + webview: &JObject<'a>, + (r, g, b, a): RGBA, +) -> JniResult<()> { + let color = (a as i32) << 24 | (r as i32) << 16 | (g as i32) << 8 | (b as i32); + env.call_method(webview, "setBackgroundColor", "(I)V", &[color.into()])?; + Ok(()) +} + +pub(crate) enum WebViewMessage { + CreateWebView(CreateWebViewAttributes), + Eval(String, Option), + SetBackgroundColor(RGBA), + GetWebViewVersion(Sender>), + GetUrl(Sender), + GetCookies(Sender>>, String), + Jni(Box), + LoadUrl(String, Option), + LoadHtml(String), + Reload, + ClearAllBrowsingData, + OnDestroy, +} + +pub(crate) struct CreateWebViewAttributes { + pub id: String, + pub url: Option, + pub html: Option, + #[cfg(any(debug_assertions, feature = "devtools"))] + pub devtools: bool, + pub transparent: bool, + pub background_color: Option, + pub headers: Option, + pub autoplay: bool, + pub on_webview_created: Option JniResult<()> + Send>>, + pub user_agent: Option, + pub initialization_scripts: Vec, + pub javascript_disabled: bool, +} + +// SAFETY: only use this when you are sure the span will be dropped on the same thread it was entered +#[cfg(feature = "tracing")] +struct SendEnteredSpan(tracing::span::EnteredSpan); + +#[cfg(feature = "tracing")] +unsafe impl Send for SendEnteredSpan {} diff --git a/packages/tauri-app/vendor/wry-0.54.4/src/android/mod.rs b/packages/tauri-app/vendor/wry-0.54.4/src/android/mod.rs new file mode 100644 index 0000000000..cdb086c4e1 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/src/android/mod.rs @@ -0,0 +1,455 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use super::{PageLoadEvent, WebViewAttributes, RGBA}; +use crate::{ + custom_protocol_workaround, inject_initialization_scripts::inject_scripts_into_html, + RequestAsyncResponder, Result, +}; +use crossbeam_channel::*; + +use http::{Request, Response as HttpResponse}; +use jni::{ + errors::Result as JniResult, + objects::{GlobalRef, JClass, JObject}, + JNIEnv, +}; +use ndk::looper::{FdEvent, ThreadLooper}; +use once_cell::sync::OnceCell; +use raw_window_handle::HasWindowHandle; +use std::{ + borrow::Cow, + collections::HashMap, + os::fd::{AsFd as _, AsRawFd as _}, + sync::{mpsc::channel, Mutex}, + time::Duration, +}; + +pub(crate) mod binding; +mod main_pipe; +use main_pipe::{CreateWebViewAttributes, MainPipe, MainPipeState, WebViewMessage, MAIN_PIPE}; + +use crate::util::Counter; + +static COUNTER: Counter = Counter::new(); +const MAIN_PIPE_TIMEOUT: Duration = Duration::from_secs(10); + +pub struct Context<'a, 'b> { + pub env: &'a mut JNIEnv<'b>, + pub activity: &'a JObject<'b>, + pub webview: &'a JObject<'b>, +} + +pub(crate) struct StaticValue(Mutex); + +unsafe impl Send for StaticValue {} +unsafe impl Sync for StaticValue {} + +impl std::ops::Deref for StaticValue { + type Target = Mutex; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +macro_rules! define_static_handlers { + ($($var:ident = $type_name:ident { $($fields:ident:$types:ty),+ $(,)? });+ $(;)?) => { + $(pub static $var: StaticValue> = StaticValue(Mutex::new(None)); + pub struct $type_name { + $($fields: $types,)* + } + impl $type_name { + pub fn new($($fields: $types,)*) -> Self { + Self { + $($fields,)* + } + } + } + unsafe impl Send for $type_name {} + unsafe impl Sync for $type_name {})* + }; +} + +define_static_handlers! { + IPC = UnsafeIpc { handler: Box)> }; + REQUEST_HANDLER = UnsafeRequestHandler { handler: Box>, bool) -> Option>>> }; + TITLE_CHANGE_HANDLER = UnsafeTitleHandler { handler: Box }; + URL_LOADING_OVERRIDE = UnsafeUrlLoadingOverride { handler: Box bool> }; + ON_LOAD_HANDLER = UnsafeOnPageLoadHandler { handler: Box }; +} + +pub static WITH_ASSET_LOADER: StaticValue> = StaticValue(Mutex::new(None)); +pub static ASSET_LOADER_DOMAIN: StaticValue> = StaticValue(Mutex::new(None)); + +pub(crate) static PACKAGE: OnceCell = OnceCell::new(); + +type EvalCallback = Box; + +pub static EVAL_ID_GENERATOR: Counter = Counter::new(); +pub static EVAL_CALLBACKS: OnceCell>> = OnceCell::new(); + +/// Sets up the necessary logic for wry to be able to create the webviews later. +/// +/// This function must be run on the thread where the [`JNIEnv`] is registered and the looper is local, +/// hence the requirement for a [`ThreadLooper`]. +pub unsafe fn android_setup( + package: &str, + mut env: JNIEnv, + looper: &ThreadLooper, + activity: GlobalRef, +) { + PACKAGE.get_or_init(move || package.to_string()); + + // we must create the WebChromeClient here because it calls `registerForActivityResult`, + // which gives an `LifecycleOwners must call register before they are STARTED.` error when called outside the onCreate hook + let rust_webchrome_client_class = find_class( + &mut env, + activity.as_obj(), + format!("{}/RustWebChromeClient", PACKAGE.get().unwrap()), + ) + .unwrap(); + let webchrome_client = env + .new_object( + &rust_webchrome_client_class, + &format!("(L{}/WryActivity;)V", PACKAGE.get().unwrap()), + &[activity.as_obj().into()], + ) + .unwrap(); + + let webchrome_client = env.new_global_ref(webchrome_client).unwrap(); + let mut main_pipe = MainPipe { + env, + activity, + webview: None, + webchrome_client, + }; + + looper + .add_fd_with_callback(MAIN_PIPE[0].as_fd(), FdEvent::INPUT, move |fd, _event| { + let size = std::mem::size_of::(); + let mut wake = false; + if libc::read(fd.as_raw_fd(), &mut wake as *mut _ as *mut _, size) == size as libc::ssize_t { + let res = main_pipe.recv(); + // unregister itself on errors or destroy event + matches!(res, Ok(MainPipeState::Alive)) + } else { + // unregister itself + false + } + }) + .unwrap(); +} + +pub(crate) struct InnerWebView { + id: String, +} + +impl InnerWebView { + pub fn new_as_child( + _window: &impl HasWindowHandle, + attributes: WebViewAttributes, + pl_attrs: super::PlatformSpecificWebViewAttributes, + ) -> Result { + Self::new(_window, attributes, pl_attrs) + } + + pub fn new( + _window: &impl HasWindowHandle, + attributes: WebViewAttributes, + pl_attrs: super::PlatformSpecificWebViewAttributes, + ) -> Result { + let WebViewAttributes { + url, + html, + initialization_scripts, + ipc_handler, + #[cfg(any(debug_assertions, feature = "devtools"))] + devtools, + custom_protocols, + background_color, + transparent, + headers, + autoplay, + user_agent, + javascript_disabled, + .. + } = attributes; + + let super::PlatformSpecificWebViewAttributes { + on_webview_created, + with_asset_loader, + asset_loader_domain, + https_scheme, + } = pl_attrs; + + let http_or_https = if https_scheme { "https" } else { "http" }; + + let url = if let Some(mut url) = url { + if let Some((protocol, _)) = url.split_once("://") { + if custom_protocols.contains_key(protocol) { + url = custom_protocol_workaround::apply_uri_work_around(&url, http_or_https, protocol) + } + } + + Some(url) + } else { + None + }; + + let id = attributes + .id + .map(|id| id.to_string()) + .unwrap_or_else(|| COUNTER.next().to_string()); + + WITH_ASSET_LOADER.lock().unwrap().replace(with_asset_loader); + if let Some(domain) = asset_loader_domain { + ASSET_LOADER_DOMAIN.lock().unwrap().replace(domain); + } + + let initialization_scripts_ = initialization_scripts.clone(); + REQUEST_HANDLER + .lock() + .unwrap() + .replace(UnsafeRequestHandler::new(Box::new( + move |webview_id: &str, mut request, is_document_start_script_enabled| { + let uri = request.uri().to_string(); + if let Some((custom_protocol, custom_protocol_handler)) = + custom_protocols.iter().find(|(protocol, _)| { + custom_protocol_workaround::is_work_around_uri(&uri, http_or_https, protocol) + }) + { + let uri_res = custom_protocol_workaround::revert_uri_work_around( + &uri, + http_or_https, + custom_protocol, + ) + .parse(); + + if let Ok(uri) = uri_res { + *request.uri_mut() = uri; + } + + let (tx, rx) = channel(); + let initialization_scripts = initialization_scripts_.clone(); + let responder: Box>)> = + Box::new(move |mut response| { + if !is_document_start_script_enabled { + #[cfg(feature = "tracing")] + tracing::info!("`addDocumentStartJavaScript` is not supported; injecting initialization scripts via custom protocol handler"); + response = inject_scripts_into_html(response, &initialization_scripts); + } + let _ = tx.send(response); + }); + + (custom_protocol_handler)(webview_id, request, RequestAsyncResponder { responder }); + return Some(rx.recv_timeout(MAIN_PIPE_TIMEOUT).unwrap()); + } + None + }, + ))); + + if let Some(i) = ipc_handler { + IPC.lock().unwrap().replace(UnsafeIpc::new(Box::new(i))); + } + + if let Some(i) = attributes.document_title_changed_handler { + TITLE_CHANGE_HANDLER + .lock() + .unwrap() + .replace(UnsafeTitleHandler::new(i)); + } + + if let Some(i) = attributes.navigation_handler { + URL_LOADING_OVERRIDE + .lock() + .unwrap() + .replace(UnsafeUrlLoadingOverride::new(i)); + } + + if let Some(h) = attributes.on_page_load_handler { + ON_LOAD_HANDLER + .lock() + .unwrap() + .replace(UnsafeOnPageLoadHandler::new(h)); + } + + MainPipe::send(WebViewMessage::CreateWebView(CreateWebViewAttributes { + id: id.clone(), + url, + html, + #[cfg(any(debug_assertions, feature = "devtools"))] + devtools, + background_color, + transparent, + headers, + on_webview_created, + autoplay, + user_agent, + initialization_scripts, + javascript_disabled, + })); + + Ok(Self { id }) + } + + pub fn print(&self) -> crate::Result<()> { + Ok(()) + } + + pub fn id(&self) -> crate::WebViewId<'_> { + &self.id + } + + pub fn url(&self) -> crate::Result { + let (tx, rx) = bounded(1); + MainPipe::send(WebViewMessage::GetUrl(tx)); + rx.recv_timeout(MAIN_PIPE_TIMEOUT).map_err(Into::into) + } + + pub fn eval(&self, js: &str, callback: Option) -> Result<()> { + MainPipe::send(WebViewMessage::Eval( + js.into(), + callback.map(|c| Box::new(c) as Box), + )); + Ok(()) + } + + #[cfg(any(debug_assertions, feature = "devtools"))] + pub fn open_devtools(&self) {} + + #[cfg(any(debug_assertions, feature = "devtools"))] + pub fn close_devtools(&self) {} + + #[cfg(any(debug_assertions, feature = "devtools"))] + pub fn is_devtools_open(&self) -> bool { + false + } + + pub fn zoom(&self, _scale_factor: f64) -> Result<()> { + Ok(()) + } + + pub fn set_background_color(&self, background_color: RGBA) -> Result<()> { + MainPipe::send(WebViewMessage::SetBackgroundColor(background_color)); + Ok(()) + } + + pub fn load_url(&self, url: &str) -> Result<()> { + MainPipe::send(WebViewMessage::LoadUrl(url.to_string(), None)); + Ok(()) + } + + pub fn load_url_with_headers(&self, url: &str, headers: http::HeaderMap) -> Result<()> { + MainPipe::send(WebViewMessage::LoadUrl(url.to_string(), Some(headers))); + Ok(()) + } + + pub fn load_html(&self, html: &str) -> Result<()> { + MainPipe::send(WebViewMessage::LoadHtml(html.to_string())); + Ok(()) + } + + pub fn reload(&self) -> Result<()> { + MainPipe::send(WebViewMessage::Reload); + Ok(()) + } + + pub fn clear_all_browsing_data(&self) -> Result<()> { + MainPipe::send(WebViewMessage::ClearAllBrowsingData); + Ok(()) + } + + pub fn cookies_for_url(&self, url: &str) -> Result>> { + let (tx, rx) = bounded(1); + MainPipe::send(WebViewMessage::GetCookies(tx, url.to_string())); + rx.recv_timeout(MAIN_PIPE_TIMEOUT).map_err(Into::into) + } + + pub fn set_cookie(&self, #[allow(unused)] cookie: &cookie::Cookie<'_>) -> Result<()> { + // Unsupported + Ok(()) + } + + pub fn delete_cookie(&self, #[allow(unused)] cookie: &cookie::Cookie<'_>) -> Result<()> { + // Unsupported + Ok(()) + } + + pub fn cookies(&self) -> Result>> { + Ok(Vec::new()) + } + + pub fn bounds(&self) -> Result { + Ok(crate::Rect::default()) + } + + pub fn set_bounds(&self, _bounds: crate::Rect) -> Result<()> { + // Unsupported + Ok(()) + } + + pub fn set_visible(&self, _visible: bool) -> Result<()> { + // Unsupported + Ok(()) + } + + pub fn focus(&self) -> Result<()> { + // Unsupported + Ok(()) + } + + pub fn focus_parent(&self) -> Result<()> { + // Unsupported + Ok(()) + } +} + +#[derive(Clone, Copy)] +pub struct JniHandle; + +impl JniHandle { + /// Execute jni code on the thread of the webview. + /// Provided function will be provided with the jni evironment, Android activity and WebView + pub fn exec(&self, func: F) + where + F: FnOnce(&mut JNIEnv, &JObject, &JObject) + Send + 'static, + { + MainPipe::send(WebViewMessage::Jni(Box::new(func))); + } +} + +pub fn platform_webview_version() -> Result { + let (tx, rx) = bounded(1); + MainPipe::send(WebViewMessage::GetWebViewVersion(tx)); + rx.recv_timeout(MAIN_PIPE_TIMEOUT).unwrap() +} + +/// Finds a class in the project scope. +pub fn find_class<'a>( + env: &mut JNIEnv<'a>, + activity: &JObject<'_>, + name: String, +) -> JniResult> { + let class_name = env.new_string(name.replace('/', "."))?; + let my_class = env + .call_method( + activity, + "getAppClass", + "(Ljava/lang/String;)Ljava/lang/Class;", + &[(&class_name).into()], + )? + .l()?; + Ok(my_class.into()) +} + +/// Dispatch a closure to run on the Android context. +/// +/// The closure takes the JNI env, the Android activity instance and the possibly null webview. +pub fn dispatch(func: F) +where + F: FnOnce(&mut JNIEnv, &JObject, &JObject) + Send + 'static, +{ + MainPipe::send(WebViewMessage::Jni(Box::new(func))); +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/src/custom_protocol_workaround.rs b/packages/tauri-app/vendor/wry-0.54.4/src/custom_protocol_workaround.rs new file mode 100644 index 0000000000..122b1341dd --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/src/custom_protocol_workaround.rs @@ -0,0 +1,56 @@ +//! - WebView2 supports non-standard protocols only on Windows 10+, so we have to use a workaround. +//! See +//! - On Android, there's no API for registering custom protocols, so this workaround is also used. +//! +//! The process looks like this: +//! +//! 1. Use [`apply_uri_work_around`] to convert the URI we want to navigate to +//! 2. Intercept http(s) requests, test the request URI against [`is_work_around_uri`], +//! if it matches, we apply [`revert_uri_work_around`] to the URI and feed it to the custom protocol handler + +/// If the URI is a work around URI for this protocol which starts with `{http_or_https}://{protocol}.` +pub fn is_work_around_uri(uri: &str, http_or_https: &str, protocol: &str) -> bool { + uri + .strip_prefix(http_or_https) + .and_then(|rest| rest.strip_prefix("://")) + .and_then(|rest| rest.strip_prefix(protocol)) + .and_then(|rest| rest.strip_prefix(".")) + .is_some() +} + +/// Conveting `{protocol}://localhost/abc` to `{http_or_https}://{protocol}.localhost/abc` +pub fn apply_uri_work_around(uri: &str, http_or_https: &str, protocol: &str) -> String { + uri.replace( + &original_uri_prefix(protocol), + &work_around_uri_prefix(http_or_https, protocol), + ) +} + +/// Conveting `{http_or_https}://{protocol}.localhost/abc` back to `{protocol}://localhost/abc` +pub fn revert_uri_work_around(uri: &str, http_or_https: &str, protocol: &str) -> String { + uri.replace( + &work_around_uri_prefix(http_or_https, protocol), + &original_uri_prefix(protocol), + ) +} + +pub fn original_uri_prefix(protocol: &str) -> String { + format!("{protocol}://") +} + +pub fn work_around_uri_prefix(http_or_https: &str, protocol: &str) -> String { + format!("{http_or_https}://{protocol}.") +} + +#[cfg(test)] +mod tests { + use super::is_work_around_uri; + + #[test] + fn checks_if_custom_protocol_uri() { + let scheme = "http"; + let uri = "http://wry.localhost/path/to/page"; + assert!(is_work_around_uri(uri, scheme, "wry")); + assert!(!is_work_around_uri(uri, scheme, "asset")); + } +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/src/error.rs b/packages/tauri-app/vendor/wry-0.54.4/src/error.rs new file mode 100644 index 0000000000..aed324ee4d --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/src/error.rs @@ -0,0 +1,77 @@ +/// Convenient type alias of Result type for wry. +pub type Result = std::result::Result; + +/// Errors returned by wry. +#[non_exhaustive] +#[derive(thiserror::Error, Debug)] +pub enum Error { + #[cfg(gtk)] + #[error(transparent)] + GlibError(#[from] gtk::glib::Error), + #[cfg(gtk)] + #[error(transparent)] + GlibBoolError(#[from] gtk::glib::BoolError), + #[cfg(gtk)] + #[error("Fail to fetch security manager")] + MissingManager, + #[cfg(gtk)] + #[error("Couldn't find X11 Display")] + X11DisplayNotFound, + #[cfg(all(gtk, feature = "x11"))] + #[error(transparent)] + XlibError(#[from] x11_dl::error::OpenError), + #[error("Failed to initialize the script")] + InitScriptError, + #[error("Bad RPC request: {0} ((1))")] + RpcScriptError(String, String), + #[error(transparent)] + NulError(#[from] std::ffi::NulError), + #[error(transparent)] + ReceiverError(#[from] std::sync::mpsc::RecvError), + #[cfg(target_os = "android")] + #[error(transparent)] + ReceiverTimeoutError(#[from] crossbeam_channel::RecvTimeoutError), + #[error(transparent)] + SenderError(#[from] std::sync::mpsc::SendError), + #[error("Failed to send the message")] + MessageSender, + #[error("IO error: {0}")] + Io(#[from] std::io::Error), + #[cfg(target_os = "windows")] + #[error("WebView2 error: {0}")] + WebView2Error(webview2_com::Error), + #[error(transparent)] + HttpError(#[from] http::Error), + #[error("Infallible error, something went really wrong: {0}")] + Infallible(#[from] std::convert::Infallible), + #[cfg(target_os = "android")] + #[error(transparent)] + JniError(#[from] jni::errors::Error), + #[error("Failed to create proxy endpoint")] + ProxyEndpointCreationFailed, + #[error(transparent)] + WindowHandleError(#[from] raw_window_handle::HandleError), + #[error("the window handle kind is not supported")] + UnsupportedWindowHandle, + #[error(transparent)] + Utf8Error(#[from] std::str::Utf8Error), + #[cfg(target_os = "android")] + #[error(transparent)] + CrossBeamRecvError(#[from] crossbeam_channel::RecvError), + #[error("not on the main thread")] + NotMainThread, + #[error("Custom protocol task is invalid.")] + CustomProtocolTaskInvalid, + #[error("Failed to register URL scheme: {0}, could be due to invalid URL scheme or the scheme is already registered.")] + UrlSchemeRegisterError(String), + #[error("Duplicate custom protocol '{0}' registered on the WebViewBuilder")] + DuplicateCustomProtocol(String), + #[error("Duplicate custom protocol '{0}' registered on the same web context on Linux")] + ContextDuplicateCustomProtocol(String), + #[error(transparent)] + #[cfg(any(target_os = "macos", target_os = "ios"))] + UrlParse(#[from] url::ParseError), + #[cfg(any(target_os = "macos", target_os = "ios"))] + #[error("data store is currently opened")] + DataStoreInUse, +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/src/inject_initialization_scripts.rs b/packages/tauri-app/vendor/wry-0.54.4/src/inject_initialization_scripts.rs new file mode 100644 index 0000000000..61636d2043 --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/src/inject_initialization_scripts.rs @@ -0,0 +1,225 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +//! This is an internal implementation detail used by the Android backend to inject +//! initialization scripts when `addDocumentStartJavaScript` is not supported. + +use base64::{prelude::BASE64_STANDARD, Engine}; +use dom_query::Document; +use http::{ + header::{HeaderValue, CONTENT_SECURITY_POLICY, CONTENT_TYPE}, + Response as HttpResponse, +}; +use sha2::{Digest, Sha256}; +use std::borrow::Cow; + +use crate::InitializationScript; + +pub fn inject_scripts_into_html( + mut response: HttpResponse>, + scripts: &[InitializationScript], +) -> HttpResponse> { + if scripts.is_empty() { + return response; + } + + let should_inject_scripts = response + .headers() + .get(CONTENT_TYPE) + // Content-Type must begin with the media type, but is case-insensitive. + // It may also be followed by any number of semicolon-delimited key value pairs. + // We don't care about these here. + // source: https://httpwg.org/specs/rfc9110.html#rfc.section.8.3.1 + .and_then(|content_type| content_type.to_str().ok()) + .map(|content_type_str| content_type_str.to_lowercase().starts_with("text/html")) + .unwrap_or_default(); + + if !should_inject_scripts { + return response; + } + + let document = Document::from(String::from_utf8_lossy(response.body()).as_ref()); + let csp = response.headers_mut().get_mut(CONTENT_SECURITY_POLICY); + + // Get or create head element + let head = document.head().unwrap_or_else(|| { + let html = document.html_root(); + let head = document.tree.new_element("head"); + html.prepend_child(&head); + head + }); + + // Iterate in reverse order since we are prepending each script to the head tag + let mut hashes = Vec::new(); + for script in scripts.iter().rev().map(|s| &s.script) { + let script_tag = document.tree.new_element("script"); + script_tag.set_text(script.as_str()); + head.prepend_child(&script_tag); + if csp.is_some() { + hashes.push(hash_script(script)); + } + } + + if let Some(csp) = csp { + let csp_string = csp.to_str().unwrap().to_string(); + let csp_string = if csp_string.contains("script-src") { + csp_string.replace("script-src", &format!("script-src {}", hashes.join(" "))) + } else { + format!("{csp_string} script-src {}", hashes.join(" ")) + }; + *csp = HeaderValue::from_str(&csp_string).unwrap(); + } + + *response.body_mut() = Cow::Owned(document.html().as_bytes().to_vec()); + response +} + +fn hash_script(script: &str) -> String { + let mut hasher = Sha256::new(); + hasher.update(script); + let hash = hasher.finalize(); + format!("'sha256-{}'", BASE64_STANDARD.encode(hash)) +} + +#[cfg(test)] +mod tests { + use super::*; + use http::StatusCode; + + #[test] + fn test_no_scripts_returns_original_response() { + let body = "Test"; + + let result = run(body, "text/html", vec![]); + + assert_eq!(result, body); + } + + #[test] + fn test_non_html_response_not_modified() { + let body = r#"{"key": "value"}"#; + let scripts = vec!["console.log('test');".to_string()]; + + let result = run(body, "application/json", scripts); + + assert_eq!(result, body); + } + + #[test] + fn test_inject_single_script() { + let body = "Content"; + let scripts = vec!["console.log('injected');".to_string()]; + + let result = run(body, "text/html", scripts); + + assert_eq!( + result, + "Content" + ); + } + + #[test] + fn test_inject_multiple_scripts() { + let body = "Content"; + let scripts = vec![ + "var first = 1;".to_owned(), + "let second = 2;".to_owned(), + "const third = 3;".to_owned(), + "window.test = () => console.log('test');".to_owned(), + ]; + + let result = run(body, "text/html", scripts); + + assert_eq!( + result, + "Content" + ); + } + + #[test] + fn test_inject_script_creates_head_if_missing() { + let body = "Content"; + let scripts = vec!["console.log('test');".to_string()]; + + let result = run(body, "text/html", scripts); + + assert_eq!( + result, + "Content" + ); + } + + #[test] + fn test_inject_script_creates_html_structure_if_missing() { + let body = "Just some text"; + let scripts = vec!["console.log('test');".to_string()]; + + let result = run(body, "text/html", scripts); + + assert_eq!( + result, + "Just some text" + ); + } + + #[test] + fn test_csp_header_updated_with_script_hashes() { + let body = "Content"; + let mut response = create_response(body, "text/html"); + response.headers_mut().insert( + CONTENT_SECURITY_POLICY, + HeaderValue::from_static("default-src 'self'"), + ); + + let script_code = "console.log('test');"; + let scripts = vec![script_code.to_string()]; + + let scripts: Vec = scripts + .into_iter() + .map(|script| InitializationScript { + script, + for_main_frame_only: true, + }) + .collect(); + let result = inject_scripts_into_html(response, &scripts); + let result_body = String::from_utf8_lossy(result.body()).to_string(); + let csp = result.headers().get(CONTENT_SECURITY_POLICY).unwrap(); + let csp_str = csp.to_str().unwrap(); + + assert_eq!( + result_body, + "Content" + ); + assert_eq!( + csp_str, + "default-src 'self' script-src 'sha256-3x8DE279hr8o/Aq0dEdH4WApIwn5rbRKhugPzn6Bofw='" + ); + } + + fn create_response(body: &str, content_type: &'static str) -> HttpResponse> { + let mut response = HttpResponse::builder() + .status(StatusCode::OK) + .body(Cow::Owned(body.as_bytes().to_vec())) + .unwrap(); + response + .headers_mut() + .insert(CONTENT_TYPE, HeaderValue::from_static(content_type)); + + response + } + + /// Helper function to create a response, inject scripts, and return the body as a string + fn run(body: &str, content_type: &'static str, scripts: Vec) -> String { + let response = create_response(body, content_type); + let scripts: Vec = scripts + .into_iter() + .map(|script| InitializationScript { + script, + for_main_frame_only: true, + }) + .collect(); + let result = inject_scripts_into_html(response, &scripts); + String::from_utf8_lossy(result.body()).to_string() + } +} diff --git a/packages/tauri-app/vendor/wry-0.54.4/src/lib.rs b/packages/tauri-app/vendor/wry-0.54.4/src/lib.rs new file mode 100644 index 0000000000..de979345ca --- /dev/null +++ b/packages/tauri-app/vendor/wry-0.54.4/src/lib.rs @@ -0,0 +1,2570 @@ +// Copyright 2020-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +//!

WRY Webview Rendering library

+//! +//! [![](https://img.shields.io/crates/v/wry?style=flat-square)](https://crates.io/crates/wry) [![](https://img.shields.io/docsrs/wry?style=flat-square)](https://docs.rs/wry/) +//! [![License](https://img.shields.io/badge/License-MIT%20or%20Apache%202-green.svg)](https://opencollective.com/tauri) +//! [![Chat Server](https://img.shields.io/badge/chat-discord-7289da.svg)](https://discord.gg/SpmNs4S) +//! [![website](https://img.shields.io/badge/website-tauri.app-purple.svg)](https://tauri.app) +//! [![https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg](https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg)](https://good-labs.github.io/greater-good-affirmation) +//! [![support](https://img.shields.io/badge/sponsor-Open%20Collective-blue.svg)](https://opencollective.com/tauri) +//! +//! Wry is a cross-platform WebView rendering library. +//! +//! The webview requires a running event loop and a window type that implements [`HasWindowHandle`], +//! or a gtk container widget if you need to support X11 and Wayland. +//! You can use a windowing library like [`tao`] or [`winit`]. +//! +//! ## Examples +//! +//! This example leverages the [`HasWindowHandle`] and supports Windows, macOS, iOS, Android and Linux (X11 Only). +//! See the following example using [`winit`]: +//! +//! ```no_run +//! # use wry::{WebViewBuilder, raw_window_handle}; +//! # use winit::{application::ApplicationHandler, event::WindowEvent, event_loop::{ActiveEventLoop, EventLoop}, window::{Window, WindowId}}; +//! #[derive(Default)] +//! struct App { +//! window: Option, +//! webview: Option, +//! } +//! +//! impl ApplicationHandler for App { +//! fn resumed(&mut self, event_loop: &ActiveEventLoop) { +//! let window = event_loop.create_window(Window::default_attributes()).unwrap(); +//! let webview = WebViewBuilder::new() +//! .with_url("https://tauri.app") +//! .build(&window) +//! .unwrap(); +//! +//! self.window = Some(window); +//! self.webview = Some(webview); +//! } +//! +//! fn window_event(&mut self, _event_loop: &ActiveEventLoop, _window_id: WindowId, event: WindowEvent) {} +//! } +//! +//! let event_loop = EventLoop::new().unwrap(); +//! let mut app = App::default(); +//! event_loop.run_app(&mut app).unwrap(); +//! ``` +//! +//! If you also want to support Wayland too, then we recommend you use [`WebViewBuilderExtUnix::new_gtk`] on Linux. +//! See the following example using [`tao`]: +//! +//! ```no_run +//! # use wry::WebViewBuilder; +//! # use tao::{window::WindowBuilder, event_loop::EventLoop}; +//! # #[cfg(target_os = "linux")] +//! # use tao::platform::unix::WindowExtUnix; +//! # #[cfg(target_os = "linux")] +//! # use wry::WebViewBuilderExtUnix; +//! let event_loop = EventLoop::new(); +//! let window = WindowBuilder::new().build(&event_loop).unwrap(); +//! +//! let builder = WebViewBuilder::new().with_url("https://tauri.app"); +//! +//! #[cfg(not(target_os = "linux"))] +//! let webview = builder.build(&window).unwrap(); +//! #[cfg(target_os = "linux")] +//! let webview = builder.build_gtk(window.gtk_window()).unwrap(); +//! ``` +//! +//! ## Child webviews +//! +//! You can use [`WebView::new_as_child`] or [`WebViewBuilder::build_as_child`] to create the webview as a child inside another window. This is supported on +//! macOS, Windows and Linux (X11 Only). +//! +//! ```no_run +//! # use wry::{WebViewBuilder, raw_window_handle, Rect, dpi::*}; +//! # use winit::{application::ApplicationHandler, event::WindowEvent, event_loop::{ActiveEventLoop, EventLoop}, window::{Window, WindowId}}; +//! #[derive(Default)] +//! struct App { +//! window: Option, +//! webview: Option, +//! } +//! +//! impl ApplicationHandler for App { +//! fn resumed(&mut self, event_loop: &ActiveEventLoop) { +//! let window = event_loop.create_window(Window::default_attributes()).unwrap(); +//! let webview = WebViewBuilder::new() +//! .with_url("https://tauri.app") +//! .with_bounds(Rect { +//! position: LogicalPosition::new(100, 100).into(), +//! size: LogicalSize::new(200, 200).into(), +//! }) +//! .build_as_child(&window) +//! .unwrap(); +//! +//! self.window = Some(window); +//! self.webview = Some(webview); +//! } +//! +//! fn window_event(&mut self, _event_loop: &ActiveEventLoop, _window_id: WindowId, event: WindowEvent) {} +//! } +//! +//! let event_loop = EventLoop::new().unwrap(); +//! let mut app = App::default(); +//! event_loop.run_app(&mut app).unwrap(); +//! ``` +//! +//! If you want to support X11 and Wayland at the same time, we recommend using +//! [`WebViewExtUnix::new_gtk`] or [`WebViewBuilderExtUnix::new_gtk`] with [`gtk::Fixed`]. +//! +//! ```no_run +//! # use wry::{WebViewBuilder, raw_window_handle, Rect, dpi::*}; +//! # use tao::{window::WindowBuilder, event_loop::EventLoop}; +//! # #[cfg(target_os = "linux")] +//! # use wry::WebViewBuilderExtUnix; +//! # #[cfg(target_os = "linux")] +//! # use tao::platform::unix::WindowExtUnix; +//! let event_loop = EventLoop::new(); +//! let window = WindowBuilder::new().build(&event_loop).unwrap(); +//! +//! let builder = WebViewBuilder::new() +//! .with_url("https://tauri.app") +//! .with_bounds(Rect { +//! position: LogicalPosition::new(100, 100).into(), +//! size: LogicalSize::new(200, 200).into(), +//! }); +//! +//! #[cfg(not(target_os = "linux"))] +//! let webview = builder.build_as_child(&window).unwrap(); +//! #[cfg(target_os = "linux")] +//! let webview = { +//! # use gtk::prelude::*; +//! let vbox = window.default_vbox().unwrap(); // tao adds a gtk::Box by default +//! let fixed = gtk::Fixed::new(); +//! fixed.show_all(); +//! vbox.pack_start(&fixed, true, true, 0); +//! builder.build_gtk(&fixed).unwrap() +//! }; +//! ``` +//! +//! ## Platform Considerations +//! +//! Here is the underlying web engine each platform uses, and some dependencies you might need to install. +//! +//! ### Linux +//! +//! [WebKitGTK](https://webkitgtk.org/) is used to provide webviews on Linux which requires GTK, +//! so if the windowing library doesn't support GTK (as in [`winit`]) +//! you'll need to call [`gtk::init`] before creating the webview and then call [`gtk::main_iteration_do`] alongside +//! your windowing library event loop. +//! +//! ```no_run +//! # use wry::{WebView, WebViewBuilder}; +//! # use winit::{application::ApplicationHandler, event::WindowEvent, event_loop::{ActiveEventLoop, EventLoop}, window::{Window, WindowId}}; +//! #[derive(Default)] +//! struct App { +//! webview_window: Option<(Window, WebView)>, +//! } +//! +//! impl ApplicationHandler for App { +//! fn resumed(&mut self, event_loop: &ActiveEventLoop) { +//! let window = event_loop.create_window(Window::default_attributes()).unwrap(); +//! let webview = WebViewBuilder::new() +//! .with_url("https://tauri.app") +//! .build(&window) +//! .unwrap(); +//! +//! self.webview_window = Some((window, webview)); +//! } +//! +//! fn window_event(&mut self, _event_loop: &ActiveEventLoop, _window_id: WindowId, event: WindowEvent) {} +//! +//! // Advance GTK event loop