I’m trying to load an unpacked Chrome extension inside a Linux-based Docker container to automate extension testing. However, the extension does not load — neither when launching Chrome directly via CLI nor when using Puppeteer.
Environment Details
- Base image: linuxserver/webtop:ubuntu-xfce
- Chrome version: Google Chrome 142.0.7444.162
- Dependencies from package.json
{
"dependencies": {
"puppeteer": "^24.29.1",
"puppeteer-extra": "^3.3.6",
"puppeteer-extra-plugin-stealth": "^2.11.2"
}
}
- Goal: Load unpacked Chrome extension for automated testing
What I have tried
- Launching Chrome via command line
google-chrome \
--no-sandbox \
--disable-dev-shm-usage \
--disable-gpu \
--user-data-dir=/config/chrome-profile \
--load-extension=/app/extension \
--disable-extensions-except=/app/extension
- Using Puppeteer with --load-extension
const puppeteer = require('puppeteer-extra');
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
async function runAutomation() {
puppeteer.use(StealthPlugin());
const browser = await puppeteer.launch({
executablePath: '/usr/bin/google-chrome',
headless: false,
ignoreDefaultArgs: ['--disable-extensions'],
args: [
'--no-sandbox',
'--disable-dev-shm-usage',
'--disable-gpu',
'--user-data-dir=/config/chrome-profile',
'--load-extension=/app/extension',
'--disable-extensions-except=/app/extension',
'--remote-debugging-port=9222'
],
});
}
runAutomation().catch(console.error);
This same Puppeteer code successfully loads the unpacked extension on my Windows machine.
However, inside the container, both approaches (CLI and Puppeteer) start Chrome in headful mode successfully — but the extension never loads.
Visual demonstration
Here’s a short recording showing how the script runs — the Chrome window opens, but the extension isn’t visible under chrome://extensions/. Video reference: https://www.loom.com/share/e567b06d03b24236b0a5f525170f5858
Verified Checkpoints
--user-data-dir=/config/chrome-profile exists, contains the unpacked extension, and has 777 permissions.
1.1 I can manually load the same extension when using Chrome interactively (chrome://extenstions -> Enable Developer mode -> Load Unpacked)
Chrome launches correctly in headful mode.
Used ignoreDefaultArgs: ['--disable-extensions'] while launching Puppeteer to ensure extensions aren’t disabled.
Also tested with Chrome’s internal logging flags — but no error or clue found:
--enable-logging --v=1 --enable-extension-activity-logging
Questions: What am I missing or misconfiguring that prevents the unpacked extension from loading inside the container, even though it works perfectly on Windows?