How can I launch Chrome with an unpacked extension?
The unpacked extension error popped up for me and I requested for removing the restrictions in chrome which was enforced as organizational policy. Once the restrictions were removed, I am able to run the program with out any errors. ChromeBrowser-GPO-Deny - this was the one which was removed. You can check in Settings - Extensions - Check on Developer mode and see if the load unpacked extensions is checked once the restrictions are removed. You should be good then. All the above will work only when the chrome is not restricted.
For packed extensions (a .crx file)
ChromeOptions options = new ChromeOptions();
options.addExtensions(new File("/path/to/extension.crx"));
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
ChromeDriver driver = new ChromeDriver(capabilities);
For unpacked extensions (a local folder)
ChromeOptions options = new ChromeOptions();
options.addArguments("load-extension=/path/to/extension");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
ChromeDriver driver = new ChromeDriver(capabilities);
source
It may be late but for future users:
https://sites.google.com/a/chromium.org/chromedriver/extensions
I was able to achieve this by using the AddArgument
method to directly pass the information to Chrome. Here's what it looks like in C#:
options = new ChromeOptions();
options.AddArgument("--load-extension=" + unpackedExtensionPath);