您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Redirect all V2EX pages to www subdomain
// ==UserScript== // @name V2EX Redirect to www // @namespace http://tampermonkey.net/ // @version 0.2 // @description Redirect all V2EX pages to www subdomain // @author Xiniah // @match *://*.v2ex.com/* // @run-at document-start // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; const currentLocation = window.location; if (!currentLocation.hostname.startsWith('www.') && !currentLocation.hostname.startsWith('v2ex') && !currentLocation.hostname.startsWith('cdn')) { const wwwLocation = currentLocation.protocol + '//www.' + currentLocation.hostname.replace(/^.*?\./, '') + currentLocation.pathname + currentLocation.search + currentLocation.hash; window.location.replace(wwwLocation); } })();