selenium: [đ Bug]: Chrome team removes `--load-extension` switch on Chrome builds
Description
They remove --load-extension that cause .AddExtensions() and other similar method broken
Version affected: Chrome 137
Reproducible Code
var options = new ChromeOptions();
options.AddExtensions(_extensionsPath);
var driver = new ChromeDriver(options);
Debugging Logs
[13564:10684:0524/222309.634:WARNING:chrome\browser\extensions\extension_service.cc:359] --load-extension is not allowed in Google Chrome, ignoring.
âšď¸ Last known working version: it broke on Chrome 137, worked on 136 and below
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 49 (23 by maintainers)
If you are using JavaScript try this
// Load chrome options let options = new chrome.Options(); options.addExtensions(extensionPath); options.addArguments(ââdisable-features=DisableLoadExtensionCommandLineSwitchâ);
hah⌠someone just reported that this can be undone with this flag:
I just verified you can still use the old way of loading extensions if you start Chrome using this flag.
Should we add this by default to our Chrome Options? or just update the documentation that this is a workaround?
@oliverdunk is this going to remain working like this?
You will need to use BiDiâ to add extensions. Support for that will land in the next releases.
I have confirmed that the following code works to load an unpacked Chrome extension:
var options = new ChromeOptions(); options.AddArgument(ââload-extension=â + extensionPath);//Load unpacked extension options.AddArgument(ââdisable-features=DisableLoadExtensionCommandLineSwitchâ); var driver = new ChromeDriver(options);
Will this continue to work in the future, or is it just a temporary workaround?
I confirm that it works
c# example
This is part of the feature flag system we use to launch features. Unfortunately, that means it will go away once we are confident we no longer need a killswitch (usually they are around for no more than a few Chrome milestones).
Given that, I donât think this would be a good thing to document. It is only a temporary workaround and it is expected to break in the future at which point there would be the same issue.
@nithikalisamy Here is a sample python script:
Do note that adding the
--remote-debugging-pipeflag will disable CDP functionalities (restriction from chrome).@Methuselah96
https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/
Note that if Chrome is installed and found on your PATH, it will pick that up first. You can override that with the environment variable
SE_FORCE_BROWSER_DOWNLOAD=true.@caeduardo99 The workaround for disabling the flag removal is available now. Itâs not a fix or change in Selenium.
@seleniumghost if you have complaints about the chrome/chromedriver development or release process, raise them with Google or the Chromium project⌠they donât belong here.
Thank you for all this information.
(This is the 2nd time now within some weeks where a change in productional Chrome/chromedriver stops us from updating it in automated testing environments. First was #396611138 (Chromedriver 133 creates an extra window handle when opening a pdf in a new tab) which took at first time to find it and then months (from 21.02.25 - 05.05.25) to get into the stable version of 136. Now the next version, 137, got the next big issue. I hope it wonât take months again.
Itâs also sad that the reason mentioned in RFC survey for not using Chrome-for-Testing âThe reason is that we want to be as certain as possible that weâre getting the same results as customers would getâ did not get more attention and that the flag was thrown away without any prior deprecation notice or error/warning message. What a luck that we tested it before the productional update and found it by chance.)
@hadastoroP neither of those currently work. You will have to stay on Chrome 136 or else switch to Chromium or Chrome-for-Testing.
I took a quick look at how this works in Selenium. If Iâm understanding correctly, Selenium was passing
--load-extensionwith the path to a CRX. That was actually just extracting the CRX file (CRX is a ZIP file with additional header data) and then loading the extracted folder as an unpacked extension.@vinaghost you can still use
--load-extensionon non-Chrome branded builds like Chromium and Chrome for Testing. Thread - https://groups.google.com/a/chromium.org/g/chromium-extensions/c/aEHdhDZ-V0E/m/UWP4-k32AgAJ