@@ -268,30 +268,36 @@ describe('app links', () => {
268268 frameTreeNodeId : 2 ,
269269 origin : 'https://ads.example' ,
270270 } as WebFrameMain
271- requestExternalLaunch ( contents , 'zoommtg://zoom.us/join' , { initiator : frame } )
272- requestExternalLaunch ( contents , 'zoommtg://zoom.us/join' , {
273- initiator : topFrame ( 'https://ads.example' ) ,
274- } )
275- requestExternalLaunch ( contents , 'zoommtg://zoom.us/join' , { initiator : null } )
271+ requestExternalLaunch ( contents , 'zoommtg://zoom.us/join' , frame )
272+ requestExternalLaunch ( contents , 'zoommtg://zoom.us/join' , topFrame ( 'https://ads.example' ) )
273+ requestExternalLaunch ( contents , 'zoommtg://zoom.us/join' , null )
276274 expect ( pagePromptForContents ( contents ) ) . toBeUndefined ( )
277275 expect ( appLaunchNoticeForContents ( contents ) ) . toBeUndefined ( )
278276 } )
279277
280- it ( 'asks after the top document is clicked, but only offers a popup passively' , ( ) => {
278+ it ( 'asks after the top document is clicked, and otherwise only offers passively' , ( ) => {
281279 const clicked = agentContents ( )
282- requestExternalLaunch ( clicked , 'zoommtg://zoom.us/join' , { initiator : topFrame ( ) } )
280+ requestExternalLaunch ( clicked , 'zoommtg://zoom.us/join' , topFrame ( ) )
283281 expect ( pagePromptForContents ( clicked ) ) . toMatchObject ( { kind : 'external-app' , appName : 'Zoom' } )
284282
285- const popup = agentContents ( )
286- requestExternalLaunch ( popup , 'zoommtg://zoom.us/join' , 'popup' )
287- expect ( pagePromptForContents ( popup ) ) . toBeUndefined ( )
288- expect ( appLaunchNoticeForContents ( popup ) ) . toMatchObject ( { origin : PAGE , appName : 'Zoom' } )
283+ context . userActivated = false
284+ const unclicked = agentContents ( )
285+ requestExternalLaunch ( unclicked , 'zoommtg://zoom.us/join' , topFrame ( ) )
286+ expect ( pagePromptForContents ( unclicked ) ) . toBeUndefined ( )
287+ expect ( appLaunchNoticeForContents ( unclicked ) ) . toMatchObject ( { origin : PAGE , appName : 'Zoom' } )
288+ } )
289+
290+ it ( 'opens nothing, not even a clicked mail link, without a renderer that shows prompts' , async ( ) => {
291+ context . promptsEnabled = false
292+ requestExternalLaunch ( agentContents ( ) , 'mailto:ada@example.com' , topFrame ( ) )
293+ await vi . advanceTimersByTimeAsync ( 0 )
294+ expect ( shell . openExternal ) . not . toHaveBeenCalled ( )
289295 } )
290296
291297 it ( 'opens only the first link while its prompt is pending' , async ( ) => {
292298 const contents = agentContents ( )
293- requestExternalLaunch ( contents , 'zoommtg://zoom.us/join?id=1' , { initiator : topFrame ( ) } )
294- requestExternalLaunch ( contents , 'zoommtg://zoom.us/join?id=2' , { initiator : topFrame ( ) } )
299+ requestExternalLaunch ( contents , 'zoommtg://zoom.us/join?id=1' , topFrame ( ) )
300+ requestExternalLaunch ( contents , 'zoommtg://zoom.us/join?id=2' , topFrame ( ) )
295301 expect ( appLaunchNoticeForContents ( contents ) ) . toBeUndefined ( )
296302 answer ( contents , { allowed : true , kind : 'external-app' , alwaysAllow : false } )
297303 await vi . advanceTimersByTimeAsync ( 0 )
@@ -300,11 +306,11 @@ describe('app links', () => {
300306
301307 it ( 'forgets "Always allow" on reset' , async ( ) => {
302308 const contents = agentContents ( )
303- requestExternalLaunch ( contents , 'zoommtg://zoom.us/join?id=1' , { initiator : topFrame ( ) } )
309+ requestExternalLaunch ( contents , 'zoommtg://zoom.us/join?id=1' , topFrame ( ) )
304310 answer ( contents , { allowed : true , kind : 'external-app' , alwaysAllow : true } )
305311 resetPagePromptDecisions ( )
306312 vi . advanceTimersByTime ( 20_000 )
307- requestExternalLaunch ( contents , 'zoommtg://zoom.us/join?id=2' , { initiator : topFrame ( ) } )
313+ requestExternalLaunch ( contents , 'zoommtg://zoom.us/join?id=2' , topFrame ( ) )
308314 await vi . advanceTimersByTimeAsync ( 0 )
309315 expect ( pagePromptForContents ( contents ) ) . toMatchObject ( { kind : 'external-app' } )
310316 expect ( shell . openExternal ) . toHaveBeenCalledExactlyOnceWith ( 'zoommtg://zoom.us/join?id=1' )
@@ -383,7 +389,7 @@ describe('accepting an answer', () => {
383389 vi . mocked ( shell . openExternal ) . mockClear ( )
384390 context . userActivated = slot === 'prompt'
385391 const contents = agentContents ( )
386- requestExternalLaunch ( contents , 'zoommtg://zoom.us/join' , { initiator : topFrame } )
392+ requestExternalLaunch ( contents , 'zoommtg://zoom.us/join' , topFrame )
387393 const requestId =
388394 slot === 'prompt'
389395 ? shownPrompt ( contents ) . requestId
0 commit comments