I'm trying to set up some specs against a real (not headless) browser but some of the javascript on the target page only runs if the browser is visible (it doesn't need to be the active app). I've been perusing the W3C Page Visibility API docs and [MDN's] too but I can't see a way to manipulate the setting while running Watir.
I know there's the option of running the spec on a headless machine but while I'm developing the specs it'd be handy to not have to switch back and forth between browser and terminal to avoid timeouts and failures. I've had a look for Chrome switches that might help and found this very helpful list but it doesn't appear to have the magic bullet either.
I've also tried browser.execute_script('document.hidden = false');
but that had no effect.
Any help or insight would be much appreciated.