@@ -506,10 +506,8 @@ impl<R: Runtime> WindowManager<R> {
506506 }
507507
508508 pub ( crate ) fn protocol_url ( & self ) -> Cow < ' _ , Url > {
509- if cfg ! ( windows) {
509+ if cfg ! ( windows) || cfg ! ( target_os = "android" ) {
510510 Cow :: Owned ( Url :: parse ( "http://tauri.localhost" ) . unwrap ( ) )
511- } else if cfg ! ( target_os = "android" ) {
512- Cow :: Owned ( Url :: parse ( "https://tauri.localhost" ) . unwrap ( ) )
513511 } else {
514512 Cow :: Owned ( Url :: parse ( "tauri://localhost" ) . unwrap ( ) )
515513 }
@@ -614,13 +612,11 @@ impl<R: Runtime> WindowManager<R> {
614612 let window_url = Url :: parse ( & pending. url ) . unwrap ( ) ;
615613 let window_origin = if window_url. scheme ( ) == "data" {
616614 "null" . into ( )
617- } else if cfg ! ( windows) && window_url. scheme ( ) != "http" && window_url. scheme ( ) != "https" {
618- format ! ( "http://{}.localhost" , window_url. scheme( ) )
619- } else if cfg ! ( target_os = "android" )
615+ } else if ( cfg ! ( windows) || cfg ! ( target_os = "android" ) )
620616 && window_url. scheme ( ) != "http"
621617 && window_url. scheme ( ) != "https"
622618 {
623- format ! ( "https ://{}.localhost" , window_url. scheme( ) )
619+ format ! ( "http ://{}.localhost" , window_url. scheme( ) )
624620 } else {
625621 format ! (
626622 "{}://{}{}" ,
@@ -883,10 +879,8 @@ mod test {
883879 {
884880 assert_eq ! (
885881 manager. get_url( ) . to_string( ) ,
886- if cfg!( windows) {
882+ if cfg!( windows) || cfg! ( target_os = "android" ) {
887883 "http://tauri.localhost/"
888- } else if cfg!( target_os = "android" ) {
889- "https://tauri.localhost/"
890884 } else {
891885 "tauri://localhost"
892886 }
0 commit comments