Created
February 6, 2020 14:28
-
-
Save boarnoah/6c565bbfb0167e860b329325936c76b2 to your computer and use it in GitHub Desktop.
Adds back green url to google search results
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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