Are you sure you want to go to an external site to donate a monetary value?
WARNING: Some countries laws may supersede the payment processors policy such as the GDPR and PayPal. While it is highly appreciated to donate, please check with your countries privacy and identity laws regarding privacy of information first. Use at your utmost discretion.
I'm looking for a script which is relatively simple. I would like to copy a link text to clipboard, when pressing "Ctrl + c" when mouse cursor is hovering on a link, in Google Chrome. I would like to use Tampermonkey, and found this script, but does not work. Does anyone know how to do this?
Script found:
https://autohotkey.com/board/topic/111762-mouse-hover-copy-link/
// ==UserScript== // @name URL Copy When Hover // @namespace com.atnbueno.url-copy-when-hover // @include http://www.autohotkey.com/* // @require http://code.jquery.com/jquery-2.1.1.min.js // @version 0.1 // @grant GM_setClipboard // ==/UserScript== $(document).ready(function() { $("a").hover(function() { GM_setClipboard($(this).attr("href")); }); });
If you want to copy the URL’s href for the link while hovering the mouse over it, then try using the following code.
var $ = require('jquery');
$('body').on('mouseenter', 'a', function() {
updateStatusBarURL(this.href);
});
$('body').on('mouseleave', 'a', function() {
clearStatusBarURL();
});
For event delegation, you can use any library of your choice. However, it is recommended to use jQuery. Apart from that, you also need some logic to hover a mouse from one link to another. For that, you need to call updateStatusBarURL() function before calling clearStatusBarURL(). It will hide the status bar url even if you are hovering a link.