Selenium support for headless |
|||||||||||||
Issue descriptionThis bug tracks the work needed to make it possible to use Headless Chrome as a back-end in Selenium
,
Aug 10 2016
Hi, is there any timeline for selenium support for headless chrome?
,
Aug 10 2016
,
Aug 11 2016
I already use selenium with the headless_shell like this (in Java):
HashMap<String,String> env = new HashMap<>();
env.put("CHROME_DEVEL_SANDBOX", "/home/paulo/headless_chrome/chrome-devel-sandbox");
ChromeDriverService cs = new ChromeDriverService.Builder()
.withEnvironment(env)
.usingDriverExecutable(new File(......))
.build();
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
ChromeOptions options = new ChromeOptions();
options.setBinary("/home/paulo/headless_chrome/headless_shell");
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver driver = new ChromeDriver(cs,capabilities);
,
Aug 19 2016
Does bug 612904 imply that headless_shell is going to disappear and be replaced by chrome called with a headless parameter?
,
Aug 20 2016
No both headless_shell and a --headless for chrome will coexist.
,
Aug 22 2016
I think headless shell will be around for a while longer, but longer term I think we should kill it in favor of everyone using Chrome proper with a --headless flag. The reason is that Chrome 1) auto-updates and 2) runs on more than just Linux.
,
Sep 27 2016
Part of the appeal of using headless_shell is that it's lightweight and has a lot less lib dependencies than Chrome. Using the headless flag with Chrome and killing headless_shell would also kill that advantage if I read this correctly.
,
Sep 28 2016
True, we'll still need 90% of the code in headless shell, so keeping the binary around too is not a huge burden. We'll keep your comments in mind.
,
Dec 5 2016
,
Jan 9 2017
,
Jan 11 2017
Any progress? I run it with
options.addArguments("headless");
options.addArguments("start-maximized");
options.addArguments("disable-gpu");
options.addArguments("no-sandbox");
options.addArguments("disable-popup-blocking");
options.addArguments("v9");
options.addArguments("screenshot");
options.addArguments("always-authorize-plugins");
and got the following errors (hope it will help any others to find this issue) :
There were 2 errors:
org.openqa.selenium.WebDriverException(unknown error: cannot get automation extension
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: content shell=)
(Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 2.6.32-44-pve x86_64) (WARNING: The server did not provide any stacktrace information)
,
Jan 11 2017
There are a few features of webdriver / chromedriver that aren't supported by headless at the moment. Extensions are one of them, and chromedriver uses an extension for some operations, e.g. to set the window size. Until we modify chromedriver/headless to support these operations, you can try to work around the restriction by avoiding these operations. (For window size, there's also a command line flag, e.g. --window-size=800x600, that might work for you instead.)
,
Jan 11 2017
Thanks, it started to work with
capabilities.setCapability("nativeEvents", false);
capabilities.setCapability("takesScreenshot", false);
and removed browser.manage().window().maximize();
, but then failed on sendKeys call. Seems like keys and mouse events is also unsupported. Ok, I agree to wait.
,
Jan 11 2017
To add to #c13, some things will work, some things won't. I've put together a doc listing some of the obvious things that are missing: https://docs.google.com/document/d/17VbJpJ9THEEsmy78Io3hbjHJs5dVy8eQ1kx9BNL6Ydo/edit?usp=sharing
,
Feb 26 2017
Hey #c15 (samu...) Could we add that window popups are not working with the headless_shell as well please? I didn't see that in the document. Not sure if its anything the team plan on addressing soon ? You can verify with the following command; headless_shell --remote-debugging-port=9222 --window-size=1280,1024 http://html.com/javascript/popup-windows/ Open the devtools on in a browser click on the link my popup under the section 'The Basics' - observe no errors/logs from either headless_shell or the devtools console It isn't specific to that web page - but also on our internal app ran by the test suite which uses the pop windows for oauth(2) authorization flow. Driven by selenium webdriver chromedriver. It appears is it able to see the page content - but is unable to interact with the popup window. I can create a bug but felt as you had a document with the things that won't work - that probably would be the place for now ? If not let me know. Also thanks for your work on the headless_shell/chromium
,
Feb 27 2017
,
Feb 27 2017
#16: Sounds like something we should investigate. Filed https://crbug.com/696439 .
,
Feb 28 2017
Handed off to jzfeng@ who's going to start porting some of the features currently implemented by the ChromeDriver extension to DevTools.
,
Mar 14 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c75dbfd25cc376b92a494d340259056a01e1432e commit c75dbfd25cc376b92a494d340259056a01e1432e Author: irisu <irisu@chromium.org> Date: Tue Mar 14 09:34:34 2017 Add headless chrome as an accepted browser string in chromedriver. This is working towards selenium support for headless see https://bugs.chromium.org/p/chromium/issues/detail?id=604324 BUG= 699382 , 604324 Review-Url: https://codereview.chromium.org/2731403008 Cr-Commit-Position: refs/heads/master@{#456660} [modify] https://crrev.com/c75dbfd25cc376b92a494d340259056a01e1432e/chrome/test/chromedriver/chrome/browser_info.cc [modify] https://crrev.com/c75dbfd25cc376b92a494d340259056a01e1432e/chrome/test/chromedriver/chrome/browser_info_unittest.cc
,
Mar 24 2017
,
Mar 31 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d6cc35e9043b01bfffaf3164bee1c5310cdedcf7 commit d6cc35e9043b01bfffaf3164bee1c5310cdedcf7 Author: samuong <samuong@chromium.org> Date: Fri Mar 31 04:37:36 2017 [chromedriver] Introduce chromeOptions.useAutomationExtension. This allows clients to enable or disable the ChromeDriver automation extension. It is currently true by default, but once we introduce DevTools commands to replace the extension, we'll set this to false by default, and later remove it. BUG= 604324 TBR=stgao@chromium.org Review-Url: https://codereview.chromium.org/2785413002 Cr-Commit-Position: refs/heads/master@{#461032} [modify] https://crrev.com/d6cc35e9043b01bfffaf3164bee1c5310cdedcf7/chrome/test/chromedriver/capabilities.cc [modify] https://crrev.com/d6cc35e9043b01bfffaf3164bee1c5310cdedcf7/chrome/test/chromedriver/capabilities.h [modify] https://crrev.com/d6cc35e9043b01bfffaf3164bee1c5310cdedcf7/chrome/test/chromedriver/chrome_launcher.cc [modify] https://crrev.com/d6cc35e9043b01bfffaf3164bee1c5310cdedcf7/chrome/test/chromedriver/test/run_py_tests.py
,
Apr 8 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/24a8ad434aab59c8c8a08ba02d934ca5fdfdc7dd commit 24a8ad434aab59c8c8a08ba02d934ca5fdfdc7dd Author: jzfeng <jzfeng@chromium.org> Date: Sat Apr 08 02:30:10 2017 add a new set of commands to resize and position windows https://docs.google.com/a/google.com/document/d/1iDSRQzYiF6xYKp2PuA8kBmghK7Ar0OZXQZFsaUBNgKw/edit?usp=sharing Devtools side, add a new UI domain and methods: method: getWindowForTarget, param: targetID, return: windowID, bounds. method: setWindowBounds, param: windowID, bounds method: getWindowBounds, param: windowID, return: bounds bounds object: left, top, width, height, window_state (minimized, maximized, fullscreen, normal) BUG= 604324 Review-Url: https://codereview.chromium.org/2734123004 Cr-Commit-Position: refs/heads/master@{#463110} [modify] https://crrev.com/24a8ad434aab59c8c8a08ba02d934ca5fdfdc7dd/chrome/browser/devtools/chrome_devtools_manager_delegate.cc [modify] https://crrev.com/24a8ad434aab59c8c8a08ba02d934ca5fdfdc7dd/chrome/browser/devtools/chrome_devtools_manager_delegate.h [modify] https://crrev.com/24a8ad434aab59c8c8a08ba02d934ca5fdfdc7dd/chrome/browser/devtools/devtools_protocol.cc [modify] https://crrev.com/24a8ad434aab59c8c8a08ba02d934ca5fdfdc7dd/chrome/browser/devtools/devtools_protocol.h [modify] https://crrev.com/24a8ad434aab59c8c8a08ba02d934ca5fdfdc7dd/chrome/browser/devtools/devtools_sanity_browsertest.cc [modify] https://crrev.com/24a8ad434aab59c8c8a08ba02d934ca5fdfdc7dd/third_party/WebKit/LayoutTests/inspector/schema-get-domains-matches-agents-expected.txt [modify] https://crrev.com/24a8ad434aab59c8c8a08ba02d934ca5fdfdc7dd/third_party/WebKit/Source/core/inspector/browser_protocol.json
,
Apr 10 2017
Make a copy of the doc: Migrate chromedriver extension to devtool commands https://docs.google.com/document/d/1Q0kuHgU1d-sj8gePjEU9nHtlQzz5rNvvGH8fCJ3iBq4/edit?usp=sharing. This version is shared to public.
,
Apr 10 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6de4c9216f701b9e0e075bff999350853a9c5a74 commit 6de4c9216f701b9e0e075bff999350853a9c5a74 Author: irisu <irisu@chromium.org> Date: Mon Apr 10 11:28:44 2017 Add user-agent flag to headless BUG= 604324 Review-Url: https://codereview.chromium.org/2805793003 Cr-Commit-Position: refs/heads/master@{#463221} [modify] https://crrev.com/6de4c9216f701b9e0e075bff999350853a9c5a74/headless/BUILD.gn [modify] https://crrev.com/6de4c9216f701b9e0e075bff999350853a9c5a74/headless/app/headless_shell.cc [modify] https://crrev.com/6de4c9216f701b9e0e075bff999350853a9c5a74/headless/app/headless_shell_switches.cc [modify] https://crrev.com/6de4c9216f701b9e0e075bff999350853a9c5a74/headless/app/headless_shell_switches.h [modify] https://crrev.com/6de4c9216f701b9e0e075bff999350853a9c5a74/headless/lib/browser/headless_browser_impl.cc [modify] https://crrev.com/6de4c9216f701b9e0e075bff999350853a9c5a74/headless/lib/browser/headless_content_browser_client.cc
,
Apr 10 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/da1d85c561f4c7b666dfc1ae5acb3310d9b78a20 commit da1d85c561f4c7b666dfc1ae5acb3310d9b78a20 Author: jzfeng <jzfeng@chromium.org> Date: Mon Apr 10 20:54:36 2017 Revert of add a new set of commands to resize and position windows (patchset #35 id:680001 of https://codereview.chromium.org/2734123004/ ) Reason for revert: It cause flaky browser tests on mac10.10 https://uberchromegw.corp.google.com/i/chromium.mac/builders/Mac10.10%20Tests?numbuilds=100 Original issue's description: > add a new set of commands to resize and position windows > > https://docs.google.com/document/d/1Q0kuHgU1d-sj8gePjEU9nHtlQzz5rNvvGH8fCJ3iBq4/edit?usp=sharing > > Devtools side, add a new UI domain and methods: > method: getWindowForTarget, param: targetID, return: windowID, bounds. > method: setWindowBounds, param: windowID, bounds > method: getWindowBounds, param: windowID, return: bounds > > bounds object: left, top, width, height, window_state (minimized, maximized, fullscreen, normal) > > BUG= 604324 > > Review-Url: https://codereview.chromium.org/2734123004 > Cr-Commit-Position: refs/heads/master@{#463110} > Committed: https://chromium.googlesource.com/chromium/src/+/24a8ad434aab59c8c8a08ba02d934ca5fdfdc7dd TBR=dgozman@chromium.org,pfeldman@chromium.org,samuong@chromium.org Review-Url: https://codereview.chromium.org/2808923002 Cr-Commit-Position: refs/heads/master@{#463388} [modify] https://crrev.com/da1d85c561f4c7b666dfc1ae5acb3310d9b78a20/chrome/browser/devtools/chrome_devtools_manager_delegate.cc [modify] https://crrev.com/da1d85c561f4c7b666dfc1ae5acb3310d9b78a20/chrome/browser/devtools/chrome_devtools_manager_delegate.h [modify] https://crrev.com/da1d85c561f4c7b666dfc1ae5acb3310d9b78a20/chrome/browser/devtools/devtools_protocol.cc [modify] https://crrev.com/da1d85c561f4c7b666dfc1ae5acb3310d9b78a20/chrome/browser/devtools/devtools_protocol.h [modify] https://crrev.com/da1d85c561f4c7b666dfc1ae5acb3310d9b78a20/chrome/browser/devtools/devtools_sanity_browsertest.cc [modify] https://crrev.com/da1d85c561f4c7b666dfc1ae5acb3310d9b78a20/third_party/WebKit/LayoutTests/inspector/schema-get-domains-matches-agents-expected.txt [modify] https://crrev.com/da1d85c561f4c7b666dfc1ae5acb3310d9b78a20/third_party/WebKit/Source/core/inspector/browser_protocol.json
,
Apr 13 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/dd0fef609820bee5b4e9b6aa46dd4ee3dd53f81f commit dd0fef609820bee5b4e9b6aa46dd4ee3dd53f81f Author: jzfeng <jzfeng@chromium.org> Date: Thu Apr 13 02:59:17 2017 Add a new set of commands to resize and position windows https://docs.google.com/document/d/1Q0kuHgU1d-sj8gePjEU9nHtlQzz5rNvvGH8fCJ3iBq4/edit?usp=sharing Devtools side, add a new UI domain and methods: method: getWindowForTarget, param: targetID, return: windowID, bounds. method: setWindowBounds, param: windowID, bounds method: getWindowBounds, param: windowID, return: bounds bounds object: left, top, width, height, window_state (minimized, maximized, fullscreen, normal) BUG= 604324 Review-Url: https://codereview.chromium.org/2813553005 Cr-Commit-Position: refs/heads/master@{#464265} [modify] https://crrev.com/dd0fef609820bee5b4e9b6aa46dd4ee3dd53f81f/chrome/browser/devtools/chrome_devtools_manager_delegate.cc [modify] https://crrev.com/dd0fef609820bee5b4e9b6aa46dd4ee3dd53f81f/chrome/browser/devtools/chrome_devtools_manager_delegate.h [modify] https://crrev.com/dd0fef609820bee5b4e9b6aa46dd4ee3dd53f81f/chrome/browser/devtools/devtools_protocol.cc [modify] https://crrev.com/dd0fef609820bee5b4e9b6aa46dd4ee3dd53f81f/chrome/browser/devtools/devtools_protocol.h [add] https://crrev.com/dd0fef609820bee5b4e9b6aa46dd4ee3dd53f81f/chrome/browser/devtools/devtools_sanity_interactive_browsertest.cc [modify] https://crrev.com/dd0fef609820bee5b4e9b6aa46dd4ee3dd53f81f/chrome/test/BUILD.gn [modify] https://crrev.com/dd0fef609820bee5b4e9b6aa46dd4ee3dd53f81f/third_party/WebKit/LayoutTests/inspector/schema-get-domains-matches-agents-expected.txt [modify] https://crrev.com/dd0fef609820bee5b4e9b6aa46dd4ee3dd53f81f/third_party/WebKit/Source/core/inspector/browser_protocol.json
,
Apr 20 2017
,
Apr 21 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/74934b2b5f8665e2d2f5eb77b5494ff06d9df114 commit 74934b2b5f8665e2d2f5eb77b5494ff06d9df114 Author: jzfeng <jzfeng@chromium.org> Date: Fri Apr 21 07:36:33 2017 use devtools command to do window management BUG= 604324 Review-Url: https://codereview.chromium.org/2826393002 Cr-Commit-Position: refs/heads/master@{#466284} [modify] https://crrev.com/74934b2b5f8665e2d2f5eb77b5494ff06d9df114/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc [modify] https://crrev.com/74934b2b5f8665e2d2f5eb77b5494ff06d9df114/chrome/test/chromedriver/chrome/chrome_desktop_impl.h [modify] https://crrev.com/74934b2b5f8665e2d2f5eb77b5494ff06d9df114/chrome/test/chromedriver/session_commands.cc
,
Apr 28 2017
I think it would be best to allow configuration of security settings (preferably via CLI arguments) when running in headless mode, just like when in normal mode. For example, --allow-running-insecure-content and --ignore-certificate-errors work in normal mode but seem to be quietly ignored when running headless. My use case consists of controlling Chromium via Selenium for the purpose of performing security tests against web applications[1] and now that PhantomJS is going and Chromium got a headless mode, Chromium is the best migration choice. However, such a system needs to be resilient and forgiving, like most browsers, and support a wide range of web applications, but the fact that headless is currently imposing unconfigurable restrictions that prevent pages from even loading is making the situation unworkable. Also, it would be a good idea to exit with a message when a given option is not supported in headless mode to avoid confusion. [1] http://www.arachni-scanner.com/
,
May 2 2017
#30: We've added new commands for overriding certificate handling -- see https://chromedevtools.github.io/debugger-protocol-viewer/tot/Security/#method-handleCertificateError In general I think new DevTools commands are preferable over command line flags because they offer the most flexibility.
,
May 5 2017
#31: If I can make that work from a Selenium/Chromedriver perspective then I'm a happy camper, although I don't see how yet. Also, is there any chance that more security related options can be added to the API to enable loading insecure content, disable XSS protection and the rest?
,
May 5 2017
#32: Definitely, if you feel like something is missing please file bugs with descriptions of your use case.
,
May 15 2017
,
May 25 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cbecd589a9ca1e66959de5bc3b6016ff1adb5d21 commit cbecd589a9ca1e66959de5bc3b6016ff1adb5d21 Author: jzfeng <jzfeng@chromium.org> Date: Thu May 25 07:40:34 2017 Implement window management devtools commands for headless. These commands are used by chromedriver to change window bounds (size, position) and state (normal, minimized, maximized, fullscreen). 1. add window state to HeadlessWebContentsImpl to track window states change. 2. add window id to HeadlessWebContentsImpl as an unique id used by the commands. 3. window size doesn't change when its state changes. BUG= 604324 Review-Url: https://codereview.chromium.org/2896763002 Cr-Commit-Position: refs/heads/master@{#474601} [modify] https://crrev.com/cbecd589a9ca1e66959de5bc3b6016ff1adb5d21/headless/BUILD.gn [modify] https://crrev.com/cbecd589a9ca1e66959de5bc3b6016ff1adb5d21/headless/lib/browser/headless_browser_impl.cc [modify] https://crrev.com/cbecd589a9ca1e66959de5bc3b6016ff1adb5d21/headless/lib/browser/headless_browser_impl.h [modify] https://crrev.com/cbecd589a9ca1e66959de5bc3b6016ff1adb5d21/headless/lib/browser/headless_devtools_client_impl.cc [modify] https://crrev.com/cbecd589a9ca1e66959de5bc3b6016ff1adb5d21/headless/lib/browser/headless_devtools_client_impl.h [modify] https://crrev.com/cbecd589a9ca1e66959de5bc3b6016ff1adb5d21/headless/lib/browser/headless_devtools_manager_delegate.cc [modify] https://crrev.com/cbecd589a9ca1e66959de5bc3b6016ff1adb5d21/headless/lib/browser/headless_devtools_manager_delegate.h [modify] https://crrev.com/cbecd589a9ca1e66959de5bc3b6016ff1adb5d21/headless/lib/browser/headless_web_contents_impl.cc [modify] https://crrev.com/cbecd589a9ca1e66959de5bc3b6016ff1adb5d21/headless/lib/browser/headless_web_contents_impl.h [modify] https://crrev.com/cbecd589a9ca1e66959de5bc3b6016ff1adb5d21/headless/lib/headless_devtools_client_browsertest.cc [modify] https://crrev.com/cbecd589a9ca1e66959de5bc3b6016ff1adb5d21/headless/public/headless_devtools_client.h [modify] https://crrev.com/cbecd589a9ca1e66959de5bc3b6016ff1adb5d21/headless/test/headless_browser_test.cc [modify] https://crrev.com/cbecd589a9ca1e66959de5bc3b6016ff1adb5d21/headless/test/headless_browser_test.h
,
May 26 2017
Updated status of selenium support: https://docs.google.com/document/d/1JxDq66swpOk3UMv96MuUJOAK2eOYp28SbZI76dH_MpE/edit?usp=sharing
,
Jun 22 2017
,
Jun 22 2017
It looks like screenshots also do not work. This returns 1x1px screenshot (chromedriver 2.30.1, on Mac):
const fs = require('fs');
const webdriver = require('selenium-webdriver');
const chromedriver = require('chromedriver');
const chromeCapabilities = webdriver.Capabilities.chrome();
chromeCapabilities.set('chromeOptions', {
'args': [
'--headless',
'--disable-gpu',
// '--window-size=412,732'
]
});
const driver = new webdriver.Builder()
.forBrowser('chrome')
.withCapabilities(chromeCapabilities)
.build();
// driver.manage().window().setSize(412, 732);
driver.get('https://www.google.com/');
driver.takeScreenshot().then(base64png => {
const buffer = new Buffer(base64png, 'base64');
fs.writeFileSync('screenshot.png', buffer);
});
driver.quit();
,
Jun 28 2017
This could be Mac specific, we'll investigate. Any reason why --window-size is commented?
,
Jun 28 2017
No reason :) Was just playing with changing the window size to see if that affected screenshots
,
Jul 5 2017
@ericbidelman: Your problem is related to this bug: https://bugs.chromium.org/p/chromium/issues/detail?id=714058 Which should be included in build 60 If you test it with chrome beta/canary it should work
,
Jul 5 2017
Thanks dvallet. Confirmed 60 works.
,
Jul 13 2017
In chrome 61(canary) headless mode, captureScreen() is hanged. Without headless or device emulation it works correctly. My environemt: Chrome (canary) 61.0.3155.0 MacOS 64bit
,
Jul 13 2017
It may be a bug, would you mind creating a new bug to track with steps to reproduce?
,
Jul 13 2017
Ok. I opened new issue. https://bugs.chromium.org/p/chromium/issues/detail?id=741969
,
Aug 1 2017
Hi guys, since I've update from Chrome 58 to Chrome Version 60 the window resize feature doesn't work anymore. I can not use --window-size parameter because I need to open many different web pages and take screenshots. Web page size can be anything from 100x100 to 10000x10000 pixels. If I'll start new instance of Chrome for every screenshot then it will be too slow. If I just set --window-size=10000x10000 then every screenshot will be very big and require a lot of resources, so it will be to slow for me. Do you have any plans to implement window.setSize() feature for Headless Chrome+Selenium? I am using: Chrome 60.0.3112.78 (Official Build) (64-bit) Selenium ChromeDriver 2.31.0 OS Windows 10, Windows Server 2016
,
Aug 16 2017
Hi guys, I am using following versions to run selenium test cases in ubuntu chrome -60.0.3112.90 chromdriver version 2.31 - with headless mode selenium 3.4.3 - I'm facing the issue with the Chrome driver on Ubunto 16.04. It just hangs when I call save_screenshot(). - can you please help me why it's happening.
,
Aug 16 2017
This is fixed in chrome 61. Get chrome beta
,
Oct 17 2017
This post https://bugs.chromium.org/p/chromedriver/issues/detail?id=639 refers me here for a fix and comment 48 states this is fixed but I am still getting this popup. Can't see where we are going wrong. We are on 2015 enterprise VS and have used the whitelist (as our company blocking this is actually on board to get this resolved), the "useAutomationExtension" fixes don't seem to work, chrome 61 and latest chromedriver etc etc. Any help is greatly appreciated! :) Dan
,
Nov 20 2017
#30: We've added new commands for overriding certificate handling -- see https://chromedevtools.github.io/debugger-protocol-viewer/tot/Security/#method-handleCertificateError How to use this commands in selenium script??
,
Nov 22 2017
,
Nov 28 2017
Hi, what I want to achieve is: Run chromedriver on both win and linux machines with headless mode, using proxies with authentication. I have to run about 200 threads with different proxies. I'm using chromedriver version - 2.33.506092 For setting up authentication I've tried using ProxyAutoAuth_2_0.crx extension, this works as a charm without 'headless' option. In headless mode I'm getting exeption: WebDriverException: Message: unknown error: failed to wait for extension background page to load:... So, aren't extensions supported still? If you could suggest any workaround for my, that would be amazing. Thank in advanced!!!
,
Nov 28 2017
Probably wont help if you're using selenium but via DevTools you can build a proxy. https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setRequestInterception It would be interesting to see if we could bring this to chrome driver somehow. Anyway I'm sorry but there are no plans to support extensions. That would be a huge undertaking.
,
Nov 28 2017
Thank you very much for the instant reply.
,
Dec 26 2017
Hi, I'm working with Selenium grid and chrome driver (latest versions). I'm using my own extension for adding headers to requests and to filter URL's (css and stuff). Is there any workaround for starting headless chrome (to reduce resource consumption) with extensions? Do you have a plan for release in the near future? Thanks in advance
,
Dec 26 2017
I realize a lot of folks would like to use extensions with headless but unfortunately that's a large project which we have /no plans to do/. The problem is Headless Chromium is a content embedder which means it doesn't have access to anything from other content embedders such as chrome and unfortunately extensions are a chrome feature. However if you're able to use DevTools all is not lost, because you can filter URLs and modify headers via Network.setRequestInterception (1) and Network.continueInterceptedRequest (2). 1) https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setRequestInterception 2) https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-continueInterceptedRequest
,
Dec 27 2017
Thanks for the quick response. Is there a way to use DevTools API with selenium grid and selenium remote driver? I tried that and unfortunately seems that I can't use both DevTools and selenium web driver to initiate a Chrome browser since they both connect to it via remote debugger. I used cdp4j as my Java library.
,
Jan 3 2018
Yeah, ChromeDriver maintains a DevTools connection to the target browser. Multi-client support for DevTools might help here - I believe that's shipping in M63: https://developers.google.com/web/updates/2017/10/devtools-release-notes#multi-client With that, you might be able to connect to the same target from your selenium code somehow? I believe we also considered exposing further DevTools/headless features through ChromeDriver at some point, such as network request interception. I don't think we have capacity to do this right now, but maybe in the future.
,
Jan 8 2018
Is there more work needed here or are we done with Selenium support for now?
,
Jan 8 2018
I think we are done. New bugs can be created when there are further requests.
,
Jan 9 2018
|
|||||||||||||
►
Sign in to add a comment |
|||||||||||||
Comment 1 by skyos...@chromium.org
, May 4 2016