window.close() => "Scripts may close only the windows that were opened by it." & Outlook behavior
I have a link in my webpage to close window in javascript : <a href="#" onclick="window.close()">Close the window</a> But when I click it, I have this error in console : Scripts may close only the windows that were opened by it. I have done a search on google, and now, I know why. This is the normal behavior (for security reasons I think). But when I send the link of my page via Outlook, and then, I click to close the page : It works ! Why ???
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.