Skip to content

Commit

Permalink
增加了一种通过CSS禁止选中的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
Cat7373 committed Nov 23, 2015
1 parent 7c683ef commit c17f57c
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions Remove_web_limits.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
// @supportURL https://github.com/Cat7373/remove-web-limits/issues/
// @installURL https://github.com/Cat7373/remove-web-limits/raw/master/Remove_web_limits.user.js
// @author Cat73
// @version 1.0
// @version 1.1
// @license LGPLv3
// @compatible firefox, chrome, opera, safari
// @compatible chrome, firefox, opera, safari
// @include http://*
// @include https://*
// @match *://*/*
Expand Down Expand Up @@ -42,10 +42,6 @@
elements2[elements2.length] = document;
return elements2;
}

// 将 addEventListener 重定义位置
HTMLElement.prototype._addEventListener = HTMLElement.prototype.addEventListener;
document._addEventListener = document.addEventListener;

// 清理限制函数
function clear() {
Expand All @@ -64,8 +60,23 @@
}
}

// 初始化
// 添加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);
}

// 将 addEventListener 重定义位置
HTMLElement.prototype._addEventListener = HTMLElement.prototype.addEventListener;
document._addEventListener = document.addEventListener;

// 调用清理函数
setInterval(clear, 5000);
window.addEventListener('load', clear, true);
clear();

addStyle("html, * {-webkit-user-select:text!important; -moz-user-select:text!important;}");
}("contextmenu|select|selectstart|copy|cut|dragstart".split("|"));

0 comments on commit c17f57c

Please sign in to comment.