Jump to content
  • 0

Display a message then close the DataPage.


HampasLOUpa

Question

1 answer to this question

Recommended Posts

  • 0


I found out that as of 2017, there is no way to close a web browser tab or window using JavaScript. Modern security standards do not permit this behavior.

The Window.close() method closes the current window, or the window on which it was called.

This method is only allowed to be called for 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.

You can check this website for reference:
https://www.computerhope.com/issues/ch000178.htm
https://developer.mozilla.org/en-US/docs/Web/API/Window/close

I hope this helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...