Skip to content

Commit

Permalink
fix(firefox): isolate ignoreHTTPSErrors setting between contexts (#1617)
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-s authored Apr 1, 2020
1 parent c2617c0 commit c218d8c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "index.js",
"playwright": {
"chromium_revision": "754895",
"firefox_revision": "1062",
"firefox_revision": "1067",
"webkit_revision": "1185"
},
"scripts": {
Expand Down
4 changes: 1 addition & 3 deletions src/firefox/ffBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,12 @@ export class FFBrowser extends platform.EventEmitter implements Browser {
const { browserContextId } = await this._connection.send('Browser.createBrowserContext', {
userAgent: options.userAgent,
bypassCSP: options.bypassCSP,
ignoreHTTPSErrors: options.ignoreHTTPSErrors,
javaScriptDisabled: options.javaScriptEnabled === false ? true : undefined,
viewport,
locale: options.locale,
removeOnDetach: true
});
// TODO: move ignoreHTTPSErrors to browser context level.
if (options.ignoreHTTPSErrors)
await this._connection.send('Browser.setIgnoreHTTPSErrors', { enabled: true });
const context = new FFBrowserContext(this, browserContextId, options);
await context._initialize();
this._contexts.set(browserContextId, context);
Expand Down
4 changes: 2 additions & 2 deletions test/ignorehttpserrors.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports.describe = function({testRunner, expect, defaultBrowserOptions, p
expect(response.ok()).toBe(true);
await context.close();
});
it.fail(FFOX)('should isolate contexts', async({browser, httpsServer}) => {
it('should isolate contexts', async({browser, httpsServer}) => {
{
let error = null;
const context = await browser.newContext({ ignoreHTTPSErrors: true });
Expand All @@ -57,7 +57,7 @@ module.exports.describe = function({testRunner, expect, defaultBrowserOptions, p
});
const context = await browser.newContext({ ignoreHTTPSErrors: true });
const page = await context.newPage();
await page.goto(httpsServer.PREFIX + '/mixedcontent.html', {waitUntil: 'load'});
await page.goto(httpsServer.PREFIX + '/mixedcontent.html', {waitUntil: 'domcontentloaded'});
expect(page.frames().length).toBe(2);
// Make sure blocked iframe has functional execution context
// @see https://github.com/GoogleChrome/puppeteer/issues/2709
Expand Down

0 comments on commit c218d8c

Please sign in to comment.