在任意网页添加如下JS代码,就可以防止用户使用鼠标左键及快捷键审查元素了!当然,不能完全防止! <script type="text/javascript"> function click(e) { if (document.all) { if (event.button==2||event.button==3) { alert("支持正版!!!有需求请与魔趣吧www.moqu8.com联系,谢谢您的合作!!!"); oncontextmenu='return false'; } } if (document.layers) { if (e.which == 3) { oncontextmenu='return false'; } } } if (document.layers) { document.captureEvents(Event.MOUSEDOWN); } document.onmousedown=click; document.oncontextmenu = new Function("return false;") document.onkeydown =document.onkeyup = document.onkeypress=function(){ if(window.event.keyCode == 123) { window.event.returnValue=false; return(false); } } </script> |