Pretty cool! Check out Google's headless browser API Puppeteer too, they provide a few really useful functions for doing stuff like this.
https://github.com/GoogleChrome/puppeteer/blob/master/exampl...
Really easy to work around, I used it to build a simple CLI to generate device screenshots of a webpage by modifying the user-agent and resolution to match each device.