查看网页代码,禁用右键、F12查看

xiaoxiao2021-02-28  117

chrome浏览器

1.Ctrl+Shift+I F12 右键+N 2.Ctrl+U 3.在网址前加 view-source:

禁用右键、F12查看代码的方式:

I

<script> document.oncontextmenu = function () { return false; }; document.onkeydown = function () { if (window.event && window.event.keyCode == 123) { event.keyCode = 0; event.returnValue = false; return false; } }; </script>

II

<script> function click(e) { if (document.all) { if (event.button == 2 || event.button == 3) { alert("1"); 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>
转载请注明原文地址: https://www.6miu.com/read-46647.html

最新回复(0)