171

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

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
lambsubstitute
  • 1,981
  • 2
  • 13
  • 9
  • Use external clicks to kill the popup: http://stackoverflow.com/a/29376532/285594 –  Feb 13 '16 at 12:35
  • 2
    I suggest http://stackoverflow.com/questions/30287907/how-to-hack-chrome-dll-to-get-rid-of-the-disable-developer-mode-extensions-pop – artdias90 Oct 17 '16 at 07:33
  • @artdias90 doesn't work anymore, he also doesn't want to update anymore (which is understandable after 2 years of maintaining it). – BadAtPHP Jan 14 '18 at 16:37
  • after the popup shows, press esc button using robot type. `Robot robot; try { robot = new Robot(); robot.keyPress(KeyEvent.VK_ENTER); // confirm by pressing Enter in the end robot.keyRelease(KeyEvent.VK_ENTER); } catch (AWTException e) { printStackTraceToString(e); }` – Abdullah Nurum Jan 24 '18 at 04:16
  • 4
    Side note: Vivaldi browser is compatible with most chrome extensions and does not give this warning – User Mar 11 '18 at 21:06
  • Another option is to use Chromium, it doesn't have the annoying popups or the "antivirus". There are good builds [here](https://chromium.woolyss.com/) or you can make your own build, which is not an easy process. – blade Jan 10 '20 at 09:03

20 Answers20

81

The official way to disable the popup is this:

  1. Pack your extension: go to chrome://extensions, check Developer mode and click Pack extension

  2. Install the extension by dragging 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 point.

Then for Windows 7 or Windows 8:

  1. Download Chrome group policy templates here
  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 Developer Mode
  6. Scroll down the list of disabled extensions and note the ID(s) of the extensions you want to enable.
  7. Click Start > Run, type gpedit.msc and hit enter.
  8. Click User Configuration > Administrative Templates > Google Chrome > Extensions
  9. Double click Configure extension installation whitelist policy
  10. Select Enabled, and 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!

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

EDIT 2: As of December 2018, this approach works in Chrome Version 69.0.3497.100 (Official Build) (64-bit):

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

  2. Uninstall the extension that causes the popup using the Load unpacked.

  3. Click on Pack extension, and find and select the folder containing the extension files. Don't enter the private key file if you don't have it.

  4. Click Pack extension. A .crx and .pem file will be created near the root directory of the extension. Install the extension using the .crx file and keep the .pem file safe.

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

The popup should be gone.

Aryan Beezadhur
  • 4,503
  • 4
  • 21
  • 42
