|December 1, 2017|
In May, Google shipped headless functionality with Google Chrome 59. Google description of the feature:
A headless browser is a great tool for running automated tests and server environments where you don't need to see the rendered output or have a visible UI shell.
Thanks to Google Chrome Autoupdate, everyone should have this feature by now.
Here's a simple script to take a screenshot of any particular website:
Shell Script Code:
alias chrome="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome";
chrome --headless --disable-gpu --screenshot --window-size=1280,2696 http://www.cryan.com/blog;
Chrome saves every file as screenshot.png. There's currently no way to change the filename during command run. So I added the Keyboard Maestro built-in file rename immediately after the screen capture.
The "window-size=1280,1696" is the size of a standard letterhead
The iPhone 8 browser window size is 375x667
The iPhone X browser window size is 375x812
The Samsung Galaxy S8+ browser window size is 360x740
I added Keyboard Maestro's cron feature so that the screenshot process would run automatically. Here some example uses:
Setting this up as Cron feature allows you to set it and forget it. These will run as long as your computer is up and running.
|Keyboard Maestro Global Macro Palette||Using Keyboard Maestro Global Macro Palette in iTerm|
|Keyboard Maestro Date Formatting||Simple conversion guide on using the Date format for those more familiar with Text Expander|
Feel free to leave a comment about this post.