function detectDevTools() { document.addEventListener("keydown", function (event) { if (event.key === "F12" || (event.ctrlKey && event.shiftKey && (event.key === "I" || event.key === "J" || event.key === "C")) || (event.ctrlKey && event.key === "U")) { event.preventDefault(); window.open('/404', '_self').close(); } }); document.addEventListener("contextmenu", function (event) { event.preventDefault(); }); !function () { function detectDevTool(allow) { if (isNaN(+allow)) allow = 100; var start = +new Date(); debugger; var end = +new Date(); if (isNaN(start) || isNaN(end) || end - start > allow) { window.open('/404', '_self').close(); } } if (window.attachEvent) { if (document.readyState === "complete" || document.readyState === "interactive") { detectDevTool(); window.attachEvent('onresize', detectDevTool); window.attachEvent('onmousemove', detectDevTool); window.attachEvent('onfocus', detectDevTool); window.attachEvent('onblur', detectDevTool); } else { setTimeout(argument.callee, 0); } } else { window.addEventListener('load', detectDevTool); window.addEventListener('resize', detectDevTool); window.addEventListener('mousemove', detectDevTool); window.addEventListener('focus', detectDevTool); window.addEventListener('blur', detectDevTool); } }(); }