Greasy Fork is available in English.

Shit Journal Title (Fixed)

Replace document title by actual article title.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Shit Journal Title (Fixed)
// @description  Replace document title by actual article title.
// @match        *://shitjournal.org/*
// @icon         https://shitjournal.org/LOGO2.png
// @license      Unlicense
// @version      0.1.0
// @run-at       document-idle
// @namespace https://greasyfork.org/users/789884
// ==/UserScript==

(function () {
    'use strict';

    const originalTitle = document.title;

    function updateTitle() {
        // 更通用的选择器
        let node = document.querySelector("h1");

        if (!node) {
            node = document.querySelector("main h2, article h2");
        }

        if (node && node.innerText.trim()) {
            document.title = node.innerText.trim();
        } else {
            document.title = originalTitle;
        }
    }

    // 初次执行
    updateTitle();

    // 监听 DOM 变化(适配 React / Vue)
    const observer = new MutationObserver(() => {
        updateTitle();
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });

})();