Original source: http://blog.csdn.net/cjz_huateng/article/details/9622533
/** Shielding F1 Help */
Window.onhelp = function () {return false;}
/**
* Shielded F5, CTRL + N, SHIFT+F10, ALT+F4
* If you want to block other keys, find the corresponding KeyCode and follow this method
*/
Document.onkeydown = function (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;
}
}
/** Shield right mouse button */
Document.oncontextmenu = function () {return false;}
Or
Document.onmousedown = function (event) {
event = Window.event | | Event
if (document.all && Event.button = = 2) {
Event.returnvalue=false;
}
}
/**
* Shielded "back" function (<a href= "javascript:replacelocation (' http://www.google.com ')" mce_href= "Javascript:replacelocation ( ' http://www.google.com ') ">Google</a>)
* @param URL page to turn to
*/
function replacelocation (URL) {
Document.location.replace (URL);
}
/** Blocking selected Web content */
Document.onselectstart=function () {return false;}
/** screen Copy Web content * *
Document.body.oncopy = function () {return false;}
/** Shielding Cut Web content * *
Document.body.oncut = function () {return false;}
/** screen paste content to Web page */
Document.body.onpaste = function () {return false;}
/** Shielded copy screen (keep clearing the Clipboard) */
Window.setinterval (' Window.clipboarddata ' ("Text", "") ', 100);
/**
* Shielded View Source file (<body onload=clear () >)
*/
function Clear () {
var source=document.body.firstchild.data;
Document.open ();
Document.close ();
Document.body.innerHTML = source;
}
/**
* Block JS Error
*/
function Killerror ()
{
return true;
}
Window.onerror=killerror;