cyberangles blog

How to Disable 'Disable Developer Mode Extensions' Pop-Up in ChromeDriver for Selenium WebDriver Automation

Selenium WebDriver is a powerful tool for automating web browsers, widely used for testing web applications and scraping data. When working with Google Chrome, ChromeDriver acts as the bridge between Selenium and the Chrome browser. However, a common annoyance during automation is the 'Disable Developer Mode Extensions' pop-up, which appears when Chrome detects an unpacked (developer-mode) extension loaded during test execution. This pop-up can interrupt test flows, cause test failures, or lead to flaky results, as Selenium cannot interact with browser-level dialogs by default.

In this blog, we will explore why this pop-up appears, and provide detailed, step-by-step methods to disable it, ensuring smooth and uninterrupted Selenium automation with ChromeDriver.

2026-02

Table of Contents#

  1. Understanding the 'Disable Developer Mode Extensions' Pop-Up
  2. Why Does the Pop-Up Appear?
  3. Methods to Disable the Pop-Up
  4. Troubleshooting Common Issues
  5. Conclusion
  6. References

Understanding the 'Disable Developer Mode Extensions' Pop-Up#

The 'Disable Developer Mode Extensions' pop-up is a security warning from Google Chrome. It typically displays the message:

"Disable Developer Mode Extensions
Extensions running in developer mode can harm your computer. If you're not a developer, you should disable these extensions. Disable extensions now?"

It appears as a modal dialog with "Disable" and "Cancel" buttons. Since Selenium cannot interact with this pop-up, it blocks test execution, leading to timeouts or failed tests.

Why the Pop-Up Appears#

Chrome flags extensions as "developer mode" if they are unpacked (i.e., loaded from a local directory instead of the Chrome Web Store). Unpacked extensions are commonly used during development, as they allow developers to test changes without repackaging. However, Chrome considers them less secure than signed, packed extensions (distributed as .crx files via the Chrome Web Store), hence the warning.

When Selenium automates Chrome and loads an unpacked extension (via --load-extension), Chrome detects it as developer mode and triggers the pop-up.

Methods to Disable the Pop-Up#

The most reliable way to avoid the pop-up is to pack the unpacked extension into a signed .crx file. Packed extensions are treated as "production-ready" by Chrome and do not trigger developer mode warnings.

Step 1: Prepare the Unpacked Extension#

Ensure you have the unpacked extension directory (e.g., my-extension) with all required files, including manifest.json (the extension’s configuration file).

Step 2: Pack the Extension into a CRX File#

To pack the extension:

  1. Open Google Chrome and navigate to chrome://extensions/.
  2. Enable "Developer mode" by toggling the switch in the top-right corner.
  3. Click the "Pack extension" button (near the top-left).
  4. In the dialog:
    • Extension root directory: Select the path to your unpacked extension folder (e.g., C:\extensions\my-extension).
    • Private key file (optional): Leave this blank to generate a new .pem key (used to sign future updates).
  5. Click "Pack Extension".

Chrome will generate two files in the parent directory of your extension:

  • my-extension.crx: The packed extension file.
  • my-extension.pem: The private key (save this to update the extension later).

Step 3: Load the CRX File in Selenium#

Use Selenium’s ChromeOptions to load the .crx file instead of the unpacked directory. This avoids developer mode and the pop-up.

Example Code (Python)#
from selenium import webdriver  
from selenium.webdriver.chrome.options import Options  
 
# Initialize ChromeOptions  
chrome_options = Options()  
 
# Load the packed CRX extension  
chrome_options.add_extension('path/to/my-extension.crx')  # Replace with your CRX path  
 
# Initialize ChromeDriver with options  
driver = webdriver.Chrome(options=chrome_options)  
 
# Test the extension (e.g., navigate to a page where the extension acts)  
driver.get("https://example.com")  
 
# Quit the driver  
driver.quit()  
Example Code (Java)#
import org.openqa.selenium.WebDriver;  
import org.openqa.selenium.chrome.ChromeDriver;  
import org.openqa.selenium.chrome.ChromeOptions;  
 
public class DisableExtensionPopup {  
    public static void main(String[] args) {  
        // Initialize ChromeOptions  
        ChromeOptions chromeOptions = new ChromeOptions();  
 
        // Load the packed CRX extension  
        chromeOptions.addExtensions(new File("path/to/my-extension.crx"));  // Replace with your CRX path  
 
        // Initialize ChromeDriver with options  
        WebDriver driver = new ChromeDriver(chromeOptions);  
 
        // Test the extension  
        driver.get("https://example.com");  
 
        // Quit the driver  
        driver.quit();  
    }  
}  

Method 2: Using Unpacked Extensions with Workarounds (Unreliable)#

If packing the extension is not feasible (e.g., during active development), you can try workarounds to suppress the pop-up. These methods are not guaranteed to work in all Chrome versions (especially newer ones) but may help in specific scenarios.

Workaround: Use --silent-debugger-extension-api#

This Chrome flag suppresses prompts when an extension uses the chrome.debugger API. While not explicitly designed for the developer mode pop-up, some users report it reduces extension-related warnings.

Example Code (Python)#
from selenium import webdriver  
from selenium.webdriver.chrome.options import Options  
 
chrome_options = Options()  
 
# Load the unpacked extension and add the workaround flag  
chrome_options.add_argument("--load-extension=path/to/unpacked/extension")  # Unpacked extension path  
chrome_options.add_argument("--silent-debugger-extension-api")  # Suppress debugger API prompts  
 
driver = webdriver.Chrome(options=chrome_options)  
driver.get("https://example.com")  
driver.quit()  

Note: Limitations of Unpacked Extensions#

  • Chrome frequently updates security policies, and flags like --silent-debugger-extension-api may be deprecated.
  • The pop-up may still appear in newer Chrome versions (90+), making this method unreliable for long-term use.

Troubleshooting Common Issues#

1. CRX File Not Loading#

  • Issue: Selenium throws an error like unknown error: cannot load extension from ....
  • Fix:
    • Ensure the .crx file is not corrupted (regenerate it if needed).
    • Verify the extension is compatible with your Chrome version (check manifest.json for minimum_chrome_version).
    • Use an absolute path to the .crx file (e.g., C:\extensions\my-extension.crx instead of a relative path).

2. Pop-Up Still Appears After Loading CRX#

  • Issue: The pop-up persists even with the CRX file.
  • Fix:
    • Confirm the extension is packed (not unpacked). Unpacked extensions use --load-extension; CRX uses add_extension().
    • Update Chrome and ChromeDriver to the latest versions (older versions may have bugs).

3. Extension Not Working in Automation#

  • Issue: The extension loads but fails to function.
  • Fix:
    • Check the extension’s logs in Chrome (navigate to chrome://extensions/, click "Details" for the extension, then "View logs").
    • Ensure the extension has the necessary permissions (e.g., activeTab, scripting) in manifest.json.

Conclusion#

The 'Disable Developer Mode Extensions' pop-up in ChromeDriver can disrupt Selenium automation, but it is avoidable with the right approach. The recommended solution is to pack your extension into a .crx file, as it eliminates the developer mode warning entirely. For temporary workarounds with unpacked extensions, use flags like --silent-debugger-extension-api, but be aware of their unreliability in newer Chrome versions.

By following the steps in this guide, you can ensure smooth, uninterrupted automation workflows with Selenium and ChromeDriver.

References#