Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(firefox): isolate ignoreHTTPSErrors setting between contexts (#1617)

Yury Semikhatskyc218d8c25f66
diff --git a/package.json b/package.json
index ee73c3bcdf..0ff910cd10 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,7 @@
"main": "index.js",
"playwright": {
"chromium_revision": "754895",
- "firefox_revision": "1062",
+ "firefox_revision": "1067",
"webkit_revision": "1185"
},
"scripts": {
diff --git a/src/firefox/ffBrowser.ts b/src/firefox/ffBrowser.ts
index 7adcf7cc73..ca8e5131fc 100644
--- a/src/firefox/ffBrowser.ts
+++ b/src/firefox/ffBrowser.ts
@@ -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);
diff --git a/test/ignorehttpserrors.spec.js b/test/ignorehttpserrors.spec.js
index 30eea3c6ac..8ba5b4c6b4 100644
--- a/test/ignorehttpserrors.spec.js
+++ b/test/ignorehttpserrors.spec.js
@@ -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 });
@@ -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