Skip to content

Instantly share code, notes, and snippets.

@bertolo1988
Last active September 14, 2017 15:16
Show Gist options
  • Save bertolo1988/3412ca383c7351829fb70b184e093cac to your computer and use it in GitHub Desktop.
Save bertolo1988/3412ca383c7351829fb70b184e093cac to your computer and use it in GitHub Desktop.
How to get Ethereum price on the title of a Coinbase.com tab
/*
Unable to find a chrome extension to display ethereum price
on my browser in EUROS, i decided to make a small script to
set the tab title with it every 2 seconds
All you need to do to use this script is to paste it in
your browser console.
*/
window.setInterval(function() {
// This class selects the prices elements. This might need to be changed.
// In order to adjust this css class inspect the element that displays the
// actual price. To do that in chrome just use CTRL+SHIFT+C and click
// on the price. Extract the first css class of that div.
var pricesElementClass = 'PriceChart__HeadingPrice-iOthZP';
// This will create an array with all the prices
var pricesHTMLElements = document.getElementsByClassName(pricesElementClass);
var bitcoinPrice = pricesHTMLElements[0].innerText
var ethereumPrice = pricesHTMLElements[1].innerText
// set the title
document.title = ethereumPrice;
}, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment