隐藏标题/安全标题/Title SFW

避免上班摸鱼的时候网页标题过于“炸裂”导致社死

目前為 2024-11-26 提交的版本,檢視 最新版本

// ==UserScript==
// @name         隐藏标题/安全标题/Title SFW
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @description  避免上班摸鱼的时候网页标题过于“炸裂”导致社死
// @author       You
// @match        *://*/*
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';
    // 定义自定义标题列表
    const titles = ["富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国", "敬业", "诚信", "友善"];
    // 随机从列表中选择一个标题
    const customTitle = titles[Math.floor(Math.random() * titles.length)];
    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 });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址