File tree Expand file tree Collapse file tree 2 files changed +20
-15
lines changed
Expand file tree Collapse file tree 2 files changed +20
-15
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' tauri ' : ' patch:bug'
3+ ---
4+
5+ On macOS and Linux, fix app crashing when creating a window with ` data: ` uri.
Original file line number Diff line number Diff line change @@ -471,21 +471,21 @@ impl<R: Runtime> WindowManager<R> {
471471 }
472472
473473 let window_url = Url :: parse ( & pending. url ) . unwrap ( ) ;
474- let window_origin =
475- if cfg ! ( windows ) && window_url . scheme ( ) != "http" && window_url . scheme ( ) != "https" {
476- format ! ( "https://{}.localhost" , window_url. scheme( ) )
477- } else {
478- format ! (
479- "{}://{}{}" ,
480- window_url . scheme ( ) ,
481- window_url. host ( ) . unwrap ( ) ,
482- if let Some ( port ) = window_url . port ( ) {
483- format! ( ":{port}" )
484- } else {
485- "" . into ( )
486- }
487- )
488- } ;
474+ let window_origin = if window_url . scheme ( ) == "data" {
475+ "null" . into ( )
476+ } else if cfg ! ( windows ) && window_url . scheme ( ) != "http" && window_url. scheme ( ) != "https" {
477+ format ! ( "https://{}.localhost" , window_url . scheme ( ) )
478+ } else {
479+ format ! (
480+ "{}://{}{}" ,
481+ window_url. scheme ( ) ,
482+ window_url . host ( ) . unwrap ( ) ,
483+ window_url
484+ . port ( )
485+ . map ( |p| format! ( ":{p}" ) )
486+ . unwrap_or_default ( )
487+ )
488+ } ;
489489
490490 if !registered_scheme_protocols. contains ( & "tauri" . into ( ) ) {
491491 let web_resource_request_handler = pending. web_resource_request_handler . take ( ) ;
You can’t perform that action at this time.
0 commit comments