Not able to close browser window through JavaScript
Reported by
gandhira...@gmail.com,
May 15 2018
|
||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0 Steps to reproduce the problem: We have a application that opens a new window on login, we want to close the initial window through JavaScript after login. Sample code is attached What is the expected behavior? Expect to close the initial application window through JavaScript What went wrong? Not able to close the initial application window through JavaScript Did this work before? N/A Chrome version: 66.0.3359.170 Channel: stable OS Version: Windows 7 Professional SP1 Flash Version: Sample code attached to simulate the scenario
,
May 15 2018
Sorry, this is by design to prevent abuse. Notice the devtools console says: "Scripts may close only the windows that were opened by it." Firefox behaves the same, and says: "Scripts may not close windows that were not opened by script." I believe this is required by the HTML spec: https://html.spec.whatwg.org/multipage/window-object.html#dom-window-close |
||
►
Sign in to add a comment |
||
Comment 1 by viswa.karala@chromium.org
, May 15 2018