Automatically set up your Mac and configure macOS using ./freshinstall

Recently I configured my new MacBook Pro. I decided to start with a clean slate and not migrate anything from my old MacBook. To configure macOS I whipped up ./freshinstall, which automates that process. Steps included are: Configure macOS Preferences and the like Generate and load SSH keys Install the essentials: XCode, Git, Homebrew Copy […]

Puppeteer – Headless Chrome Node API

Puppeteer is a Node library which provides a high-level API to control headless Chrome over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome. const puppeteer = require(‘puppeteer’); (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto(‘https://example.com’); await page.screenshot({path: ‘example.png’}); browser.close(); })(); Puppeteer – […]

Chromeless Playground: Chrome Automation Made Simple

With Chrome 59 came the ability to run a Headless Chrome. Controlling it via code isn’t that easy nor elegant. Enter Chromeless (not be confused with Mozilla’s Chromeless): With Chromeless you can control Chrome (open website, click elements, fill out forms…) using an elegant API. This is useful for integration tests or any other scenario […]

SlimerJS — A scriptable browser for Web developers

SlimerJS allows you to interact with a web page through an external JS script. It is useful to do functional tests, page automation, network monitoring, screen capture, etc. webpage .open(url) // loads a page .then(function(){ // executed after loading // store a screenshot of the page webpage.viewportSize = { width:650, height:320 }; webpage.render(‘page.png’, {onlyViewport:true}); // […]

CasperJS: a navigation scripting & testing utility for PhantomJS

CasperJS is an open source navigation scripting & testing utility written in Javascript and based on PhantomJS — the scriptable headless WebKit engine. It eases the process of defining a full navigation scenario and provides useful high-level functions, methods & syntactic sugar for doing common tasks Written on top of the previously mentioned PhantomJS var […]

PhantomJS: Headless WebKit with JavaScript API

PhantomJS is a headless WebKit with JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG. var page = require(‘webpage’).create(); console.log(‘The default user agent is ‘ + page.settings.userAgent); page.settings.userAgent = ‘SpecialAgent’; page.open(‘http://www.httpuseragent.org’, function (status) { if (status !== ‘success’) { console.log(‘Unable to access network’); } […]