2025, Oct 20 18:00
How to load an unpacked Chrome extension with Selenium after Chrome 137–138: fix flags and Manifest V2/V3 pitfalls
Troubleshoot Selenium on Chrome 137–138+: load an unpacked extension by enabling DisableLoadExtensionCommandLineSwitch and handling Manifest V2 to V3 changes.
Loading an unpacked Chrome extension with Selenium can be unexpectedly tricky on recent Chrome builds. A common symptom is that the browser starts fine, your target page loads, but the extension never shows up in the toolbar and clearly isn’t active. Below is a concise walkthrough of what’s going on and how to make it work without guesswork.
Reproducing the issue
The following Python script launches Chrome, points it to an unpacked extension folder, and opens Google Maps. On Chrome 138.0.7204.100 (Ubuntu 24.04), the extension doesn’t appear:
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
ext_dir = 'Pano-fetch'
chr_opts = Options()
drv_svc = Service("/usr/bin/chromedriver")
chr_opts.add_argument('--load-extension={}'.format(ext_dir))
chr_opts.add_experimental_option("detach", True)
browser = webdriver.Chrome(service=drv_svc, options=chr_opts)
browser.get("https://www.google.com/maps")
time.sleep(10)
What’s actually blocking the extension
There are two distinct changes in recent Chrome releases that impact this scenario. First, starting with Chrome 137, the --load-extension switch is disabled by default unless you explicitly allow it with a dedicated feature toggle. Second, a Chrome 138 update removed support for Manifest V2 extensions. If your unpacked directory contains a V2 extension, Chrome may simply refuse to load it.
The first blocker is straightforward to address. The second one depends entirely on the extension you are trying to use. The extension referenced in the original context was last updated in 2018, which likely means it’s still on Manifest V2, and thus won’t load on Chrome that enforces V3. In that case you must switch to a Manifest V3-compatible extension, or run a Chrome build where V2 is still accepted, for example via chrome-for-testing.
Working fix and updated example
Start by re-enabling the command-line switch for unpacked extensions. Add the following argument to your Chrome options:
--disable-features=DisableLoadExtensionCommandLineSwitch
With that in place, the original flow remains unchanged. Here is the adjusted script:
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
ext_dir = 'Pano-fetch'
chr_opts = Options()
drv_svc = Service("/usr/bin/chromedriver")
chr_opts.add_argument('--disable-features=DisableLoadExtensionCommandLineSwitch')
chr_opts.add_argument('--load-extension={}'.format(ext_dir))
chr_opts.add_experimental_option("detach", True)
browser = webdriver.Chrome(service=drv_svc, options=chr_opts)
browser.get("https://www.google.com/maps")
time.sleep(10)
If your extension still doesn’t appear after this change, you’re most likely dealing with the Manifest V2 deprecation on Chrome 138. In that case, use a Manifest V3-compatible extension. Alternatively, you can select a Chrome version where V2 still works by installing a specific build using chrome-for-testing.
Why this matters for automation
Extension support is both a functional and stability concern for end-to-end tests and scraping pipelines. A single Chrome update can silently break assumptions about how unpacked extensions load, or whether an older manifest version is allowed at all. Keeping your test environment aligned with browser release behavior—and knowing which switches are required—is essential to avoid flaky runs.
When Chrome 139 comes out, things may change. Be prepared.
It’s also worth noting that in one reported setup, only the first fix was necessary and a Manifest V2 extension still loaded on the current Chrome build. Your mileage may vary depending on the exact release and update state.
Takeaways
If an unpacked extension won’t show up under Selenium on Chrome 137 or later, first enable the command-line switch by adding --disable-features=DisableLoadExtensionCommandLineSwitch. If it still fails on Chrome 138, assume Manifest V2 is not accepted and switch to a Manifest V3-compatible extension, or run a Chrome version where V2 remains supported using chrome-for-testing. Keeping an eye on upcoming releases is prudent, because extension loading behavior can shift again in future versions.
The article is based on a question from StackOverflow by Daniel AG and an answer by Michael Mintz.