本文主要是介绍网页禁止F12,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
如果你的网页不想让别人看到代码,可以使用以下方法?
function fuckyou(){window.close(); //关闭当前窗口(防抽)swindow.location="about:blank"; //将当前窗口跳转置空白页}function click(e) {if (document.all) {if (event.button==2||event.button==3) {alert("欢迎光临寒舍?,有什么需要帮忙?的话,请小生联系!?");oncontextmenu='return false';}}if (document.layers) {if (e.which == 3) {oncontextmenu='return false';}}}if (document.layers) {fuckyou();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) {fuckyou();window.event.returnValue=false;return(false);}}
这篇关于网页禁止F12的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!