This article introduces the application of the shielding in the next JS; screen content selected, cut, copied and screen in short, you can imagine that there should be, interested friends can refer to, I hope to learn more about JS help
JS Shielding effect
Copy Code code as follows:
/** Shielding F1 help */
Window.onhelp = function () {return false;}
/**
* Masks F5, CTRL + N, SHIFT+F10, ALT+F4
* If you want to block other keys, find the corresponding keycode and then follow this method
/
Document.onkeydown = Fun Ction (event) {
event = window.event | | | event;
if (event.keycode==116 | | (Event.ctrlkey && event.keycode==78) | | (Event.shiftkey && event.keycode==121) | | (Event.altkey && event.keycode==115)) {
Event.keycode = 0;
Event.returnvalue = false;
}
}
/** screen mouse right button/
Document.oncontextmenu = function () {return false;}
/or
Document.onmousedown = function (event) {
event = Window.event | | event;
if (document.all && Event.button = 2) {
Event.returnvalue=false;
}
}
/**
* Mask back function (<a href= javascript:replacelocation (' http://www.google.com ') "mce_href=" Javascript:replacelocation (' http://www.google.com ') ">Google</a>"
* @param url to the URL page to be turned to the URLs
* *
function replacelocation (URL) {
DOcument.location.replace (URL);
}
/** the contents of the selected Web page/
Document.onselectstart=function () {return false;}
/** screen copy of Web page content */
Document.body.oncopy = function () {return false;}
/** Screen Cut page content */
Document.body.oncut = function () {return false;}
/** screen paste content to Web page */
Document.body.onpaste = function () {return false;}
/** Shield screen (keep the clipboard empty)/
Window.setinterval (' Window.clipboarddata ("Text", "") ', 100);
/**
* Mask View source file (<body onload=clear () >)
/
Function Clear () {
var source=document.body.first Child.data;
Document.open ();
Document.close ();
Document.body.innerHTML = source;
}
/**
* Mask js error
/
function Killerror ()
{
return true;
}
Window.onerror=killerror;