Is your feature request related to a problem? Please describe.
I would like to use a remote chrome browser. My endpoint exposes the devtools via websocket, as standard practice for headless chrome. This makes it possible to use many 3rd party tools such as browserless.io.
Describe the solution you'd like
Via environment variable and CLI flag, you should be able to specify the websocket URL.
I think something like this could work in chrome/chrome.go, but i'm not entirely familiar with the codebase. Can you doublecheck?
var actx chromedp.Context
var acancel context.CancelFunc
var devtoolsWsURL *string
// Check if REMOTE_DEVTOOLS_WS_URL environment variable is set
if wsURL := os.Getenv("REMOTE_DEVTOOLS_WS_URL"); wsURL != "" {
devtoolsWsURL = &wsURL
actx, acancel = chromedp.NewRemoteAllocator(context.Background(), *devtoolsWsURL)
} else {
actx, acancel = chromedp.NewExecAllocator(context.Background(), chromedp.DefaultExecAllocatorOptions...)
}
// Use actx and acancel here
defer acancel()
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
I think something like this could work in chrome/chrome.go, but i'm not entirely familiar with the codebase. Can you doublecheck?