You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In headful mode, browser.close doesn't force-close browser, stalling the process in case of beforeunload dialogs. This is a little surprising to me - I'd expect beforeunloads to be ignored by default.
constpuppeteer=require('puppeteer');(async()=>{constbrowser=awaitpuppeteer.launch({headless: false,userDataDir: 'ppp',});constpage=awaitbrowser.newPage();awaitpage.goto('https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload');constframe=page.frames().find(frame=>frame.name()==='iframeResult');awaitPromise.all([// make sure beforeunload triggers oncenewPromise(resolve=>page.once('dialog',resolve)).then(dialog=>dialog.dismiss()),frame.click('a'),]);// This will hang foreverconsole.log('Exiting...');awaitbrowser.close();console.log('Done.');})();
The text was updated successfully, but these errors were encountered:
Puppeteer: v1.11.0
In headful mode,
browser.close
doesn't force-close browser, stalling the process in case of beforeunload dialogs. This is a little surprising to me - I'd expect beforeunloads to be ignored by default.The text was updated successfully, but these errors were encountered: