Skip to content

Commit

Permalink
fix: session doesnt respect the context options (#4111)
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent authored Jan 12, 2024
1 parent 49b411a commit 2bfe7d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/helper/Playwright.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,9 @@ class Playwright extends Helper {
if (this.options.userAgent) contextOptions.userAgent = this.options.userAgent;
if (this.options.locale) contextOptions.locale = this.options.locale;
if (this.options.colorScheme) contextOptions.colorScheme = this.options.colorScheme;
this.contextOptions = contextOptions;
if (!this.browserContext || !restartsSession()) {
this.browserContext = await this.browser.newContext(contextOptions); // Adding the HTTPSError ignore in the context so that we can ignore those errors
this.browserContext = await this.browser.newContext(this.contextOptions); // Adding the HTTPSError ignore in the context so that we can ignore those errors
}
}

Expand Down Expand Up @@ -606,7 +607,7 @@ class Playwright extends Helper {
page = await browser.firstWindow();
} else {
try {
browserContext = await this.browser.newContext(Object.assign(this.options, config));
browserContext = await this.browser.newContext(Object.assign(this.contextOptions, config));
page = await browserContext.newPage();
} catch (e) {
if (this.playwrightOptions.userDataDir) {
Expand Down

0 comments on commit 2bfe7d1

Please sign in to comment.