🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

📂 缓存分发状态(共享加速已生效)
🕒 页面同步时间:2026/01/13 09:42:36
🔄 下次更新时间:2026/01/13 10:42:36
手动刷新缓存

Reddit old.reddit button

Add button to redirect post to old.reddit.com

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         Reddit old.reddit button
// @namespace    https://www.reddit.com
// @version      1.0
// @description  Add button to redirect post to old.reddit.com
// @author       Agreasyforkuser
// @match        https://www.reddit.com/*
// @match        https://new.reddit.com/*
// @icon         https://www.redditstatic.com/desktop2x/img/favicon/android-icon-192x192.png
// @license      MIT
// ==/UserScript==

'use strict';

function changeUrl() {
    // Replace "www" or "new" with "old" in the current URL
    var oldUrl = window.location.href;
    var newUrl = oldUrl.replace(/www|new/, 'old');

    // Open the new URL in the same window
    window.location.href = newUrl;
}

function createChangeUrlButton() {
    var button = document.createElement('button');
    button.innerHTML = 'old.reddit';
    button.style.color = 'white';
    button.style.background = 'black';
    button.style.border = 'none';
    button.style.fontSize = 'inherit';
    button.style.zIndex = "9999999";
    button.style.position = "fixed";
    button.style.top = "0";
    button.onclick = changeUrl;

    // Add the button to the document body
    document.body.appendChild(button);
}

// Call the function to create the "Change URL" button
createChangeUrlButton();