Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. function copyToClipboard() {
  2. / Create a "hidden" input
  3. var aux = document.createElement("input");
  4. // Assign it the value of the specified element
  5. aux.setAttribute("value", "Você não pode mais dar printscreen. Isto faz
  6. parte da nova medida de segurança do sistema.");
  7. // Append it to the body
  8. document.body.appendChild(aux);
  9. // Highlight its content
  10. aux.select();
  11. // Copy the highlighted text
  12. document.execCommand("copy");
  13. // Remove it from the body
  14. document.body.removeChild(aux);
  15. alert("Print screen desabilitado.");
  16. }
  17.  
  18. $(window).keyup(function(e){
  19. if(e.keyCode == 44){
  20. copyToClipboard();
  21. }
  22. });
  23.  
  24. $(window).focus(function() {
  25. $("body").show();
  26. }).blur(function() {
  27. $("body").hide();
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement