Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==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, "");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement