每次我嘗試使用時window.close();都會出現錯誤Scripts may only close the windows that were opened by them,有什么辦法可以繞過這個嗎?
uj5u.com熱心網友回復:
好像不是。
請參閱檔案:
此方法只能在使用該
Window.open()方法的腳本打開的視窗上呼叫。如果視窗不是由腳本打開的,控制臺中會出現與此類似的錯誤:腳本可能不會關閉不是由腳本打開的視窗。
另請參閱window.close 和 self.close 不要關閉 Chrome 中的視窗。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/383570.html
標籤:javascript 窗口关闭
