API: Window.isDevToolsOpen

Query the status of devtools window