1

Chrome version : 58 OS : Ubuntu 16.04

I wanted to take screenshot after blocking ads in chrome --headless mode.For which I have added an entry in default_apps/external_extensions.json for property external_update_url. (Ref : Link)

When I run the application with google-chrome --remote-debugging-port=9222 --disable-gpu

I am able to see that the adblock plugin is active and blocking adds,While when I tried to run google-chrome --headless --remote-debugging-port=9222 --disable-gpu

(i.e in headless mode) the adblock plugin is not running or enabled.

I verified the fact by taking screenshot of viewport in both modes. Can anyone please help me to run the adblock plus extension for headless mode.

Santan Pereira
  • 75
  • 3
  • 12
  • Possible duplicate of [Is it possible to run Google Chrome in headless mode with extensions?](https://stackoverflow.com/questions/45372066/is-it-possible-to-run-google-chrome-in-headless-mode-with-extensions) – Filnor Mar 18 '18 at 15:39

1 Answers1

0

Headless Chrome does not support extensions, but you can render Chrome on a virtual display. See Is it possible to run Google Chrome in headless mode with extensions?

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/20026443) – digital.aaron Jun 14 '18 at 23:14
  • @digital.aaron I disagree, the answer is _"Headless Chrome does not support extensions"_, the rest is just hinting towards an alternative. – Mark Rotteveel Jun 15 '18 at 06:37