Antony Hatchkins
  • 31,947
  • 10
  • 111
  • 111
  • Your link points to a discussion in 2014 (which seems like a *long* time ago as far as software is concerned), and I don't see anything about it coming from Google as "official". – Ryan Aug 10 '16 at 23:53
  • 4
    @Ryan The homepage of those policy templates seems to be https://www.chromium.org/administrators/policy-templates This site is updated regularly (last update 54 minutes ago). I used this method on Jun 24 and the configuration works with most recent Chrome version today. If you prefer «Can't be disabled» to be the official version - it's your choice ;) – Antony Hatchkins Aug 11 '16 at 08:03
  • The warning message is still displayed whenever I start a Chrome browser via Selenium. I do not have the problem when I start Chrome manually. Any ideas? – kriegaex Aug 11 '16 at 10:17
  • I found out it is the _Chrome Automation Extension_, extension ID _aapnijgdinlhnhlmodcfapnahmbfebeb_. I added it to the white list, but to no avail. – kriegaex Aug 11 '16 at 10:59
  • 1
    I solved the problem via Selenium Chrome Driver options, see [here](http://stackoverflow.com/a/23229927/1082681). – kriegaex Aug 11 '16 at 11:25
  • @AntonyHatchkins Thanks! – Ryan Aug 11 '16 at 17:24
  • @Antony Hatchkins Upvote this because I used this myself and it did help for some time. From Chrome v. 55 however it stopped working.. – tube-builder Dec 18 '16 at 08:16
  • @tube-builder Thanks! I'm on 55.0.2883.87 m (win7 x64). The message doesn't show up as yet. What are the symptoms on your side? – Antony Hatchkins Dec 18 '16 at 15:30
  • 1
    @Antony Hatchkins I used the updated code from this answer http://stackoverflow.com/questions/30287907/how-to-hack-chrome-dll-to-get-rid-of-the-disable-developer-mode-extensions-pop and it started working again. thanks for reacting! – tube-builder Dec 19 '16 at 16:25
  • @tube-builder I had used to patch chrome after every update using that answer before I found this solution. I was hoping it would be permanent. – Antony Hatchkins Dec 19 '16 at 16:28
  • 1
    My Windows is Home Premium, I don't have gpedit.msc :/ – Lucas Bustamante Mar 11 '17 at 17:59
  • 1
    Works for me in Chrome 58.0.3029.81, Win 7 x64 :) Hoping this solution will last! – Jimadine Apr 28 '17 at 19:36
  • @Jimadine happy to hear that :) – Antony Hatchkins Apr 30 '17 at 17:08
  • @Antony Hatchkins: Step 5 won't work in Chrome 59, hence my (attempted) edit. It should be: 3 dots > More Tools > Extensions, or chrome://extensions now. – Jimadine Jun 25 '17 at 10:03
  • Thank you very much! It works on 61.0.3163.100 and Win 10. Google won't let me publish my only fork of extension. At least, I can now use it myself. – Joshua Oct 23 '17 at 12:38
  • Extension installed but then gave a different warning: Unsupported extensions disabled – Daniel Leach Nov 30 '17 at 03:49
  • Anthony Hatchkins: You lost me at 'Pack your extension' – Steve Staple Dec 12 '17 at 15:45
  • @SteveStaple I thought that if you happened to create an extension, packing it won't be a big issue for you ;) I've updated the instructions. – Antony Hatchkins Dec 12 '17 at 16:12
  • about the 2018 update you posted, I tried on Version 70.0.3538.77 (Official Build) (64-bit) but it's not working. If it is, could you explain more steps 4 (installing) and 5 (whitelisting)? Thanks – Mike Nov 07 '18 at 08:25
  • "Then copy the crx installed extension ID to the whitelist and restart chrome. The popup should be gone" - How do you do this? – Altimus Prime Nov 25 '18 at 04:22
  • 1
    @Aunt Jemima You need to use the new .crx file that you created from packing. After packing the original extension you can delete it. Drag & drop the .crx file into the Chrome extensions, then get the unique ID of the .crx extension and add it to the white list in Local Group. Also remove the old ID in the white list. It should work. – Aindriú Apr 08 '19 at 19:32
  • 1
    If Windows is telling that it cannot find gpedit.msc, look at this article https://www.itechtics.com/enable-gpedit-windows-10-home/ – Elijah May 08 '19 at 18:20
  • If under `Administrative Templates` you not see `Google`, go and follow [this](https://support.google.com/chrome/a/answer/187202?hl=en) instructions to make it visible. Tested on `Chrome 83.0.4103.97` and works perfectly. – robe007 Jun 08 '20 at 16:59
  • I think something changed on win10, I used to be able to just drag the packed extension to the extensions screen, and now it shows CRX_REQUIRED_PROOF_MISSING message. – tkit Apr 13 '21 at 09:24
  • 1
    Why keeping an answer depreciated then an history of "edit" from 2018? (And it does not work anymore). This answer should be updated, cleaned or removed. – JinSnow Aug 17 '21 at 06:21
36

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);
Amanpreet Kaur
  • 1,074
  • 8
  • 7
  • 38
    where should we write this ? – İbrahim Özbölük Jul 20 '16 at 12:12
  • Added it to my Protractor conf.js file args list and that worked. Thanks a lot :) – ghiscoding Jul 29 '16 at 15:16
  • 2
    This worked great. In C# the code is: `options.AddArgument("--disable-extensions");` – kirbycope Aug 12 '16 at 21:54
  • Is this Java? It's not Protractor (a Javascript e2e test lib) right? It'd be good if you mention what framework & language you have in mind. – KajMagnus Oct 19 '16 at 08:47
  • 4
    Today, I had to use `options.AddArguments("chrome.switches", "--disable-extensions --disable-extensions-file-access-check --disable-extensions-http-throttling");` instead of just `--disable-extensions. I think one of the additional switches can be omitted, but not both. – Anders Lindén Apr 04 '17 at 12:27
  • 15
    can you explain it a bit for mortal humans? what is that script, or where to put it... – T.Todua Aug 12 '17 at 14:30
  • 1
    If I am not mistaken, @amanpreet-kaur's answer is for people who are automating something using Chrome driver. In the snippet, Java was probably used to automate a Chrome driver. This answer does NOT apply for you if you yourself are just using Chrome as-is from your desktop. See: https://chromedriver.chromium.org/ – user5305519 Jun 02 '20 at 15:53
23

As of May 2015 Chrome beta/dev/canary on Windows (see lines 75-78) always display this warning.

  • I've just patched chrome.dll (dev channel, 32-bit) using hiew32 demo version: run it, switch to hex view (Enter key), search for ExtensionDeveloperModeWarning (F7) then press F6 to find the referring code, go to nearby INC EAX line, which is followed by RETN, press F3 to edit, type 90 instead of 40, which will be rendered as NOP (no-op), save (F9).

  • Simplified method found by @Gsx, which also works for 64-bit Chrome dev:

    1. run hiew32 demo (in admin mode) and open Chrome.dll
    2. switch to hex view (Enter key)
    3. search for ExtensionDeveloperModeWarning (F7)
    4. press F3 to edit and replace the first letter "E" with any other character
    5. save (F9).
  • patch.BAT script

Of course this will last only until the next update so whoever needs it frequently might write an auto-patcher or a launcher that patches the dll in memory.

Community
  • 1
  • 1
wOxxOm
  • 65,848
  • 11
  • 132
  • 136
  • Hi, I am trying to patch it with hiew32demo but I haven't been able to do so. When I open chrome.dll I get `Hiew Demo doesn't support NE/LX/LE/NLM/ELF/PE64 files`, but I can skip that warning. Then I change the mode with F4 to decode and search _ExtensionDeveloperMo_ since _ExtensionDeveloperModeWarning _ doesn't fit. After it finds it I press F6 but I get `Target not found`. Could you help me? – Gsx May 17 '15 at 14:03
  • 1
    I can't find '4578 7465 6e73 696f 6e44 6576' ('ExtensionDev') in chrome.dll. Does this method still work? – Emerson May 17 '15 at 14:15
  • Gsx, my method works for 32-bit Chrome on dev channel. – wOxxOm May 18 '15 at 14:22
  • 2
    Emerson, this change has landed in the Dev channel just a week ago, so it's not in Stable. You'll have to find the relevant place by analyzing the previous version of source code. – wOxxOm May 18 '15 at 14:24
  • Ah, ok. I am on 64-bit dev. I'll try to find another way. – Gsx May 18 '15 at 16:14
  • @Gsx, well, if you have a 64-bit disassembler, the procedure shouldn't be too different from the one I described. Example for dev 64-bit 44.0.2398 (not tested but looks plausible): search for hex 33 DB 84 C0 74 07 B8 01 00 00 00, repeat the search to confirm it's the only occurence, replace the last 01 00 00 00 with 00 00 00 00 (basically there was MOV EAX, true which we replace with false) – wOxxOm May 18 '15 at 20:17
  • 1
    @wOxxOm That failed also, but I have found a weird way XD. I searched for _ExtensionDeveloperMo_ and changed that to _EXtensionDeveloperMo_ and that seemed to work. – Gsx May 18 '15 at 23:58
  • I switched from Beta to Dev channel (44.0.2403.9), I was able to search and find `ExtensionDeveloperModeWa` with hiew32 demo (admin mode). I changed `Warning` to `Darling`, saved it with F9, rechecked the changes and replaced the original chrome.dll with my modified one. But the warning still occurs. Grml – nixda May 21 '15 at 22:03
  • @nixda, just tried it on 44.0.2403.9, the method is working. Maybe you have some background Chrome-apps running? Check the processes tab in Windows Task Manager. – wOxxOm May 24 '15 at 11:56
  • I think the .bat patch doesn't work anymore because of Chrome updates. It says that it's already patched but I can still see the popup. Version 66.0.3359.139 (Official Build) (64-bit) – EAX Apr 30 '18 at 16:42
