Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save boarnoah/6c565bbfb0167e860b329325936c76b2 to your computer and use it in GitHub Desktop.
Save boarnoah/6c565bbfb0167e860b329325936c76b2 to your computer and use it in GitHub Desktop.
Adds back green url to google search results
// ==UserScript==
// @name GoogleSearchShowURL
// @description Puts URL under search result in green (YK, like it used to)
// @version 1
// @grant none
// @include https://www.google.com/search*
// @run-at document-end
// ==/UserScript==
(function() {
"use strict";
let seachResults = document.getElementsByClassName("r");
for(let i = 0; i < seachResults.length; i++) {
let urlNode = seachResults.item(i).firstElementChild;
if (urlNode && urlNode.hasAttribute("href")){
let citeNode = document.createElement("cite");
citeNode.textContent = urlNode.href;
citeNode.style.color = "#006621";
seachResults.item(i).appendChild(document.createElement("div").appendChild(citeNode), seachResults.item(i).nextElementSibling)
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment