Skip to content

Instantly share code, notes, and snippets.

@SukkaW
Last active September 25, 2019 17:51
Show Gist options
  • Save SukkaW/26dc57f3bf3d7f17a89763dcd9f7d3a1 to your computer and use it in GitHub Desktop.
Save SukkaW/26dc57f3bf3d7f17a89763dcd9f7d3a1 to your computer and use it in GitHub Desktop.
Remove website restrictions
javascript:(function(){var doc=document,body=document.body;with(body.onselectstart=body.oncopy=body.onpaste=body.onkeydown=body.oncontextmenu=body.onmousemove=body.ondragstart=document.onselectstart=document.oncopy=document.onpaste=document.onkeydown=document.oncontextmenu=null,document.onselectstart=document.onkeydown=document.oncontextmenu=document.onmousedown=function(){return!0},document.wrappedJSObject||document)onmouseup=null,onmousedown=null,oncontextmenu=null;for(var arAllElements=document.getElementsByTagName("*"),i=arAllElements.length-1;i>=0;i--){var elmOne=arAllElements[i];with(elmOne.style.userSelect="initial",elmOne.style.pointerEvents="initial",elmOne.wrappedJSObject||elmOne)onmouseup=null,onmousedown=null}body.style.webkitUserSelect="auto!important",body.style.MozUserSelect="normal!important",alert("已经解除右键和复制限制!")})();
(function() {
var doc = document;
var body = document.body;
body.onselectstart = body.oncopy = body.onpaste = body.onkeydown = body.oncontextmenu = body.onmousemove = body.ondragstart = document.onselectstart = document.oncopy = document.onpaste = document.onkeydown = document.oncontextmenu = null;
document.onselectstart = document.onkeydown = document.oncontextmenu = document.onmousedown = function() {
return true;
};
with(document.wrappedJSObject || document) {
onmouseup = null;
onmousedown = null;
oncontextmenu = null;
};
var arAllElements = document.getElementsByTagName("*");
for (var i = arAllElements.length - 1; i >= 0; i--) {
var elmOne = arAllElements[i];
elmOne.style.userSelect = 'initial';
elmOne.style.pointerEvents = 'initial';
with(elmOne.wrappedJSObject || elmOne) {
onmouseup = null;
onmousedown = null;
}
};
body.style.webkitUserSelect = "auto!important";
body.style.MozUserSelect = "normal!important";
alert("已经解除右键和复制限制!");
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment