Target.createBrowserContext with proxyServer parameter not working.
See original GitHub issueI was trying to test Target.createBrowserContext
to see what it does, and can’t seem to find a way to make the proxyServer
parameter work. The same proxy works if I set it when launching chrome with the --proxy-server=
flag. I tried setting the proxy with and without scheme://
but the ip shown in the website visited with Target.createTarget
is always my real ip, not the proxy.
To test it, I am launching chrome with --remote-debugging-port=9222
and then running this nodejs script:
const CDP = require('chrome-remote-interface');
async function start() {
// get browser target
const {webSocketDebuggerUrl} = await CDP.Version();
const browser = await CDP({
target: webSocketDebuggerUrl
});
const {Target} = browser;
// create new context with proxy
const {browserContextId} = await Target.createBrowserContext({
proxyServer: '127.0.0.1:12345'
});
// create new target
const {targetId} = await Target.createTarget({
url: 'https://icanhazip.com',
browserContextId
});
}
start();
Am I using it wrong?
Component | Version |
---|---|
Operating system | Windows 10 |
Node.js | 14.17.5 |
Chrome/Chromium/… | Chrome 99.0.4844.82 (Official Build) (64-bit) |
chrome-remote-interface | 0.31.1 |
Is Chrome running in a container? NO
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Target domain - Chrome DevTools Protocol - GitHub Pages
Retrieves a list of available targets. parameters. filter: TargetFilter. Only targets matching filter will be reported. If filter is not specified and target...
Read more >target - Go Packages
Package target provides the Chrome DevTools Protocol commands, types, and events for the Target domain.
Read more >Target.createBrowserContext doesn't have a clean browser state
I believe this only works in headless Chrome. Do you get "Not supported" error in response to createBrowserContext?
Read more >try - Mercurial - Mozilla
executablePath returns executablePath for channel (launcher.spec.ts)": [ + "PASS" + ], "Launcher specs Browser target events should work ...
Read more >third_party/blink/public/devtools_protocol/browser_protocol.pdl
Runs the contrast check for the target page. Found issues are reported. # using Audits.issueAdded event. command checkContrast. parameters.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
And I’m afraid I cannot do anything about it either. Closing this, feel free to add more information if you come up with something.
(Yes the :: was just an error in the message.)
I just tested in linux and it works there. Will try to test on a different windows box and see what happens.