Selenium: Unable to load Chrome extension (crx file) using Chrome Options on Chrome 78

Created on 12 Nov 2019  路  2Comments  路  Source: SeleniumHQ/selenium

馃悰 Bug Report

Unable to load extension(crx file) using chrome options in selenium

To Reproduce

Gist- https://gist.github.com/RohanImmanuel/460110f0a49b50b9a466bc379b0772e9

Expected behavior

Extension should load in the browser. Driver quits after a 10-second delay

Test script or set of commands reproducing this issue

Gist- https://gist.github.com/RohanImmanuel/460110f0a49b50b9a466bc379b0772e9

Environment

Google Chrome- 78.0.3904.97 (Official Build) (64-bit)
Revision- 021b9028c246d820be17a10e5b393ee90f41375e-refs/branch-heads/3904@{#859}
OS- macOS Version 10.14.6 (Build 18G95)
JavaScript- V8 7.8.279.23
ChromeDriver- ChromeDriver 78.0.3904.11 (eaaae9de6b8999773fa33f92ce1e1bbe294437cf-refs/branch-heads/3904@{#86})
Java Selenium Client bindings- 3.9.1

Error Stacktrace:

Driver info: driver.version: ChromeDriver
remote stacktrace: 0   chromedriver78                      0x0000000101041309 chromedriver78 + 3748617
1   chromedriver78                      0x0000000100fd5943 chromedriver78 + 3307843
2   chromedriver78                      0x0000000100d6544f chromedriver78 + 750671
3   chromedriver78                      0x0000000100cc4243 chromedriver78 + 90691
4   chromedriver78                      0x0000000100cc50ad chromedriver78 + 94381
5   chromedriver78                      0x0000000100cc25ba chromedriver78 + 83386
6   chromedriver78                      0x0000000100cf1217 chromedriver78 + 274967
7   chromedriver78                      0x0000000100cee3e3 chromedriver78 + 263139
8   chromedriver78                      0x0000000100cc8d8d chromedriver78 + 109965
9   chromedriver78                      0x0000000100cc9d25 chromedriver78 + 113957
10  chromedriver78                      0x00000001010043ef chromedriver78 + 3498991
11  chromedriver78                      0x0000000101010fed chromedriver78 + 3551213
12  chromedriver78                      0x0000000101010d78 chromedriver78 + 3550584
13  chromedriver78                      0x0000000100fe3499 chromedriver78 + 3363993
14  chromedriver78                      0x0000000101011848 chromedriver78 + 3553352
15  chromedriver78                      0x0000000100ff7ea7 chromedriver78 + 3448487
16  chromedriver78                      0x0000000101027404 chromedriver78 + 3642372
17  chromedriver78                      0x00000001010470f7 chromedriver78 + 3772663
18  libsystem_pthread.dylib             0x00007fff7b7872eb _pthread_body + 126
19  libsystem_pthread.dylib             0x00007fff7b78a249 _pthread_start + 66
20  libsystem_pthread.dylib             0x00007fff7b78640d thread_start + 13

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new$0(W3CHandshakeResponse.java:57)
    at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction$2(W3CHandshakeResponse.java:104)
    at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
    at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:499)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:486)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
    at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:138)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:168)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:157)
    at com.noserver.ChromeExtensionTest.main(ChromeExtensionTest.java:25)

Most helpful comment

Google seems to have restricted sideloading of third-party .crx extensions that are not signed in the Chrome web store.

I was able to bypass this problem by extracting the content of the .crx file using 7-zip and then repack it into a .zip file. The ChromeDriver is then able to install the extension using the .zip file extension instead of .crx.

All 2 comments

Google seems to have restricted sideloading of third-party .crx extensions that are not signed in the Chrome web store.

I was able to bypass this problem by extracting the content of the .crx file using 7-zip and then repack it into a .zip file. The ChromeDriver is then able to install the extension using the .zip file extension instead of .crx.

Closing as a way to overcome this has been provided by the community.

Was this page helpful?
0 / 5 - 0 ratings