0

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

  1. Base image: linuxserver/webtop:ubuntu-xfce
  2. Chrome version: Google Chrome 142.0.7444.162
  3. Dependencies from package.json
{
  "dependencies": {
    "puppeteer": "^24.29.1",
    "puppeteer-extra": "^3.3.6",
    "puppeteer-extra-plugin-stealth": "^2.11.2"
  }
}
  1. Goal: Load unpacked Chrome extension for automated testing

What I have tried

  1. 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
  1. 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

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

  2. Chrome launches correctly in headful mode.

  3. Used ignoreDefaultArgs: ['--disable-extensions'] while launching Puppeteer to ensure extensions aren’t disabled.

  4. 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?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.