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)

Unspecified
All
defect

Tracking

()

RESOLVED DUPLICATE of bug 1353466
Tracking Status
firefox62 --- affected
firefox63 --- affected
firefox64 --- affected

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.
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
Component: Untriaged → DOM: Core & HTML
Ever confirmed: true
OS: Unspecified → All
Product: Firefox → Core
Priority: -- → P3
Severity: normal → S3
Status: NEW → RESOLVED
Closed: 2 years ago
Duplicate of bug: 1353466
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.