9

There is an alternative solution, use Chrome-Developer-Mode-Extension-Warning-Patcher:

  1. Download the latest release from here from Github.
  2. Close Chrome.
  3. Unpack the zip archive and run ChromeDevExtWarningPatcher.exe as administrator.
  4. Select your Chrome installation from the just opened GUI and then click on Patch button:

enter image description here

  1. Enjoy Chrome without any DevMode pop-up!
Nicola
  • 621
  • 10
  • 22
7

Can't be disabled. Quoting: "Sorry, we know it is annoying, but you the malware writers..."

Your only options are: adapt your automated tests to this new behavior, or upload the offending script to Chrome Web Store (which can be done in an "unlisted" fashion).

Xan
  • 74,770
  • 16
  • 179
  • 206
  • 69
    There are thousands of reason why i cant use my extension/apps in webstore, i need to run it locally. This was a very EVIL implementation from Google Chromium team, very EVIL, someone with knowledge should debat with Chromium and get it fixed. Horrible issue and seriously not appreciated. All the answer to this problem is just over killing for people who is working on kiosks project. its nightmare. please inform / knock/ debat with chromium community to give a fix for this. –  Mar 11 '16 at 02:42
  • 5
    It will only be a matter of time until you can't develop anything anymore using Chrome :) – Vinz Dec 26 '16 at 20:43
  • 1
    Right, it's because of the malware... we aren't trying to annoy people who use extensions we blocked from our store like Dissenter... – Chris_F Jul 10 '19 at 19:58
  • I need to add custom manifest key and upload to web store is not an option. – 林果皞 Sep 27 '19 at 20:17
