IPS Education Disable right click and ctrl + i

power30

Registered
When you work on a custom theme and you create something new, everyone will try to steal it, this code is block right click and ctrl + i ( keyboard code to open inspect element ). With this code you can protect your work for a while.

Add the code in „globaltemplate” between the „head” codes :

<script language="JavaScript"> /** * Disable right-click of mouse, F12 key, and save key combinations on page * By Arthur Gareginyan ([email protected]) * For full source code, visit https://mycyberuniverse.com */ window.onload = function() { document.addEventListener("contextmenu", function(e){ e.preventDefault(); }, false); document.addEventListener("keydown", function(e) { //document.onkeydown = function(e) { // "I" key if (e.ctrlKey && e.shiftKey && e.keyCode == 73) { disabledEvent(e); } // "J" key if (e.ctrlKey && e.shiftKey && e.keyCode == 74) { disabledEvent(e); } // "S" key + macOS if (e.keyCode == 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)) { disabledEvent(e); } // "U" key if (e.ctrlKey && e.keyCode == 85) { disabledEvent(e); } // "F12" key if (event.keyCode == 123) { disabledEvent(e); } }, false); function disabledEvent(e){ if (e.stopPropagation){ e.stopPropagation(); } else if (window.event){ window.event.cancelBubble = true; } e.preventDefault(); return false; } }; </script
 
Top