0

i want to prevent print screen in my website. i used but its not working in chrome and mozillafirefox

$(document).keyup(function(e){
    if(!e) e = window.event;
    var keyCode = e.which || e.keyCode; 
    if (keyCode  == 44) {
       if(window.clipboardData) {       
         window.clipboardData.setData('text', '');        
       }
    }

});

Thank you

  • 3
    What makes you think clients would allow you to prevent them from printing the screen if they want so? – Oriol Dec 08 '16 at 07:00
  • There are few times when you should be doing anything but *optimizing for* the use of printscreen. Someone has found your content valuable enough that they want a hard copy; that's a compliment. – gyre Dec 08 '16 at 08:53

1 Answers1

1

There are keystrokes you can't capture on many operating system/browser combinations. PrintScreen is very, very likely to be one of them.

You just can't do this. If your site can be displayed in a browser, screenshots can be taken of it (also copies of it can be stored locally and manipulated, the content can be scraped via non-browser technologies, etc., etc.).

T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
  • Reminds me on those old useless 'do not copy my source-code' alerts on right clicks. Hilarious :) – Lain Dec 08 '16 at 08:51