Facebook Title Monitor

Keeps the browser's title bar to 'Facebook', removing notification clutter.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Facebook Title Monitor
// @namespace   ca.chrisdouglas.fbtitlemon
// @version     2019.01.28
// @description Keeps the browser's title bar to 'Facebook', removing notification clutter.
// @author      chrisgdouglas
// @license     MIT
// @include     http*://*facebook.com*
// @grant       none
// ==/UserScript==
(() => {
    "use strict";
    let targetNode = document.querySelector('title');
    let config = { childList: true, subtree: true };
    let titleMon = function (mutationsList, observer) {
        let fbTitle = "Facebook";
        for (let mutation of mutationsList) {
            if (mutation.type === 'childList' && targetNode.innerHTML !== fbTitle) {
                targetNode.firstChild.textContent = fbTitle;
            }
        }
    };
    let observer = new MutationObserver(titleMon);
    observer.observe(targetNode, config);
}) ();