Skip to content

Commit 2bfe7d1

Browse files
authored
fix: session doesnt respect the context options (#4111)
1 parent 49b411a commit 2bfe7d1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: lib/helper/Playwright.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,9 @@ class Playwright extends Helper {
517517
if (this.options.userAgent) contextOptions.userAgent = this.options.userAgent;
518518
if (this.options.locale) contextOptions.locale = this.options.locale;
519519
if (this.options.colorScheme) contextOptions.colorScheme = this.options.colorScheme;
520+
this.contextOptions = contextOptions;
520521
if (!this.browserContext || !restartsSession()) {
521-
this.browserContext = await this.browser.newContext(contextOptions); // Adding the HTTPSError ignore in the context so that we can ignore those errors
522+
this.browserContext = await this.browser.newContext(this.contextOptions); // Adding the HTTPSError ignore in the context so that we can ignore those errors
522523
}
523524
}
524525

@@ -606,7 +607,7 @@ class Playwright extends Helper {
606607
page = await browser.firstWindow();
607608
} else {
608609
try {
609-
browserContext = await this.browser.newContext(Object.assign(this.options, config));
610+
browserContext = await this.browser.newContext(Object.assign(this.contextOptions, config));
610611
page = await browserContext.newPage();
611612
} catch (e) {
612613
if (this.playwrightOptions.userDataDir) {

0 commit comments

Comments
 (0)