mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-02-06 15:26:54 +00:00
Remove Sync requirement on on_new_window
This commit is contained in:
parent
ee89ab8d92
commit
c29c19cb95
@ -33,7 +33,7 @@ type WebResourceRequestHandler =
|
||||
|
||||
type NavigationHandler = dyn Fn(&Url) -> bool + Send;
|
||||
|
||||
type NewWindowHandler = dyn Fn(Url, NewWindowFeatures) -> NewWindowResponse + Send + Sync;
|
||||
type NewWindowHandler = dyn Fn(Url, NewWindowFeatures) -> NewWindowResponse + Send;
|
||||
|
||||
type OnPageLoadHandler = dyn Fn(Url, PageLoadEvent) + Send;
|
||||
|
||||
|
||||
@ -58,8 +58,7 @@ use std::{
|
||||
pub(crate) type WebResourceRequestHandler =
|
||||
dyn Fn(http::Request<Vec<u8>>, &mut http::Response<Cow<'static, [u8]>>) + Send + Sync;
|
||||
pub(crate) type NavigationHandler = dyn Fn(&Url) -> bool + Send;
|
||||
pub(crate) type NewWindowHandler<R> =
|
||||
dyn Fn(Url, NewWindowFeatures) -> NewWindowResponse<R> + Send + Sync;
|
||||
pub(crate) type NewWindowHandler<R> = dyn Fn(Url, NewWindowFeatures) -> NewWindowResponse<R> + Send;
|
||||
pub(crate) type UriSchemeProtocolHandler =
|
||||
Box<dyn Fn(&str, http::Request<Vec<u8>>, UriSchemeResponder) + Send + Sync>;
|
||||
pub(crate) type OnPageLoad<R> = dyn Fn(Webview<R>, PageLoadPayload<'_>) + Send + Sync + 'static;
|
||||
@ -581,12 +580,9 @@ tauri::Builder::default()
|
||||
/// # Platform-specific
|
||||
///
|
||||
/// - **Android / iOS**: Not supported.
|
||||
/// - **Windows**: The closure is executed on a separate thread to prevent a deadlock.
|
||||
///
|
||||
/// [window.open]: https://developer.mozilla.org/en-US/docs/Web/API/Window/open
|
||||
pub fn on_new_window<
|
||||
F: Fn(Url, NewWindowFeatures) -> NewWindowResponse<R> + Send + Sync + 'static,
|
||||
>(
|
||||
pub fn on_new_window<F: Fn(Url, NewWindowFeatures) -> NewWindowResponse<R> + Send + 'static>(
|
||||
mut self,
|
||||
f: F,
|
||||
) -> Self {
|
||||
@ -724,7 +720,6 @@ tauri::Builder::default()
|
||||
as Box<
|
||||
dyn Fn(Url, NewWindowFeatures) -> tauri_runtime::webview::NewWindowResponse
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
>
|
||||
});
|
||||
|
||||
@ -314,12 +314,9 @@ impl<'a, R: Runtime, M: Manager<R>> WebviewWindowBuilder<'a, R, M> {
|
||||
/// # Platform-specific
|
||||
///
|
||||
/// - **Android / iOS**: Not supported.
|
||||
/// - **Windows**: The closure is executed on a separate thread to prevent a deadlock.
|
||||
///
|
||||
/// [window.open]: https://developer.mozilla.org/en-US/docs/Web/API/Window/open
|
||||
pub fn on_new_window<
|
||||
F: Fn(Url, NewWindowFeatures) -> NewWindowResponse<R> + Send + Sync + 'static,
|
||||
>(
|
||||
pub fn on_new_window<F: Fn(Url, NewWindowFeatures) -> NewWindowResponse<R> + Send + 'static>(
|
||||
mut self,
|
||||
f: F,
|
||||
) -> Self {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user