Rename Tab Title 的评价
Rename Tab Title 作者: Anush Veeranala
Firefox 用户 10122440 的评价
评分 4 / 5
来自 Firefox 用户 10122440,6 年前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
}
);