diff --git a/WebIDE/enhance.user.js b/WebIDE/enhance.user.js index e8befd4..f54b3a8 100644 --- a/WebIDE/enhance.user.js +++ b/WebIDE/enhance.user.js @@ -13,7 +13,7 @@ 'use strict'; var id = setInterval(function (){ if (document.getElementsByClassName('ide-container')[0]) { - document.onbeforeunload = function () { return false; } + window.onbeforeunload = function () { return false; } console.log('已阻止 Ctrl + W 关闭页面...') clearInterval(id); }