@@ -141,7 +141,7 @@ impl<R: Runtime> WebviewManager<R> {
141141 isolation_origin : & match & * app_manager. pattern {
142142 #[ cfg( feature = "isolation" ) ]
143143 crate :: Pattern :: Isolation { schema, .. } => {
144- crate :: pattern :: format_real_schema ( schema, use_https_scheme)
144+ crate :: webview :: custom_scheme_url ( schema, use_https_scheme)
145145 }
146146 _ => "" . to_owned ( ) ,
147147 } ,
@@ -199,7 +199,7 @@ impl<R: Runtime> WebviewManager<R> {
199199 if let crate :: Pattern :: Isolation { schema, .. } = & * app_manager. pattern {
200200 all_initialization_scripts. push ( main_frame_script (
201201 IsolationJavascript {
202- isolation_src : & crate :: pattern :: format_real_schema ( schema, use_https_scheme) ,
202+ isolation_src : crate :: webview :: custom_scheme_url ( schema, use_https_scheme) . as_str ( ) ,
203203 style : tauri_utils:: pattern:: isolation:: IFRAME_STYLE ,
204204 }
205205 . render_default ( & Default :: default ( ) ) ?
@@ -238,7 +238,7 @@ impl<R: Runtime> WebviewManager<R> {
238238 let window_url = Url :: parse ( & pending. url ) . unwrap ( ) ;
239239 let window_origin = if window_url. scheme ( ) == "data" {
240240 "null" . into ( )
241- } else if ( cfg ! ( windows) || cfg ! ( target_os = "android" ) )
241+ } else if ( ! cfg ! ( feature = "cef" ) && cfg ! ( windows) || cfg ! ( target_os = "android" ) )
242242 && window_url. scheme ( ) != "http"
243243 && window_url. scheme ( ) != "https"
244244 {
@@ -368,7 +368,7 @@ impl<R: Runtime> WebviewManager<R> {
368368 struct CoreJavascript < ' a > {
369369 os_name : & ' a str ,
370370 protocol_scheme : & ' a str ,
371- invoke_key : & ' a str ,
371+ cef : bool ,
372372 }
373373
374374 let freeze_prototype = if app_manager. config . app . security . freeze_prototype {
@@ -383,7 +383,7 @@ impl<R: Runtime> WebviewManager<R> {
383383 core_script : & CoreJavascript {
384384 os_name : std:: env:: consts:: OS ,
385385 protocol_scheme : if use_https_scheme { "https" } else { "http" } ,
386- invoke_key : self . invoke_key ( ) ,
386+ cef : cfg ! ( feature = "cef" ) ,
387387 }
388388 . render_default ( & Default :: default ( ) ) ?
389389 . into_string ( ) ,
@@ -548,12 +548,20 @@ impl<R: Runtime> WebviewManager<R> {
548548 let navigation_handler = pending. navigation_handler . take ( ) ;
549549 let app_manager = manager. manager_owned ( ) ;
550550 let label = pending. label . clone ( ) ;
551+
552+ #[ cfg( feature = "isolation" ) ]
553+ let isolation_frame_url = if let crate :: Pattern :: Isolation { schema, .. } = & * pattern {
554+ Some ( Url :: parse ( & crate :: webview:: custom_scheme_url ( schema, pending. webview_attributes . use_https_scheme ) ) . unwrap ( ) )
555+ } else {
556+ None
557+ } ;
558+
551559 pending. navigation_handler = Some ( Box :: new ( move |url| {
552560 // always allow navigation events for the isolation iframe and do not emit them for consumers
553561 #[ cfg( feature = "isolation" ) ]
554- if let crate :: Pattern :: Isolation { schema , .. } = & * pattern {
555- if url. scheme ( ) == schema
556- && url. domain ( ) == Some ( crate :: pattern :: ISOLATION_IFRAME_SRC_DOMAIN )
562+ if let Some ( isolation_frame_url ) = & isolation_frame_url {
563+ if url. scheme ( ) == isolation_frame_url . scheme ( )
564+ && url. domain ( ) == isolation_frame_url . domain ( )
557565 {
558566 return true ;
559567 }
0 commit comments