Greasy Fork is available in English.
True URLs displayed and highlighted on Google
当前为
// ==UserScript==
// @name FGD
// @version 0.1
// @description True URLs displayed and highlighted on Google
// @author Cristo
// @include *://www.google.*/*
// @copyright 2012+, You
// @namespace http://greasyfork.icu/users/1973
// ==/UserScript==
document.onload = loaded();
document.addEventListener("DOMNodeInserted", check, false);
function check(e) {
if (e.target.getAttribute('data-async-context')){
loaded();
}}
function loaded(){
var page = document.getElementById("ires");
var linkPac = page.getElementsByClassName("rc");
for (var g = 0; g < linkPac.length; g++){
var aTag = linkPac[g].getElementsByClassName("r")[0].firstChild;
var but = document.createElement("p");
but.setAttribute("class","rangy");
but.innerHTML = aTag.href;
linkPac[g].parentNode.insertBefore(but, linkPac[g].nextSibling);
}
var siteP = document.getElementsByClassName("rangy");
for (var p = 0; p < siteP.length; p++){
siteP[p].addEventListener("mouseover", overit, false);
}
function overit(){
var selection = window.getSelection();
var range = document.createRange();
range.selectNodeContents(this);
selection.removeAllRanges();
selection.addRange(range);
}
}