网页前端:需要点击网页中关闭按钮将当前网页关闭,但现在点击链接打开可以自动关闭但是输入网址打开却不能

https://developer.mozilla.org/en-US/docs/Web/API/Window/closeThis 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, the following error appears in the JavaScript Console:Scripts may not close windows that were not opened by script.


    推荐阅读