<script> function isDevModel() { // 阻止F12 , Ctrl+Shift+I document.addEventListener('keydown', function (event) { if ((event.ctrlKey && event.shiftKey && event.keyCode == 73) || event.keyCode == 123) { event.preventDefault(); } }); // 阻止右键 document.addEventListener('contextmenu', function (e) { e.preventDefault(); }); // 开发者模式 if(typeof console !== 'undefined' && console.log instanceof Function){ console.log("处于开发者模式"); return true } } </script>
标签:function,console,右键,&&,F12,浏览器,event From: https://www.cnblogs.com/wujindong/p/18162634