9951 explained code solutions for 126 technologies


chrome-headlessHow to run chrome headless with extensions


In order to run extension in headless mode, you need to launch browser using Xvfb:

xvfb-run google-chrome --remote-debugging-port=9222 --load-extension="/path/to/ext" https://onelinerhub.comctrl + c
xvfb-run

xvfb framebuffer launcher

--remote-debugging-port

specify port to listen for debugging protocol

--load-extension

specify extension path to load (you can use multiple paths, separated by comma)

/path/to/ext

path to extension directory (the one with manifest.json file inside)

onelinerhub.com

sample URL to load on browser launch