// ==UserScript== // @name Tabs Title Fix // @namespace abu_pidor // @match *://*.youtube.com/* // @match *://*.spotify.com/* // @run-at document-start // ==/UserScript== "use strict"; let regex; switch (location.hostname.match(/[^.]+\.[^.]+$/)[0]) { case "youtube.com": regex = / - YouTube$/; break; case "spotify.com": regex = /^Spotify – /; break; } setInterval(() => document.title = cleanTitle(document.title, regex), 1000); function cleanTitle(title, regex) { return title.replace(regex, ""); }