Closed
Bug 1489824
Opened 8 years ago
Closed 2 years ago
window.close() should work for non-script-created window whose session history contains only one Document
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
RESOLVED
DUPLICATE
of bug 1353466
People
(Reporter: foolip, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36
Steps to reproduce:
Download testcase.html from https://bugs.chromium.org/p/chromium/issues/detail?id=170757#c3 and index.html from https://bugs.chromium.org/p/chromium/issues/detail?id=170757#c14
Open index.html, right click the link, and open it in a new tab.
Actual results:
Nothing happens and the console says "Scripts may not close windows that were not opened by script."
Expected results:
This is the spec:
https://html.spec.whatwg.org/multipage/window-object.html#dom-window-close
https://html.spec.whatwg.org/multipage/window-object.html#script-closable
The condition "a top-level browsing context whose session history contains only one Document" means that this tab should be closed, but it is not. In Chrome and Safari it is closed.
| Reporter | ||
Comment 1•8 years ago
|
||
Equivalent Edge bug: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/18937995/
Comment 2•8 years ago
|
||
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0 (20180912100128)
I've tested this report on Windows 10 x64 and OS X 10.13 using the latest Nightly and Fx release build. I was able to reproduce the mentioned behavior using the provided testcase.html and index.html files. When select "Open Link in New Tab" from the context menu, the new tab is not closed and the console says: "Scripts may not close windows that were not opened by script.". As mentioned in Chrome and Safari the new tab is closed.
Status: UNCONFIRMED → NEW
status-firefox62:
--- → affected
status-firefox63:
--- → affected
status-firefox64:
--- → affected
Component: Untriaged → DOM: Core & HTML
Ever confirmed: true
OS: Unspecified → All
Product: Firefox → Core
Updated•8 years ago
|
Priority: -- → P3
Updated•4 years ago
|
Severity: normal → S3
Updated•2 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•