Greasy Fork

Greasy Fork is available in English.

Market Watch chrome tab tickers

Stop me from switching tabs all the time by showing the ticker values in the window title.

// ==UserScript==
// @name         Market Watch chrome tab tickers
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Stop me from switching tabs all the time by showing the ticker values in the window title.
// @author       LlamaFarmer
// @match        https://www.marketwatch.com/investing/stock/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var ticker = document.title.split(' ')[0]
    function showMeTheMoves() {
        var price = $('h3.intraday__price').text().replace(/( |\n)/g,'');
        document.title = ticker + ": " + price;
    }
    var ticktock = window.setInterval(showMeTheMoves, 5000);

    // Your code here...
})();