Koodilistaus:URL in Tooltip.js

Mummilan wikistä
Versio hetkellä 6. tammikuuta 2021 kello 14.35 – tehnyt Jani Uusitalo (keskustelu | muokkaukset) (Tekstin korvaus – ”<metadesc>(.*)<\/metadesc>” muotoon ”{{#description2:$1}}”)
(ero) ← Vanhempi versio | Nykyinen versio (ero) | Uudempi versio → (ero)

Download: [{{#file: URL in Tooltip.js}} URL in Tooltip.js]

This is a Greasemonkey JS snippet to show the URL of links in tooltips (instead of what's set by the title attribute). I take no credit for this, as I just c&p'd it from a thread over at Mozilla forums.

{{#fileanchor: URL in Tooltip.js}}

// ==UserScript==
// @name           URL in Tooltip
// @namespace      mariginari
// @description    Show link url in tooltip
// @include        http*
// ==/UserScript==

(function(){
var e=document.getElementsByTagName('a');
for(var i=0;e[i];i++){ e[i].setAttribute('title',e[i].href); }
})()