Disable developer mode extensions pop up in Chrome

2019-01-03 21:53发布

Since the latest release of chrome (34.0.1847.116) last week, I have been receiving the “Disable developer mode extensions" when running automated tests using watir-webdriver.

This seems to be the offensive extension but it doesn't make sense to me that this is a potentially hazardous extension given its used by the chromedriver.

Anyone that has found a fix for this, as i am unable to roll back to the previous version or find an installer for an older version to roll back to and this is playing havoc with my tests.

enter image description here

enter image description here

14条回答
戒情不戒烟
2楼-- · 2019-01-03 22:30

(In reply to Antony Hatchkins)

This is the current, literally official way to set Chrome policies: https://support.google.com/chrome/a/answer/187202?hl=en

The Windows and Linux templates, as well as common policy documentation for all operating systems, can be found here: https://dl.google.com/dl/edgedl/chrome/policy/policy_templates.zip (Zip file of Google Chrome templates and documentation)

Instructions for Windows (with my additions):

Open the ADM or ADMX template you downloaded:

  • Extract "chrome.adm" in the language of your choice from the "policy_templates.zip" downloaded earlier (e.g. "policy_templates.zip\windows\adm\en-US\chrome.adm").
  • Navigate to Start > Run: gpedit.msc.
  • Navigate to Local Computer Policy > Computer / User Configuration > Administrative Templates.
  • Right-click Administrative Templates, and select Add/Remove Templates.
  • Add the "chrome.adm" template via the dialog.
  • Once complete, Classic Administrative Templates (ADM) / Google / Google Chrome folder will appear under Administrative Templates.
  • No matter whether you add the template under Computer Configuration or User Configuration, the settings will appear in both places, so you can configure Chrome at a machine or a user level.

Once you're done with this, continue from step 5 of Antony Hatchkins' answer. After you have added the extension ID(s), you can check that the policy is working in Chrome by opening chrome://policy (search for ExtensionInstallWhitelist).

查看更多
做个烂人
3楼-- · 2019-01-03 22:32

While creating chrome driver, use option to disable it. Its working without any extensions.

Use following code snippet

ChromeOptions options = new ChromeOptions();
options.addArguments("chrome.switches","--disable-extensions");
System.setProperty("webdriver.chrome.driver",(System.getProperty("user.dir") + "//src//test//resources//chromedriver_new.exe"));
driver = new ChromeDriver(options);
查看更多
爷的心禁止访问
4楼-- · 2019-01-03 22:33

I'm not sure if this is still a problem for people or not. However, I read through this post and several others and finally played around with this and was able to make it work in C# using this code. I derived it all from this post and possible some posts linked to this post.

I hope this helps, it certainly solved my problems in C# console application.

Using version 52.0.2743.116 m of Chrome Selenium 2.9 Server Driver

        var chromeService = ChromeDriverService.CreateDefaultService(@"C:\Selenium\InstalledServerDrivers\");
        var options = new ChromeOptions();

        options.AddArgument("--disable-extensions");                                      
        IWebDriver driver = new ChromeDriver(chromeService, options);

        driver.Url = "http://www.google.com/";
查看更多
对你真心纯属浪费
5楼-- · 2019-01-03 22:34

I was suffering from the same problem, and I tried the following:

  1. Pack the unpacked extension
  2. Turn off Developer Mode
  3. Drag and drop the .crx file from the packed extension
  4. Close Chrome, and then open it again.

A few things to note:

  • The .pem file should be kept with the .crx
  • Don't put the .crx and the .pem in the folder of the unpacked extension.

When I reopened Chrome, I got a popup that told me about the new packed extension, so I rebooted Chrome to see if it would do it again, and it did not.

I hope this solution worked!

查看更多
一纸荒年 Trace。
6楼-- · 2019-01-03 22:37

Using selenium with Python, you start the driver with extensions disabled like this:

from selenium import webdriver
options = webdriver.chrome.options.Options()
options.add_argument("--disable-extensions")
driver = webdriver.Chrome(chrome_options=options)

The popup 'Disable developer mode extensions' will not pop up.

查看更多
Explosion°爆炸
7楼-- · 2019-01-03 22:39

The official way to disable the popup seems to be like this:

  1. Pack your extension (chrome://extensions/, tick at 'Developer mode', hit 'Pack extension...') and install it via drag-and-dropping the .crx file into the chrome://extensions page.

    (You'll get an "Unsupported extensions disabled" popup, if you try restarting Chrome at this stage)

Then for Win7/8:

  1. Download Chrome group policy templates from:
    http://dl.google.com/dl/edgedl/chrome/policy/policy_templates.zip
  2. Copy [zip]\windows\admx\chrome.admx to c:\windows\policydefinitions
  3. Copy [zip]\windows\admx\[yourlanguage]\chrome.adml to
    c:\windows\policydefinitions\[yourlanguage]\chrome.adml (not c:\windows\[yourlanguage])
  4. In Chrome, go to the Extensions page (chrome://extensions)
  5. Check the Developer Mode checkbox at the top
  6. Scroll down the list of disabled extensions and note the ID(s) of the extensions you want to enable. LogMeIn, for example, is ID: nmgnihglilniboicepgjclfiageofdfj
  7. Click Start > Run, and type gpedit.msc <ENTER>
  8. Expand User Configuration > Administrative Templates > Google Chrome > Extensions
  9. Double-click to open Configure extension installation whitelist policy
  10. Select Enabled, then click Show...
  11. In the list, enter the ID(s) of the extensions you noted in Step 7
  12. Click OK and restart Chrome

That's it!

As of July 2018, this approach no longer works: it seems Google has stopped honoring the "whitelist"

EDIT: As of 10/16/2018, this approach WORKS. (Chrome Version 69.0.3497.100 (Official Build) (64-bit))

1.Temporarily enable developer mode in chrome://extensions/

2.Uninstall the extension you installed (To be precise the extension that causes the popup) using the "Load unpacked".

3.Click on pack extension and enter the root directory of the files (put the extension files in a single folder/one folder per error causing extension) don't enter the private key file if you don't have it.

4.Click pack extension a .crx and .pem file would be created near the root directory of the extension. Install the extension using the crx file and keep the pem file safe (if you delete it or something goes wrong without it you can always repack the extension).

5.Then copy the crx installed extension ID to the whitelist and restart Chrome.

The popup should be gone.

查看更多
登录 后发表回答