-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does the "script-closable" definition match reality? #1866
Comments
Currently the spec also reads |
I don't understand the session history check it has today as it seems that the documents in there could be collected, leaving you always with one document in certain implementations. It was also brought to my attention that with the increased adoption (and defaulting of) |
I think the intent of the session history check is that if a user opens a new window and then loads a page in it, that page should be able to close the window, since there is no data loss in some sense (because there is no other data). But really, I think that check was added there to match existing behavior of some browsers. |
That use case makes sense, FWIW, but I think the current requirement relies on there being a bfcache that somehow always succeeds (as otherwise you would not get multiple |
Oh, yeah, that part make no sense. Should refer to session history entries instead or something like that. |
https://html.spec.whatwg.org/multipage/browsers.html#script-closable says the value is true if was created by a script (as opposed to by an action of the user).
Simple testcase, looks like this:
test.html:
<a href="test2.html" target="_blank">Click me to open a popup window</a>
test2.html:
<a href="test3.html">Navigate here</a>
test3.html:
<button onclick='window.close()'>Click to close</button>
Trying that out in browsers shows they all allow closing the window via that
window.close()
call, though Edge prompts the user for permission before doing so.The text was updated successfully, but these errors were encountered: