Headless WebKit with a JavaScript API