Advertisement
leors

Protect HTML

Mar 23rd, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.52 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="pt-BR">
  3.     <head>
  4.     </head>
  5.     <body onselectstart="return false">
  6.         <script type="text/javascript">
  7.             //<![CDATA[
  8.             document.onkeypress = function(event) {
  9.                 event = (event || window.event);
  10.                 if (event.keyCode === 123) {
  11.                     //alert('No F-12');
  12.                     return false;
  13.                 }
  14.             };
  15.             document.onmousedown = function(event) {
  16.                 event = (event || window.event);
  17.                 if (event.keyCode === 123) {
  18.                     //alert('No F-keys');
  19.                     return false;
  20.                 }
  21.             };
  22.             document.onkeydown = function(event) {
  23.                 event = (event || window.event);
  24.                 if (event.keyCode === 123) {
  25.                     //alert('No F-keys');
  26.                     return false;
  27.                 }
  28.             };
  29.             function contentprotector() {
  30.                 return false;
  31.             }
  32.             function mousehandler(e) {
  33.                 var myevent = (isNS) ? e : event;
  34.                 var eventbutton = (isNS) ? myevent.which : myevent.button;
  35.                 if ((eventbutton === 2) || (eventbutton === 3))
  36.                     return false;
  37.             }
  38.             document.oncontextmenu = contentprotector;
  39.             document.onmouseup = contentprotector;
  40.             var isCtrl = false;
  41.             window.onkeyup = function(e)
  42.             {
  43.                 if (e.which === 17)
  44.                     isCtrl = false;
  45.             }
  46.             window.onkeydown = function(e)
  47.             {
  48.                 if (e.which === 17)
  49.                     isCtrl = true;
  50.                 if (((e.which === 85) || (e.which === 65) || (e.which === 80) || (e.which === 88) || (e.which === 67) || (e.which === 86) || (e.which === 83)) && isCtrl === true)
  51.                 {
  52.                     return false;
  53.                 }
  54.             }
  55.             isCtrl = false;
  56.             document.ondragstart = contentprotector;
  57.             //]]>
  58.         </script>
  59.     </body>
  60. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement