殷德瑶博客
喜欢的歌,静静地听!喜欢的人,远远地看!

禁用各种网页限制,包含右键,复制,选择文字。

殷德瑶 2016-5-27 网络技术 评论 3235 次
// ==UserScript==
// @name            Anti Disabler For All
// @description     禁用各种网页限制,包含右键,复制,选择文字。
// @namespace   b8a2c97204b09fc19cf99340f5fae276
// @include         *
// @exclude         http*://mail.google.com/*
// @exclude         http://maps.google.com/*
// @author          ejin
// @version         2013.09.08
// ==/UserScript==
 
function restore(){
with (document.wrappedJSObject || document) {
onmouseup = null;
onmousedown = null;
oncontextmenu = null;
 
// *
onselectstart = null
onbeforecopy = null
onkeydown = null
onkeydown = null
 
}
 
// *
void(document.body.onmouseup='');
void(document.body.onselectstart='');
void(document.body.onmouseup='');
void(document.body.oncopy='');
 
var arAllElements = document.getElementsByTagName('*');
for (var i = arAllElements.length - 1; i >= 0; i--) {
var elmOne = arAllElements[i];
with (elmOne.wrappedJSObject || elmOne) {
onmouseup = null;
onmousedown = null;
}
}
}
 
window.addEventListener('load',restore,true);
 
function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}
 
addGlobalStyle("html, * {-moz-user-select:text!important;}");

发表评论


粤ICP备15078261号 Powered by 黑暗之夜
Theme by 殷德瑶博客