This Is not Greasy Fork

Tired of Greasy Fork? Well Make your Own Fork :3

当前为 2025-01-30 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         This Is not Greasy Fork
// @namespace    http://tampermonkey.net/
// @version      1.0
// @license      CC BY-NC
// @description  Tired of Greasy Fork? Well Make your Own Fork :3
// @author        Unknown Hacker
// @match        *://greasyfork.org/*
// @match        *://sleazyfork.org/*
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_registerMenuCommand
// ==/UserScript==

(function() {
    'use strict';

    // IF THIS DOES NOT ABIDE BY THE RULES THEN LET ME KNOW LIKE A HUMAN BEING AND I WILL EITHER REMOVE THE SCRIPT OR CHANGE THE DEFAULT
    const defaultText = "Sleazy Fork"; // Sleazy Fork to Greasy Fork will come soon..

    let replacementText = GM_getValue("replacementText", defaultText);

    function setReplacementText() {
        const userInput = prompt("Enter the text to replace 'Greasy Fork' with:", replacementText);
        if (userInput !== null && userInput.trim() !== "") {
            GM_setValue("replacementText", userInput.trim());
            replacementText = userInput.trim();
            alert(`Replacement text set to: ${replacementText}`);
        }
    }

    function resetReplacementText() {
        GM_setValue("replacementText", defaultText);
        replacementText = defaultText;
        alert(`Replacement text reset to default: ${defaultText}`);
    }

    GM_registerMenuCommand("Set Replacement Text", setReplacementText);
    GM_registerMenuCommand("Reset to Default Text", resetReplacementText);

    function replaceTextInNode(node) {
        if (node.nodeType === Node.TEXT_NODE) {
            node.textContent = node.textContent.replace(/Greasy Fork/g, replacementText);
        } else {
            for (let child of node.childNodes) {
                replaceTextInNode(child);
            }
        }
    }

    replaceTextInNode(document.body);

    document.title = document.title.replace(/Greasy Fork/g, replacementText);
})();