Each time I try to use window.close();
I just get the error Scripts may only close the windows that were opened by them
, is there any way to bypass this?
Asked
Active
Viewed 594 times
1

DiamondUp
- 21
- 5
1 Answers
1
Looks like it’s not.
See the documentation:
This method can only be called on windows that were opened by a script using the
Window.open()
method. If the window was not opened by a script, an error similar to this one appears in the console: Scripts may not close windows that were not opened by script.
See also window.close and self.close do not close the window in Chrome.

Sebastian Simon
- 18,263
- 7
- 55
- 75

Alt Zh
- 59
- 3
-
https://stackoverflow.com/questions/19761241/window-close-and-self-close-do-not-close-the-window-in-chrome/19768082#19768082 – Alt Zh Dec 17 '21 at 12:28