Download puppeteer docker12/16/2023 ![]() I’m using the server args above because they are used in the xvfb.py file in the Chrome source code, so I figure they should work. In my case the command that runs chrome is npm run test. Then finally run xvfb-run -a -server-args="-screen 0 1280x800x24 -ac -nolisten tcp -dpi 96 +extension RANDR" command-that-runs-chrome. ![]() I’m using the circleci/node:10 Docker image from CircleCI, where xvfb is already installed. We need something called an X display server, and since we don’t have an actual monitor we can use xvfb (X virtual framebuffer) to simulate one. That’s because on the server there’s no window environment to render Chrome in. If you just disable the headless flag you’ll get a “Chrome failed to launch” message. Since I wanted to test my Chrome extension in CircleCI I had to run Chrome in normal headful mode instead. ![]() Running headless Chrome with Puppeteer on a server is super easy, but it doesn’t support Chrome extensions. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |