Ask coding questions

← Back to all posts
How do I make it close the window in a script
IL2PG2021 (18)

In index.html you see window.close() ? That does not work, how do I make it close the window on command

InvisibleOne (2681)

Like notGilbert said, you can't close a window in js unless you first trick it into thinking it opened the window. You can read more about it here:

notGilbert (92)

Unless the window is opened by a, it is not possible to close the window through JavaScript,

maybe blank the screen or show a not authorized message?


@notGilbert mk ty for suggestion