
收集些通过JS禁止页面F12键和右键操作控制台
1、禁止鼠标点击事件
document.onmousedown = function mdClick(event) {
var e = event || window.event || arguments.callee.caller.arguments[0];
if (e.button == 2 || e.button == 3) {
return false;
}
};2、禁止浏览器默认右键菜单操作
document.oncontextmenu = new Function("return false;");3、监听键盘F12键操作
document.onkeydown = document.onkeyup = document.onkeypress = function(event) {
var e = event || window.event || arguments.callee.caller.arguments[0];
if (e && e.keyCode == 123) {
e.returnValue = false;
return (false);
}
}3、禁止f12及右键
<script>
document.onkeydown=function(){
var e = window.event||arguments[0];
if(e.keyCode==123){
alert('邦盾营销-互联网营销服务商,咨询微信:goodung');
return false;
}else if((e.ctrlKey)&&(e.shiftKey)&&(e.keyCode==73)){
alert('邦盾营销-互联网营销服务商,咨询微信:goodung');
return false;
}else if((e.ctrlKey)&&(e.keyCode==85)){
alert('邦盾营销-互联网营销服务商,咨询微信:goodung');
return false;
}else if((e.ctrlKey)&&(e.keyCode==83)){
alert('邦盾营销-互联网营销服务商,咨询微信:goodung');
return false;
}}document.oncontextmenu=function(){
alert('邦盾营销-互联网营销服务商,咨询微信:goodung');
return false;
}</script>以上方式对于大部分浏览器适用,不过也不是万能,具体以实际使用为主。