4 ms·
That only works for popup windows (ones created with `window.open()`) [0]. From MDN: > This method can only be called on windows that were opened by a script
by abdusco 5y ago
That only works for popup windows (ones created with `window.open()`) [0].
From MDN:
> This method can only be called on windows that were opened by a script using the Window.open() method.
I was unable to get `window.close()` to work on root windows, but your comment prompted me research it again. This seems to work:
window.close('','_parent','')
[0]: https://developer.mozilla.org/en-US/docs/Web/API/Window/close https://developer.mozilla.org/en-US/docs/Web/API/Window/clos...