We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
github.com/chromedp/chromedp v0.9.5 google-chrome 123.0.6312.58 go 1.21.3
package main import ( "context" "github.com/chromedp/cdproto/cdp" "github.com/chromedp/cdproto/target" "github.com/chromedp/chromedp" ) func main() { browserCtx, cancel := chromedp.NewContext(context.Background()) defer cancel() if err := chromedp.Run(browserCtx); err != nil { panic(err) } // Create BrowserContext with different proxies. var proxy1, proxy2 cdp.BrowserContextID if err := chromedp.Run(browserCtx, chromedp.ActionFunc(func(ctx context.Context) error { c := chromedp.FromContext(ctx) var err error proxy1, err = target.CreateBrowserContext(). WithDisposeOnDetach(true). WithProxyServer("127.0.0.1:12999"). Do(cdp.WithExecutor(ctx, c.Browser)) if err != nil { return err } proxy2, err = target.CreateBrowserContext(). WithDisposeOnDetach(true). WithProxyServer("127.0.0.1:13000"). Do(cdp.WithExecutor(ctx, c.Browser)) return err }), ); err != nil { panic(err) } // Use proxy1: ctx1, cancel := chromedp.NewContext(browserCtx, chromedp.WithExistingBrowserContext(proxy1)) defer cancel() if err := chromedp.Run(ctx1, chromedp.Navigate("http://ipinfo.io"), ); err != nil { panic(err) } // Use proxy2: ctx2, cancel := chromedp.NewContext(browserCtx, chromedp.WithExistingBrowserContext(proxy2)) defer cancel() if err := chromedp.Run(ctx2, chromedp.Navigate("http://google.com"), ); err != nil { panic(err) } }
With PR #1237
1 browser with multiple tabs.
multiple browsers with 1 tab each.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What versions are you running?
What did you do? Include clear steps.
With PR #1237
What did you expect to see?
1 browser with multiple tabs.
What did you see instead?
multiple browsers with 1 tab each.
The text was updated successfully, but these errors were encountered: