From 985351fdefce72f282f0c8a9cb814cc3c6bc3f99 Mon Sep 17 00:00:00 2001 From: Cat73 <1901803382@qq.com> Date: Thu, 26 Nov 2015 22:47:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=8A=B6=E6=80=81,=20=E4=BF=AE=E5=A4=8D=20Fi?= =?UTF-8?q?refox=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- remove_web_limits.user.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/remove_web_limits.user.js b/remove_web_limits.user.js index ff05968..25faa53 100644 --- a/remove_web_limits.user.js +++ b/remove_web_limits.user.js @@ -14,19 +14,18 @@ // @updateURL https://cat7373.github.io/remove-web-limits/remove_web_limits.user.js // @author Cat73 -// @version 1.1.2 +// @version 1.1.3 // @license LGPLv3 // @compatible chrome 完美支持 -// @compatible firefox 未测试 -// @compatible opera 未测试 +// @compatible firefox 完美支持 +// @compatible opera 完美支持 // @compatible safari 未测试 // @include http://* // @include https://* // @match *://*/* -// @grant GM_addStyle -// @grant GM_log +// @grant none // @run-at document-start // ==/UserScript== @@ -87,6 +86,15 @@ function getElements() { return elements2; } +// 添加css +function addStyle(css) { + var head = document.getElementsByTagName('head')[0]; + var style = document.createElement('style'); + style.type = 'text/css'; + style.innerHTML = css; + head.appendChild(style); +} + // 初始化 function init() { // hook addEventListener @@ -102,10 +110,10 @@ function init() { clearLoop(); // 添加CSS - GM_addStyle('html, * {-webkit-user-select:text!important; -moz-user-select:text!important;}'); + addStyle('html, * {-webkit-user-select:text!important; -moz-user-select:text!important;}'); // 输出原始 addEventListener 位置 - GM_log('原始 addEventListener 名称:' + addEventListenerName); + console.debug('原始 addEventListener 名称:' + addEventListenerName); } init();