您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
redirects to Chinese version of the documentation
// ==UserScript== // @name PHP.net redirect to chinese // @namespace https://greasyfork.org/en/scripts/40797-php-net-redirect-to-chinese // @version 0.0.2 // @description redirects to Chinese version of the documentation // @author NellPoi // @match *www.php.net/manual/en* // @grant none // @run-at document-start // ==/UserScript== /* jshint esversion: 6 */ (function() { 'use strict'; const url = window.location.href; const regex = /(https?:\/\/(?:[^\.]+\.)?php\.net\/manual\/)([^\/]+)(\/.*)/gm; const match = regex.exec(url); if(!match){ return; } if(match[2] === 'zh'){ return; } const newUrl = match[1] + 'zh' + match[3]; window.location.replace(newUrl); })();