From 0e49b26996efa600432c318fc1d08cfae573aa3b Mon Sep 17 00:00:00 2001 From: 502647092 Date: Tue, 15 May 2018 17:49:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'WebIDE/enhance.user.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebIDE/enhance.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WebIDE/enhance.user.js b/WebIDE/enhance.user.js index a5fb3c9..eedc798 100644 --- a/WebIDE/enhance.user.js +++ b/WebIDE/enhance.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name WebIDE增强脚本 // @namespace http://ide.yumc.pw/ -// @version 0.3 +// @version 0.4 // @description Coding WebIDE 增强脚本 // @author MiaoWoo // @match http*://ide.yumc.pw/ws/* @@ -13,14 +13,14 @@ 'use strict'; var id = setInterval(function (){ if (document.getElementsByClassName('ide-container')[0]) { - window.onbeforeunload = function () { return false; } + document.onbeforeunload = function () { return false; } console.log('已阻止 Ctrl + W 关闭页面...') clearInterval(id); } }, 300) document.onkeydown = function() { - var oEvent = window.event; - if (oEvent.keyCode == 87 && oEvent.altKey) { + var e = window.event; + if (e.keyCode == 87 && e.altKey) { var activeTab = document.getElementsByClassName('tab-label active')[0]; if (activeTab) { activeTab.childNodes[2].childNodes[0].click();