Open JeffryBooher opened 10 years ago
This happens on Mac as well (removed Win Only label). This probably shouldn't be marked "tracking" because we don't know if this is a bug in Chrome (or if anyone has filed a bug against Chrome).
Medium priority to @redmunds to investigate. Randy: if this looks like it's going to be a bunch of work to fix or isn't just a bug in Chrome that we can file, please put a comment here and mark "needs review".
This behavior is likely to change in the future because of the live preview work that's currently going on. (We can't close the window with our new live preview technique of a normal "content script" vs. privileged API access)
I haven't done a thorough overview of this, but you could natively close a browser window via javascript if you had, for example, a helper extension on the browser that opened a test window via window.open() or similar, since that window could then be closed by the script (background.js or similar on Chrome)
@emanb29 Yep, we've thought of the helper extension as a possibility for optional features in the new Live Preview.
It looks like we currently use this trick to close the window: Inspector.Runtime.evaluate("window.open('', '_self').close();")
(see LiveDevelopment._doInspectorDisconnect()
). Chrome must be blocking that now.
I wonder if the remote debugging API itself gives any way to close tabs?
@peterflynn This StackOverflow post approves your assumption. It also points out the Extension API method to close the window. I wonder if we can use it too.
@MarcelGerber that would of course require access to the extension API, which requires an extension.... Which has already been reviewed (and I believe discarded) as a possibility (at least that's the impression I got from Mr Dangoor)
The Chrome extensibility API is a lot bigger than the remote debugging API. I didn't see anything in the remote debugging API that looks like it would give us this...
The live preview work that's underway to make live preview work cross-browser would require the help of an extension in order to close the tab as well, due to the browser permissions model.
In other words, fixing this using the inspector protocol would likely be a temporary fix anyhow...
Yep...
Install Chrome Version 36.0.1985.49 beta-m Launch release 0.40 Open sample project launch live prev ==> chrome launches with live dev profile File > Live Preview to close Chrome with live dev profile doesn't close [ Tested Windows Only ]