切换文档语言至简体中文

将en-us英文页面切换至zh-CN简体中文

当前为 2019-05-06 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         切换文档语言至简体中文
// @namespace    https://github.com/Sunhelter/LearningFile/blob/master/UserScript/Chang.en-us.to.zh-CN.js
// @version      0.3
// @description  将en-us英文页面切换至zh-CN简体中文
// @author       Sunhelter
// @license      MIT
// @date         2019-05-06
// @match        *://docs.microsoft.com/*
// @match        *://developer.mozilla.org/*
// @grant        none
// ==/UserScript==

(function () {
    if (window.location.href.indexOf("/en-us") > -1) {
        var url = window.location.href.replace('en-us', 'zh-CN');
        window.location.href = url;
    }
    else if (window.location.href.indexOf("/zh-tw") > -1) {
        var url = window.location.href.replace('zh-tw', 'zh-CN');
        window.location.href = url;
    }
})();