question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] WebKit: new BrowserContexts share same proxy

See original GitHub issue

Context:

  • Playwright Version: 1.17.1
  • Operating System: Windows
  • Node.js version: 14.18.2
  • Browser: WebKit

Describe the bug Starting a new WebKit BrowserContext should be isolated from the rest of contexts, same as it does for Chromium and Firefox.

Currently it is not in WebKit, but it is in Chromium and Firefox.

  1. Launch Webkit
  2. Create new context A, with proxy server set to PROXY_A
  3. Create another context B, with proxy server set to PROXY_B
  4. Switch to context A, run a request.

Expected: Requests should go through PROXY_A Actual: Requests for both of contexts run through PROXY_B

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yury-scommented, Dec 8, 2021

If you launch a new browser instance they proxy settings will certainly be isolated, you can use i as a workaround for now. The proxy settings are supposed to be isolated between the browser contexts though. There may be a bug/limitation in our windows implementation, I’ll need to boot into Windows to check.

0reactions
creagecommented, Dec 8, 2021

@yury-s I can confirm now, that browser = webkit.launch() before doing browser.newContext() solves the isolation issue.

const proxy = await AppComponent.startNewNtlmProxyForUser(user);

if ((browser as unknown as Record<string, unknown>)._name === 'webkit') {
    browser = await webkit.launch();
}

const context = await browser.newContext({
    ...contextOptions,
    proxy: {
        server: proxy.address
    }
});

context.on('close', async () => proxy.stop());
Read more comments on GitHub >

github_iconTop Results From Across the Web

Browser_crash - heap-use-after-free in extensions ... - Monorail
Issue 1081350: Security: Browser_crash - heap-use-after-free in extensions::ChromeExtensionsBrowserClient::GetOriginalContext(content:: ...
Read more >
Dotnetbrowser different proxy settings in multiple browser ...
I am happy to let you know that we've just released DotNetBrowser 1.10. The mentioned issue has been resolved. You are welcome to...
Read more >
Playwright for - Go Packages
Package playwright is a library to automate Chromium, Firefox and WebKit with a single API.
Read more >
Puppeteer documentation - DevDocs
Creates a new incognito browser context. This won't share cookies/cache with other browser contexts. (async () => { const browser = await puppeteer.launch() ......
Read more >
Browser - MarketSquare
To make pages in the same suite share state, use the same context by ... Test Cases * Starting a browser with a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found