Error Loading Extension Could Not Load Extension from 'C:\..\Local\Temp\Scoped_Dir6312_32763\Internal'. Loading of Unpacked Extensions Is Disabled

Could not load extension from scoped_dir6312_32763/internal.Loading of unpacked extensions is disabled by the administrator with ChromeDriver Selenium

This popup:

extension_error

with the error message as...

Error Loading Extension
Failed to load extension from: 'C:\Users\user_name\AppData\Local\Temp\scoped_dir6312_32763\internal'. Loading of unpacked extensions is disabled by the administrator.
OK

...implies that an extension has not been loaded as it is disabled by the administrator.


As per the discussion Failed to load extention from: ... Loading of unpacked extensions is disabled by the administrator ChromeDriver uses Chrome automation extension for automating various functions like window sizing, window positioning, etc.

The Failed to load extension.. popup means that this extension has not been loaded. If you manually close the popup, browser will act normally and ChromeDriver commands will continue to work as expected. But in this case if you try executing window resizing or window re-positioning commands, it will throw an error as unknown error: cannot get automation extension.


Background

Till ChromeDriver v2.28 whenever an organizations admin policy forbidden extensions, to bypass the restriction users have used the argument disable-extensions as follows:

ChromeOptions options = new ChromeOptions();
options.addArguments("--disable-extensions");
WebDriver driver = new ChromeDriver(options);

and it worked perfecto.

ChromeDriver v2.28 onwards, whenever disable-extensions flag is passed by test, ChromeDriver implicitly passes disable-extensions-except flag which in turn loads Chrome automation extension. This extension helps Chromedriver to perform window sizing and window re-positioning operations.

So, if your organizational admin policy blocks extensions, display of popup Failed to load extension from: ... Loading of unpacked extensions is an expected behavior.

This issue had a dependency on Selenium support for headless.


Work around

As an alternative, you can set the useAutomationExtension capability to false as follows:

ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("useAutomationExtension", false);
WebDriver driver = new ChromeDriver(options);

This capability inturn will help to not load Chrome Automation extension and Failed to load extension popup would not appear. But you will not be able to perform any window resizing/positioning operations without the Chrome automation extension.

Now, Selenium support for headless being resolved ChromeDriver will no longer require this extension and you shouldn't have seen this error/popup.

Solution

The simplest solution would be to use the latest version of ChromeDriver and Chrome combination among either of the following:

  • If you are using Chrome version 73, please download ChromeDriver 73.0.3683.20
  • If you are using Chrome version 72, please download ChromeDriver 2.46 or ChromeDriver 72.0.3626.69
  • If you are using Chrome version 71, please download ChromeDriver 2.46 or ChromeDriver 71.0.3578.137
  • For older version of Chrome, please see this discussion.

Alternative

Some other alternatives are:

  • Add the Registry Key ExtensionInstallWhitelist to whitelist
  • Remove the Registry Key ExtensionInstallBlacklist containing a string key 1 with value *

Loading of unpacked extensions is disabled by administrator

After a lot of work on this issue I finally came up with a solution. By looking at the responses on C# and Java I managed to apply same procedure to Selenium in python.

As described in this thread you need to somehow set the attribute of useAutomationExtension to False.

Here is what I did:

from selenium import webdriver

chromeOptions = webdriver.ChromeOptions()
chromeOptions.add_experimental_option('useAutomationExtension', False)

driver = webdriver.Chrome(chrome_options=chromeOptions, desired_capabilities=chromeOptions.to_capabilities())
driver.get("http://www.python.org")

The code above simply creates ChromeOptions class and sets the attribute to false. The you run chrome driver with those options.

This solved my case. I hope it helps.

Failed to load extension from popup box while running selenium test cases in Chrome

I think you need to set all your chrome options before creating the ChromeDriver instance.

System.setProperty("webdriver.chrome.driver", ".\\Drivers\\chromedriver.exe");

ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized");
options.setExperimentalOption("useAutomationExtension", false);
options.addArguments("disable-extensions");

WebDriver driver = new ChromeDriver(options);

BTW: I would recommend to use the WebDriverManager for handling the correct driver version.

Loading of unpacked extensions is disabled by the administrator for EasyRepro

I fixed the error message by adding this line of code inside BroswerOptions.cs

        var options = new ChromeOptions();
options.AddAdditionalCapability("useAutomationExtension", false);
ChromeDriver driver = new ChromeDriver(options);


Related Topics



Leave a reply



Submit