Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var URL;
- $(document).ready(function() {
- console.log('"URL Copy When Hover" ready');
- $("a").hover(function() {
- // var URL = $(this).attr("href");
- URL = (this.href);
- // GM_setClipboard(URL);
- //console.log('"'+URL+'" fuuuuck');
- document.body.addEventListener("keydown",function(e){
- e = e || window.event;
- var key = e.which || e.keyCode; // keyCode detection
- var ctrl = e.ctrlKey ? e.ctrlKey : ((key === 17) ? true : false); // ctrl detection
- if ( key == 86 && ctrl ) {
- console.log("Ctrl + V Pressed !");
- } else if ( key == 67 && ctrl ) {
- console.log("Ctrl + C Pressed !");
- // URL = (this.href);
- GM_setClipboard(URL);
- console.log('"'+URL+'" copied to clipboard');
- }
- },false);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement