From d2b5cf51c48af613167154f227d3c59be7c3905c Mon Sep 17 00:00:00 2001 From: Cat73 <1901803382@qq.com> Date: Mon, 30 Nov 2015 14:00:52 +0800 Subject: [PATCH] =?UTF-8?q?Hook=20=E4=BA=86=20set=20returnValue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- remove_web_limits.user.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/remove_web_limits.user.js b/remove_web_limits.user.js index cd96384..7594f74 100644 --- a/remove_web_limits.user.js +++ b/remove_web_limits.user.js @@ -20,10 +20,10 @@ // @updateURL https://cat7373.github.io/remove-web-limits/remove_web_limits.user.js // @author Cat73 -// @version 1.2.3 +// @version 1.2.4 // @license LGPLv3 -// @compatible chrome Chrome_46.0.2490.86 + TamperMonkey + 脚本_1.2.3 测试通过 +// @compatible chrome Chrome_46.0.2490.86 + TamperMonkey + 脚本_1.2.4 测试通过 // @compatible firefox Firefox_42.0 + GreaseMonkey + 脚本_1.2.1 测试通过 // @compatible opera Opera_33.0.1990.115 + TamperMonkey + 脚本_1.1.3 测试通过 // @compatible safari 未测试 @@ -154,6 +154,14 @@ function init() { Event_preventDefault.apply(this, arguments); } }; + + // Hook set returnValue + Event.prototype.__defineSetter__('returnValue', function() { + if(this.returnValue != true && eventNames.indexOf(this.type) >= 0) { + console.log(this); + this.returnValue = true; + } + }); console.debug('storageName:' + storageName);