您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
redirects you to new.reddit.com
// ==UserScript== // @name New Reddit Redirect // @version 0.1.0 // @description redirects you to new.reddit.com // @author github.com/lasersPew // @match *://*.reddit.com/* // @exclude /^https?://[a-z]{2}\.reddit\.com/* // @exclude *out.reddit.com/* // @exclude *://*.reddit.com/gallery/* // @exclude *://*.reddit.com/media* // @run-at document-start // @license GPLv3 // @grant none // @namespace https://greasyfork.org/users/1267998 // ==/UserScript== // Enforce strict mode for better code quality (function () { 'use strict'; // Declare constant for current URL const currentUrl = window.location.href; // Declare constant for old reddit URL const newRedditUrl = 'https://new.reddit.com/'; // Check if the current URLis not new.reddit.com if ((!currentUrl.includes("www.reddit.com")) && (!GM_info.isIncognito )) { // Use regex literal and constant for new URL const newUrl = currentUrl.replace(/^https?:\/\/(www\.)?reddit.com\//, newRedditUrl); // Redirect to new URL without history entry window.location.replace(newUrl); } }());