Rename Tab Title 的評論
Rename Tab Title 作者: Anush Veeranala
Firefox 使用者 10122440 所留下的評論
評價 4 分,滿分 5 分
來自 Firefox 使用者 10122440,7 年前Hey, I might've found a solution for dynamically updated titles. The following code listens for changes of the 'document.title' object and allows you to execute code when it changes. I would send a PR, but it doesn't seem that you're on any public VCS platform.
new MutationObserver(function(mutations) {
console.log(mutations);
// overwrite the title here
}).observe(
document.querySelector('title'),
{
subtree: true,
characterData: true,
childList: true
}
);
new MutationObserver(function(mutations) {
console.log(mutations);
// overwrite the title here
}).observe(
document.querySelector('title'),
{
subtree: true,
characterData: true,
childList: true
}
);