您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Redirect Scrolller subreddit pages to sorted and filtered view
当前为
// ==UserScript== // @name Scrolller.com Redirector // @namespace http://tampermonkey.net/ // @license MIT // @version 0.1 // @description Redirect Scrolller subreddit pages to sorted and filtered view // @icon https://scrolller.com/assets/favicon-16x16.png // @author nkatshiba // @match https://scrolller.com/r/* // @grant none // @run-at document-start // ==/UserScript== (function() { 'use strict'; // Get the current URL var currentUrl = new URL(window.location.href); // Check if the URL already contains the desired parameters var params = currentUrl.searchParams; // Only add the parameters if they are not already set correctly var needsRedirect = false; if (params.get('sort') !== 'rising') { params.set('sort', 'rising'); needsRedirect = true; } if (params.get('filter') !== 'videos') { params.set('filter', 'videos'); needsRedirect = true; } // Construct the new URL if needed if (needsRedirect) { var newUrl = currentUrl.origin + currentUrl.pathname + '?' + params.toString(); window.location.replace(newUrl); } })();