mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix(Page): Page.waitForNavigation should correctly handle mixed content (#2339)
This patch teaches Page.waitForNavigation to correctly handle navigation to pages that have frames that might never load. These frames include: - frames which main resource loading was aborted due to mixed-content error - frames that artificially called `window.stop()` to interrupt loading themselves Fixes #1936.
This commit is contained in:
@@ -99,6 +99,17 @@ module.exports.addTests = function({testRunner, expect, PROJECT_ROOT, defaultBro
|
||||
await page.close();
|
||||
await browser.close();
|
||||
});
|
||||
it('should work with mixed content', async({server, httpsServer}) => {
|
||||
httpsServer.setRoute('/mixedcontent.html', (req, res) => {
|
||||
res.end(`<iframe src=${server.EMPTY_PAGE}></iframe>`);
|
||||
});
|
||||
const options = Object.assign({ignoreHTTPSErrors: true}, defaultBrowserOptions);
|
||||
const browser = await puppeteer.launch(options);
|
||||
const page = await browser.newPage();
|
||||
await page.goto(httpsServer.PREFIX + '/mixedcontent.html', {waitUntil: 'load'});
|
||||
await page.close();
|
||||
await browser.close();
|
||||
});
|
||||
it('should reject all promises when browser is closed', async() => {
|
||||
const browser = await puppeteer.launch(defaultBrowserOptions);
|
||||
const page = await browser.newPage();
|
||||
|
||||
Reference in New Issue
Block a user