You can run Chrome with extensions headless using Xvfb.
- Install Xvfb. On Fedora
sudo dnf install xorg-x11-server-Xvfb
xvfb-run google-chrome --remote-debugging-port=9222 --disable-gpu https://www.google.com
- Use chrome-remote-interface (or another Chrome Debug Protocol client) to trigger the screenshot.
More complicated, but it does work. It’s what we use for headless chrome extension testing.