|
@@ -25,6 +25,7 @@ use tauri_utils::{
|
|
|
html::{SCRIPT_NONCE_TOKEN, STYLE_NONCE_TOKEN},
|
|
|
};
|
|
|
|
|
|
+use crate::app::{GlobalMenuEventListener, WindowMenuEvent};
|
|
|
use crate::hooks::IpcJavascript;
|
|
|
#[cfg(feature = "isolation")]
|
|
|
use crate::hooks::IsolationJavascript;
|
|
@@ -50,10 +51,6 @@ use crate::{
|
|
|
Context, EventLoopMessage, Icon, Invoke, Manager, Pattern, Runtime, Scopes, StateManager, Window,
|
|
|
WindowEvent,
|
|
|
};
|
|
|
-use crate::{
|
|
|
- app::{GlobalMenuEventListener, WindowMenuEvent},
|
|
|
- window::WebResourceRequestHandler,
|
|
|
-};
|
|
|
|
|
|
#[cfg(any(target_os = "linux", target_os = "windows"))]
|
|
|
use crate::api::path::{resolve_path, BaseDirectory};
|
|
@@ -401,7 +398,6 @@ impl<R: Runtime> WindowManager<R> {
|
|
|
label: &str,
|
|
|
window_labels: &[String],
|
|
|
app_handle: AppHandle<R>,
|
|
|
- web_resource_request_handler: Option<Box<WebResourceRequestHandler>>,
|
|
|
) -> crate::Result<PendingWindow<EventLoopMessage, R>> {
|
|
|
let is_init_global = self.inner.config.build.with_global_tauri;
|
|
|
let plugin_init = self
|
|
@@ -492,6 +488,7 @@ impl<R: Runtime> WindowManager<R> {
|
|
|
};
|
|
|
|
|
|
if !registered_scheme_protocols.contains(&"tauri".into()) {
|
|
|
+ let web_resource_request_handler = pending.web_resource_request_handler.take();
|
|
|
pending.register_uri_scheme_protocol(
|
|
|
"tauri",
|
|
|
self.prepare_uri_scheme_protocol(&window_origin, web_resource_request_handler),
|
|
@@ -1122,7 +1119,6 @@ impl<R: Runtime> WindowManager<R> {
|
|
|
app_handle: AppHandle<R>,
|
|
|
mut pending: PendingWindow<EventLoopMessage, R>,
|
|
|
window_labels: &[String],
|
|
|
- web_resource_request_handler: Option<Box<WebResourceRequestHandler>>,
|
|
|
) -> crate::Result<PendingWindow<EventLoopMessage, R>> {
|
|
|
if self.windows_lock().contains_key(&pending.label) {
|
|
|
return Err(crate::Error::WindowLabelAlreadyExists(pending.label));
|
|
@@ -1186,13 +1182,7 @@ impl<R: Runtime> WindowManager<R> {
|
|
|
}
|
|
|
|
|
|
let label = pending.label.clone();
|
|
|
- pending = self.prepare_pending_window(
|
|
|
- pending,
|
|
|
- &label,
|
|
|
- window_labels,
|
|
|
- app_handle.clone(),
|
|
|
- web_resource_request_handler,
|
|
|
- )?;
|
|
|
+ pending = self.prepare_pending_window(pending, &label, window_labels, app_handle.clone())?;
|
|
|
pending.ipc_handler = Some(self.prepare_ipc_handler(app_handle));
|
|
|
|
|
|
// in `Windows`, we need to force a data_directory
|