Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Blank chrome://version when running with --headless #10

Open
andymurd opened this issue May 25, 2018 · 1 comment
Open

Blank chrome://version when running with --headless #10

andymurd opened this issue May 25, 2018 · 1 comment

Comments

@andymurd
Copy link

I want to use the Page.printToPDF method to dump my web pages for emailing/printing. This functionality is only available when running Chrome with the --headless flag.

However, when I add that flag to my chromeOptions.args, the devtools service cannot find the remote-debugging-port from chrome://version. I've hacked the _findChromePort() method to dump a screenshot, and found that it's just a blank white page.

If I remove the --headless flag from my options, I can see that the page loads correctly, the screenshot has the expected data and the port is found. Everything starts up OK and browser.cdp is injected. The process fails when trying to call Page.printToPDF (as expected).

I guess that loading chrome://version is not supported in headless mode, though I can't find any documentation to support that. It's not an easy phrase to google :)

Is there any other means of finding the debugging port? I'm running chrome using wdio-selenium-standalone so the port is changed often. All help is much appreciated.

@christian-bromann
Copy link
Contributor

See https://github.com/webdriverio/wdio-devtools-service/pull/5/files .. we used to get the port this way. Maybe you can try implement this and propose a PR with a fallback to this approach

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants