Skip to content

Instantly share code, notes, and snippets.

@jdeblese
Last active January 16, 2020 17:34
Show Gist options
  • Save jdeblese/0ef74026dfd3adb7c0d383409d8474ae to your computer and use it in GitHub Desktop.
Save jdeblese/0ef74026dfd3adb7c0d383409d8474ae to your computer and use it in GitHub Desktop.
This fixes Google's counterproductive changes to the search results page by removing the favicons and nav and adding the actual URL back in. Also reduces whitespace.
// ==UserScript==
// @name Remove favicons from and restore URLs to google search
// @version 2
// @grant none
// @match https://www.google.com/search*
// ==/UserScript==
// Hide favicons and nav
['TbwUpd', 'B6fmyf'].map(function(c){Array.from(document.getElementsByClassName(c)).map(function(e){e.style.display='none';});});
// Add URLs
Array.from(document.getElementsByClassName('LC20lb')).map(function(e){e.parentElement.appendChild(document.createElement('div')).appendChild(document.createTextNode(e.parentElement['href']));});
// Remove BR
Array.from(document.getElementsByClassName('LC20lb')).map(function(e){e.previousSibling.style.display='none';});
// Shrink lower padding
Array.from(document.getElementsByClassName('g')).map(function(e){e.style.marginBottom='15px';});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment