Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. var URL;
  2. $(document).ready(function() {
  3. console.log('"URL Copy When Hover" ready');
  4. $("a").hover(function() {
  5. // var URL = $(this).attr("href");
  6.  
  7. URL = (this.href);
  8. // GM_setClipboard(URL);
  9. //console.log('"'+URL+'" fuuuuck');
  10.  
  11.  
  12. document.body.addEventListener("keydown",function(e){
  13. e = e || window.event;
  14. var key = e.which || e.keyCode; // keyCode detection
  15. var ctrl = e.ctrlKey ? e.ctrlKey : ((key === 17) ? true : false); // ctrl detection
  16.  
  17. if ( key == 86 && ctrl ) {
  18. console.log("Ctrl + V Pressed !");
  19. } else if ( key == 67 && ctrl ) {
  20. console.log("Ctrl + C Pressed !");
  21. // URL = (this.href);
  22. GM_setClipboard(URL);
  23. console.log('"'+URL+'" copied to clipboard');
  24. }
  25.  
  26. },false);
  27. });
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement