/headless

headless browser script runner

Primary LanguageGo

Example

$ headless -c "
console.log('yolo');
window.close(1);
"
yolo
exit status 1

Motivation

I want to run js in a headless browser from bash - e.g. to automate running my clientside js tests. There’s a lot of js test runners and libraries for controlling headless browsers out there already. But those are huge and the devtools protocol provides us with all we need: