Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headless mode does not load enabled browser extension #2819

Closed
stefanbuck opened this issue Jun 29, 2018 · 6 comments
Closed

Headless mode does not load enabled browser extension #2819

stefanbuck opened this issue Jun 29, 2018 · 6 comments
Assignees

Comments

@stefanbuck
Copy link

Running puppeteer with an enabled browser extension in headless mode does not invoke this browser extension. If I turn off the headless mode it works as expected.

Since it's explicit listed with headless: false in the docs, it seems to be the correct behaviour, but also unexpected (at least for me). Would be interested why extensions are limited that way in puppeteer.

const browser = await puppeteer.launch({
  headless: false,
  args: [
    '--disable-extensions-except=/path/to/extension/',
    '--load-extension=/path/to/extension/',
  ]
});
@aslushnikov
Copy link
Contributor

Unfortunately, chrome headless doesn't support extensions (this has been discussed for quite a while). We should highlight it somewhere in our docs, or better expand on the whole extensions support in Puppeteer (it's getting better and better, especially with #2812 on the horizon).

@aslushnikov aslushnikov self-assigned this Jun 29, 2018
@aslushnikov
Copy link
Contributor

For the record: filed #2823 for the docs.

@JackieGe
Copy link

JackieGe commented Dec 7, 2018

how to load multiple extensions??

@connected-afaizkhademi
Copy link

how to load multiple extensions??

@JackieGe you can load multiple extensions this way:

const ext1 = 'path to ext1';
const ext2 = 'path to ext2';
const browser = await puppeteer.launch({
      headless: false,
      args: ['--no-sandbox', '--disable-setuid-sandbox', '-disable-gpu', '--no-first-run', '--disable-notifications', `--disable-extensions-except=${ext1},${ext2}`, `--load-extension=${ext1}`, `--load-extension=${ext2}`]
});

@wearhere
Copy link

Hey folks, thanks for updating the docs to note that Chrome Headless doesn't currently support extensions. I'm curious about that closing this issue—where is adding headless support for extensions tracked? Glad to file an issue somewhere if one doesn’t exist.

@wernerwernerwerner888
Copy link

anything new or planned here? or a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants