mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
5
.changes/core-unix-window-data-url.md
Normal file
5
.changes/core-unix-window-data-url.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'tauri': 'patch:bug'
|
||||
---
|
||||
|
||||
On macOS and Linux, fix app crashing when creating a window with `data:` uri.
|
||||
@@ -471,21 +471,21 @@ impl<R: Runtime> WindowManager<R> {
|
||||
}
|
||||
|
||||
let window_url = Url::parse(&pending.url).unwrap();
|
||||
let window_origin =
|
||||
if cfg!(windows) && window_url.scheme() != "http" && window_url.scheme() != "https" {
|
||||
format!("https://{}.localhost", window_url.scheme())
|
||||
} else {
|
||||
format!(
|
||||
"{}://{}{}",
|
||||
window_url.scheme(),
|
||||
window_url.host().unwrap(),
|
||||
if let Some(port) = window_url.port() {
|
||||
format!(":{port}")
|
||||
} else {
|
||||
"".into()
|
||||
}
|
||||
)
|
||||
};
|
||||
let window_origin = if window_url.scheme() == "data" {
|
||||
"null".into()
|
||||
} else if cfg!(windows) && window_url.scheme() != "http" && window_url.scheme() != "https" {
|
||||
format!("https://{}.localhost", window_url.scheme())
|
||||
} else {
|
||||
format!(
|
||||
"{}://{}{}",
|
||||
window_url.scheme(),
|
||||
window_url.host().unwrap(),
|
||||
window_url
|
||||
.port()
|
||||
.map(|p| format!(":{p}"))
|
||||
.unwrap_or_default()
|
||||
)
|
||||
};
|
||||
|
||||
if !registered_scheme_protocols.contains(&"tauri".into()) {
|
||||
let web_resource_request_handler = pending.web_resource_request_handler.take();
|
||||
|
||||
Reference in New Issue
Block a user