-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat(core): added WindowConfig::on_new_window, closes #14263 #14289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Package Changes Through c1969e6There are 10 changes which include @tauri-apps/api with minor, tauri-cli with minor, tauri-utils with minor, tauri-runtime-wry with minor, tauri-runtime with minor, tauri with minor, tauri-bundler with minor, @tauri-apps/cli with minor, tauri-codegen with patch, tauri-macros with patch Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
I would assume that this will force the Is it possible that we switch to something like |
is urlpattern currently only enabled when you have remote URLs in the capability files? Rust optimizes that away right? if so then we should optimize it indeed |
From testing this out, it seems to be the case, it's wild that the rust compiler is this smart to remove it to be honest, and with this PR, the file size remains the same if I use remove unused commands and don't include |
) | ||
.window_features(features) | ||
.on_document_title_changed(|window, title| { | ||
window.set_title(&title).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't unwrap
here 🙃
OnNewWindow::AllowTauriWindow { urls: None } => { | ||
tauri_runtime::webview::NewWindowResponse::Allow | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this mean creating a tauri window like the match above? (OnNewWindow::AllowTauriWindow { urls: Some(urls) }
)
} | ||
#[cfg(desktop)] | ||
NewWindowResponse::Create { window } => { | ||
tauri_runtime::webview::NewWindowResponse::Create { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's just me, but I still don't quite understand what does Create
do in wry
, I tried to look at the docs but I still don't really get it, and trying to call this in the simple
example in wry but this seems to just freeze the entire app
.with_new_window_req_handler(move |url, features| {
println!("new window req: {url} {features:?}");
wry::NewWindowResponse::Create {
webview: features.opener.webview,
}
});
//! - **macos-proxy**: Adds support for [`WebviewBuilder::proxy_url`] on macOS. Requires macOS 14+. | ||
//! - **specta**: Add support for [`specta::specta`](https://docs.rs/specta/%5E2.0.0-rc.9/specta/attr.specta.html) with Tauri arguments such as [`State`](crate::State), [`Window`](crate::Window) and [`AppHandle`](crate::AppHandle) | ||
//! - **dynamic-acl** *(enabled by default)*: Enables you to add ACLs at runtime, notably it enables the [`Manager::add_capability`] function. | ||
//! - **url-pattern**: Enables using the [URLPattern] spec for URL scopes on JavaScript APIs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need the link for this to work
//! - **url-pattern**: Enables using the [URLPattern] spec for URL scopes on JavaScript APIs. | |
//! - **url-pattern**: Enables using the [`URLPattern`](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern) spec for URL scopes on JavaScript APIs. |
No description provided.