@@ -1236,6 +1236,45 @@ it.live.each([false, true])(
12361236 ) . pipe ( Effect . provide ( layer ) ) ,
12371237) ;
12381238
1239+ it . effect ( "a tab showing a data: page reports its URL without the content" , ( ) =>
1240+ Effect . scoped (
1241+ Effect . gen ( function * ( ) {
1242+ const { broker, tabId } = yield * ready ;
1243+ const sibling = yield * broker . invoke < PreviewAutomationStatus > ( {
1244+ scope : asSession ( "agent-b" ) ,
1245+ operation : "open" ,
1246+ input : { reuseExistingTab : false , show : false } ,
1247+ } ) ;
1248+ yield * Effect . promise ( ( ) => contexts [ 1 ] ! . page . goto ( "data:text/html,<p>SIBLING-SECRET</p>" ) ) ;
1249+ const manager = yield * Manager . PreviewManager ;
1250+ const events = yield * manager . subscribeEvents ;
1251+ yield * Effect . promise ( ( ) => contexts [ 0 ] ! . page . goto ( "data:text/html,<p>SECRET-KEY</p>" ) ) ;
1252+ let event = yield * PubSub . take ( events ) ;
1253+ while (
1254+ event . type !== "navigated" ||
1255+ event . tabId !== tabId ||
1256+ event . snapshot . navStatus . _tag !== "Success"
1257+ ) {
1258+ event = yield * PubSub . take ( events ) ;
1259+ }
1260+ const status = yield * broker . invoke < PreviewAutomationStatus > ( {
1261+ scope,
1262+ tabId,
1263+ operation : "status" ,
1264+ input : { } ,
1265+ } ) ;
1266+ expect ( event . snapshot . navStatus ) . toMatchObject ( { url : "data:text/html,…" } ) ;
1267+ expect ( status . url ) . toBe ( "data:text/html,…" ) ;
1268+ expect ( status . tabs ?. find ( ( entry ) => entry . tabId === tabId ) ?. url ) . toBe ( "data:text/html,…" ) ;
1269+ expect ( status . tabs ?. find ( ( entry ) => entry . tabId === sibling . tabId ) ?. url ) . toBe (
1270+ "data:text/html,…" ,
1271+ ) ;
1272+ expect ( JSON . stringify ( [ event , status ] ) ) . not . toContain ( "SECRET-KEY" ) ;
1273+ expect ( JSON . stringify ( [ event , status ] ) ) . not . toContain ( "SIBLING-SECRET" ) ;
1274+ } ) ,
1275+ ) . pipe ( Effect . provide ( layer ) ) ,
1276+ ) ;
1277+
12391278it . live . each ( [ "save failed" , "oversized" ] ) (
12401279 "a rejected download releases the original and keeps no saved copy (%s)" ,
12411280 ( outcome ) =>
0 commit comments