// ==UserScript==
// @name Tab Title Keeper
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Prevents the tab title from changing.
// @author hacker09
// @match *
// @grant none
// @run-at document-body
// ==/UserScript==
(function() {
'use strict';
const title = document.title;
setInterval(function () { document.title = title; }, 1000);
})();
That just makes it blink faster.
Share an example website.
// ==UserScript== // @name Tab Title Keeper // @namespace hoothin // @version 0.1 // @description Prevents the tab title from changing. // @author hoothin // @match * // @grant none // @run-at document-body // ==/UserScript== (function() { 'use strict'; const title = document.title; Object.defineProperty(document, 'title', { get: function() {return title}, set: function() {} }); })();
@hacker09 Any social media/blogging site, literally every streaming service, most news website, and lots of others.
@hoothin I use greasemonkey and the <<@match *>> line was causing problems, so I used <<@include *>> instead.
That at least doesn't make the title change more, but it still changes.
Maybe this is executed too late ?(like some interval is already going on)
Or too early ?(like if the set property is redefined later)
Is there no way to just force every script to go through a regex replace before they get executed?
Try document-start then
Yeah, I tried all the run-at options. Does it work for you?
Many websites have a title that changes.
Think social media that adds a (1) to the title when you get a message, or any website with ads that make the title blink to catch your attention.
That's insufferable.
I've tried using foxreplace to cancel any changes to the title (deleting any <<([_a-z][a-z0-9_\s]*\.\s*)*document\s*.\s*title\s*=>> within page source) but it works too 'late' wrt to the page loading.
Would that be doable through a user script?
Foxreplace's dev recommended I use one through greasemonkey using the run-at property to execute it at the earliest, but I don't know how to code in js.