mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-07-14 19:10:28 +03:00
fix: set window origin default to null (#9899)
This commit is contained in:
parent
3f1c59d684
commit
aa55e03354
5
.changes/tauri-window-origin-default-to-null.md
Normal file
5
.changes/tauri-window-origin-default-to-null.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'tauri': 'patch:bug'
|
||||
---
|
||||
|
||||
Set default window origin to `null`. Prevent window crash when loading `about:blank`.
|
@ -253,16 +253,18 @@ impl<R: Runtime> WebviewManager<R> {
|
||||
&& window_url.scheme() != "https"
|
||||
{
|
||||
format!("http://{}.localhost", window_url.scheme())
|
||||
} else {
|
||||
} else if let Some(host) = window_url.host() {
|
||||
format!(
|
||||
"{}://{}{}",
|
||||
window_url.scheme(),
|
||||
window_url.host().unwrap(),
|
||||
host,
|
||||
window_url
|
||||
.port()
|
||||
.map(|p| format!(":{p}"))
|
||||
.unwrap_or_default()
|
||||
)
|
||||
} else {
|
||||
"null".into()
|
||||
};
|
||||
|
||||
if !registered_scheme_protocols.contains(&"tauri".into()) {
|
||||
|
Loading…
Reference in New Issue
Block a user