6

(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).

Panther
  • 159
  • 2
  • 4
  • Thanks Panther. Added the "chrome.adm" template via the dialog, and got this error: The following entry in the [strings] sectin is too long and has been truncated. This is followed by a page of Cyrillic? – Steve Staple Dec 12 '17 at 15:31
  • Use @ to automatically notify other user about your post (like @Panther). – Antony Hatchkins Dec 18 '17 at 15:21
  • @SteveStaple Sorry, but I don't know what would be the cause of such an issue. :( I'm not an expert at this, just followed the instructions from the page I linked. Fortunately it worked for me. – Panther Dec 19 '17 at 18:58
4

The disable extensions setting did not work for me. Instead, I used the Robot class to click the Cancel button.

import java.awt.Robot;
import java.awt.event.InputEvent;

public class kiosk {
  public static void main(String[] args) {
    // As long as you don't move the Chrome window, the Cancel button should appear here.
    int x = 410;
    int y = 187;

    try {
      Thread.sleep(7000);// can also use robot.setAutoDelay(500);
      Robot robot = new Robot();
      robot.mouseMove(x, y);
      robot.mousePress(InputEvent.BUTTON1_MASK);
      robot.mouseRelease(InputEvent.BUTTON1_MASK);
      Thread.sleep(3000);// can also use robot.setAutoDelay(500);
    } catch (AWTException e) {
      System.err.println("Error clicking Cancel.");
      e.printStackTrace();
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }
}
stackexchanger
  • 230
  • 3
  • 9
  • This answer is under-rated because it can be adapted to automate other annoying unavoidable GUI button clicking tasks. – D A May 18 '18 at 02:00
  • @momomo Obviously it can be set in a config or something, but this is just example code. – Steve Smith Aug 14 '19 at 08:54
3

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!

Ethan Leyden
  • 192
  • 2
  • 14
  • I got "Unsupported extensions popup" after using your method. See [my answer](http://stackoverflow.com/a/38011386/237105) for details how to disable it as well. – Antony Hatchkins Jun 24 '16 at 10:38
  • i got "Apps, extensions, and user-scripts cannot be added from this website". – johny why Jan 01 '19 at 23:28
2

Based on Antony Hatchkins's answer:

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.

    (Since the extension is not from Chrome Web Store, it will be disabled by default.)

Then for Windows:

  1. In Chrome, go to the Extensions page (chrome://extensions)
  2. Check the Developer Mode checkbox at the top
  3. 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
  4. Click Start > Run, and type regedit <ENTER>
  5. Under key HKLM\Software\Policies\Google\Chrome\ExtensionInstallWhitelist (create it if not exists), create a new string for each extension you want to enable with sequential names (indices), e.g. 1, 2, ...
  6. Enter the extension ID(s) as string values in any order. For example, there is a string with name 1 and value nmgnihglilniboicepgjclfiageofdfj
  7. Restart Chrome

That's it!

Note: When you update a whitelisted extension, you do not have to follow the same steps since the ID of the extension will not change.

Community
  • 1
  • 1
Burak Gök
  • 335
  • 3
  • 5
  • Drag-and-dropping a `.crx` file just popup a `save as window`, and will not install it. Chrome version 80.0.3987.163. – xyz Apr 16 '20 at 01:18
  • 1
    Could not find the registry key for edge chromium – JinSnow Apr 27 '20 at 07:53
  • @xyz Drag-and-dropping a `.crx` file installs the extension in version 81.0.4044.122. @JinSnow Look at [Microsoft Edge - Policies - ExtensionInstallAllowlist](https://learn.microsoft.com/en-us/deployedge/microsoft-edge-policies#extensioninstallallowlist) – Burak Gök Apr 27 '20 at 19:43
1

1) Wait for the popup balloon to appear.

2) Open a new tab.

3) Close the a new tab. The popup will be gone from the original tab.

A small Chrome extension can automate these steps:

manifest.json

{
  "name": "Open and close tab",
  "description": "After Chrome starts, open and close a new tab.",
  "version": "1.0",
  "manifest_version": 2,
  "permissions": ["tabs"],
  "background": {
    "scripts": ["background.js"], 
    "persistent": false
  }
}

background.js

// This runs when Chrome starts up
chrome.runtime.onStartup.addListener(function() {

  // Execute the inner function after a few seconds
  setTimeout(function() {

    // Open new tab
    chrome.tabs.create({url: "about:blank"});

    // Get tab ID of newly opened tab, then close the tab
    chrome.tabs.query({'currentWindow': true}, function(tabs) {
      var newTabId = tabs[1].id;
      chrome.tabs.remove(newTabId);
    });

  }, 5000);

});

With this extension installed, launch Chrome and immediately switch apps before the popup appears... a few seconds later, the popup will be gone and you won't see it when you switch back to Chrome.

jkdev
  • 11,360
  • 15
  • 54
  • 77
  • *(Bonus tip 1)* When using Selenium you can immediately open a new window, wait for the popup in the new window, and then close the new window to dismiss the popup. https://stackoverflow.com/a/36507179/3345375 – jkdev Jul 03 '18 at 03:42
  • 2
    *(Bonus tip 2)* You could also try this: Add the flag `--enable-automation` to avoid getting the popup. – jkdev Jul 03 '18 at 03:42
  • 2
    This didn't work for me. Win 10, Chrome up to date. After following the steps, the popup remained. – freginold Aug 27 '18 at 13:37
  • @freginold To figure out what worked, I had to experiment with various sequences of opening and closing tabs/windows. The sequence might be different for other OS’s and browser versions. – jkdev Aug 27 '18 at 15:26
  • @jkdev The command line switch `--enable-automation` has its own obnoxious side effect: a `div` appears at the top of each page until dismissed (then it stops appearing). The Developer Mode popup can be dismissed by hitting ESC when it first appears. Annoying in either case! – George Feb 23 '19 at 22:04
0

I am working on Windows And I have tried lots of things provided here as answer but Pop up was disabling the extension continually then i have tried following steps and it works now:

