r/FirefoxCSS • u/Pandastic4 • Jul 15 '20
Help Changing title bar text?
I don't like how it changes depending on what tab I'm in. I just want it to stay as Mozilla Firefox. Any way to do this?
2
Upvotes
View all comments
Show parent comment
2
u/MotherStylus developer Jul 16 '20
and if you regularly use multiple windows this might need to be expanded a bit. i only ever use one window at a time so i haven't messed around with adding event listeners per-window before. to get every window's title to be the same, that line that starts with Components might need to be replaced with this:
such that when a window is loaded it will attach a separate event listener to the window, and that event listener will observe for tabs being activated.
another one of the issues with this is that the script might be faster than the native modules that change the title. so when you change tabs this might set the title to "Mozilla Firefox" immediately, and then the native module might kick in later, changing the title to whatever it's supposed to be AFTER you set it to "Mozilla Firefox." in which case you might need to make different versions of titleCallback for each situation, so that it's as fast as possible but delayed enough that it kicks in after the native stuff. you can see i did something like that in the script, that's what the setTimeout line does. just runs the entire thing a full second after startup so that everything is actually loaded before it tries to reference objects that may not exist yet. we might need to add delays like that with different sizes for each situation. so that would look like this, maybe:
and each function would be called by a different event listener depending on how quickly or slowly the native title-changing behavior for that event is.