Greasy Fork

Greasy Fork is available in English.

Title SFW

避免一些网页标题太过“炸裂”导致社死

当前为 2024-11-25 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Title SFW
// @namespace    http://tampermonkey.net/
// @version      0.0.2
// @description  避免一些网页标题太过“炸裂”导致社死
// @author       You
// @match        https://www.baidu.com/*
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    // Replace the title with an empty string or custom content
    const customTitle = "爱国、敬业、诚信、友善"; // 这里可以填写你想要的标题,比如 "屏蔽标题"
    document.title = customTitle;

    // Optional: Prevent future changes to the title
    const observer = new MutationObserver(() => {
        if (document.title !== customTitle) {
            document.title = customTitle;
        }
    });

    observer.observe(document.querySelector('title'), { childList: true });
})();