  1. Go to chrome://extensions page and click Pack extension button and select your root Directory of extension by clicking on red rectangled browse button displayed in below image.

browse root directory of extension

  1. after selecting root directory Click on Pack extension button displayed in red circle in below image.

enter image description here

  1. Now in check parent directory of your selected root directory of extension, 2 file would have created [extension name].crx and [extension name].pem.

  2. Now just drag and drop the [extension name].crx file onto the chrome://extensions page and it will ask using add app dialog box click on Add app and refresh the page it is installed now.

Note: Before doing anything as above make sure to enable Developer mode for extensions. If this was not enabled, refresh the chrome://extensions page after enabling it.

Haritsinh Gohil
  • 5,818
  • 48
  • 50
  • 1
    unpacked extension works with developer mode warning. but with crx, the extension is disabled always. google requires the extension to be published on web store and installed from there. – gp. May 23 '19 at 07:49
  • Chrome doesn't let users install packaged extensions and says, package is invalid: CRX_REQUIRED_PROOF_MISSING. – Harshit Juneja Jul 22 '19 at 04:00
  • @HarshitJuneja may be you have to whitelist the extension id, and restart chrome. – Haritsinh Gohil Jul 22 '19 at 06:08
0

This question is enormously old but is still the top result on google when you search for ways to try to disable this popup message as an extension developer who hasn't added their extension to the chrome store, doesn't have access to group policies due to their OS, and is not using the chrome dev build. There is currently no official solution in this circumstance so I'll post a somewhat 'hacky' one here.

This method has us immediately create a new window and close the old one. The popup window is associated with the original window so in normal use cases the popup never appears since that window gets closed.

The simplest solution here is we create a new window, and we close all windows that are not the window we just created in the callback:

chrome.windows.create({
    type: 'normal',
    focused: true,
    state: 'maximized'
}, function(window) {
    chrome.windows.getAll(function(windows) {
        for (var i = 0; i < windows.length; i++) {
            if (windows[i].id != window.id) {
                chrome.windows.remove(windows[i].id);
            }
        }
    });
});

Additionally we can detect how this extension is installed and only run this code if it is a development install (although probably best to completely remove altogether from release code). First we create the callback function for a chrome.management.getSelf call which allows us to check the extension's install type, which is basically just wrapping the code above in an if statement:

function suppress_dev_warning(info) {
    if (info.installType == "development") {
        chrome.windows.create({
            type: 'normal',
            focused: true,
            state: 'maximized'
        }, function(window) {
            chrome.windows.getAll(function(windows) {
                for (var i = 0; i < windows.length; i++) {
                    if (windows[i].id != window.id) {
                        chrome.windows.remove(windows[i].id);
                    }
                }
            });
        });
    }
}

next we call chrome.management.getSelf with the callback we made:

chrome.management.getSelf(suppress_dev_warning);

This method has some caveats, namely we are assuming a persistent background page which means the code runs only once when chrome is first opened. A second issue is that if we reload/refresh the extension from the chrome://extensions page, it will close all windows that are currently open and in my experience sometimes display the warning anyways. This special case can be avoided by checking if any tabs are open to "chrome://extensions" and not executing if they are.

SparkleStep
  • 231
  • 3
  • 7
0

Have you tried using the Developer Mode Extension Patcher on Github?

It automatically patches your Chrome/Chromium/Edge browser and hides the warning.

Ceiridge
  • 11
  • 2
  • 3
0

I found something that will load user-packed extensions and works beautifully:

You'll still have to pack it in details for the problem extension, but after that you can turn off developer mode and load the packed CRX through this. You don't have to deal with signing it or anything.

https://chrome.google.com/webstore/detail/crosspilot/migomhggnppjdijnfkiimcpjgnhmnale?hl=en

Note: I'm not from their team, I've just been looking for an elegant solution for this for years.

-1

Ruby based watir-webdriver use something like this:

browser=Watir::Browser.new( :chrome, :switches => %w[ --disable-extensions ] )
Mahonri Moriancumer
  • 5,993
  • 2
  • 18
  • 28
Superkevy
  • 7
  • 1
-1

For anyone using WebdriverIO, you can disable extensions by creating your client like this:

var driver = require('webdriverio');
var client = driver.remote({
    desiredCapabilities: {
        browserName: 'chrome',
        chromeOptions: {
            args: [
                'disable-extensions'
            ]
        }
    }
});
chris
  • 1,638
  • 2
  • 15
  • 17
  • OP isn't using WebDriverIO. Moreover OP is asking to disable the popup, but you went to disable extensions instead. – Cardin Apr 15 '19 at 03:46
-1

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/";
Doug
  • 215
  • 2
  • 6
-1

Now, we need to handle it using following -

ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("chrome.switches", "--disable-extensions --disable-extensions-file-access-check --disable-extensions-http-throttling");

Apart from --disable-extensions, we also need to add --disable-extensions-file-access-check (and/or) --disable-extensions-http-throttling chrome switches.

Alpha
  • 13,320
  • 27
  • 96
  • 163
-2

Unfortunately I cant automate setting it to developer mode because of restrictions in width using the browser in iphone mode. I have found a dangerous workaround for now, install the dev channel version of chrome. It does not have the warning message, but im sure it will cause me more problems in the long run when problems are introduced. Still will hopefully give me a few days to find a workaround.

lambsubstitute
  • 1,981
  • 2
  • 13
  • 9
  • You can also use the [beta channel](https://www.google.com/intl/en/chrome/browser/beta.html). It's more stable than dev. At the same time, it has more features than the stable channel. – Rob W Apr 14 '14 at 17:18
  • 1
    @RobW asargent said that the popup is present in the beta channel too. Is that wrong? https://code.google.com/p/chromium/issues/detail?id=337734#c2 – rsanchez Apr 14 '14 at 17:24
  • 1
    @rsanchez Just tried on Windows, and you're correct. Thanks for the correction. I'm using Linux, so I don't experience this issue (: – Rob W Apr 14 '14 at 17:31
  • This no longer works: http://blog.chromium.org/2015/05/continuing-to-protect-chrome-users-from.html – Xan May 14 '15 at 11:37
  • @RobW Could you post an update on the bug? (it's `Restrict-AddIssueComment-EditIssue`) – Xan May 14 '15 at 11:39
-4

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.

Remi
  • 20,619
  • 8
  • 57
  • 41
  • OP asks how to disable the popup, you instead decided to disable his extensions instead. :/ – Cardin Apr 15 '19 at 03:44