Last active
March 21, 2018 14:01
-
-
Save jdeblese/720272e21d63abc72a9066fbba39f011 to your computer and use it in GitHub Desktop.
Improve the layout of the new (2018) Google finance page, by removing redundant information and extraneous whitespace
This file contains hidden or 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 Fix Google Finance | |
// @namespace http://www.thescrapyard.org | |
// @version 0.1 | |
// @description Clean up the new Google finance page | |
// @author Jan-willem De Bleser | |
// @match https://www.google.com/search* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function remove(e) { | |
e.parentElement.removeChild(e); | |
return 1; | |
} | |
function clean() { | |
// Remove the useless "Following" tag | |
Array.from(document.getElementsByClassName('bOIDZc')).forEach(e => remove(e)); // Remove following tags | |
// Change padding around stocks | |
Array.from(document.getElementsByClassName('bm7Wje')).forEach(e => e.setAttribute('style', 'padding: 8px')); | |
// Expand the stock list | |
document.getElementsByClassName('uFowje')[0].click(); | |
} | |
setInterval(clean, 1000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment