英文版本自动跳中文 插件

try to take over the world!

// ==UserScript==
// @name         英文版本自动跳中文 插件
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  try to take over the world!
// @author       You

// @match        *www.php.net/manual/en*
// @match        *developer.mozilla.org/en-US/*
// @match        *eslint.org/*
// @match        *api.jquery.com/*


// @grant        none
// ==/UserScript==

(function() {
    'use strict';


    /*=======  edit  your  site =========*/
    var skiplist=[
        ['/api.jquery.com/','/www.jquery123.com/'],
        ['/www.php.net/manual/en/','/www.php.net/manual/zh/'],
        ['/developer.mozilla.org/en-US/','/developer.mozilla.org/zh-CN/'],
        ['/eslint.org/','/eslint.cn/'],
    ]

    /*=======  edit  your  site =========*/
     var href = window.location.href;
    function skip(source,target){
        if(href.indexOf(source)!=-1){
            href = href.replace(source,target);
            window.location.href =href;
        }
    }
    for (var i=0;i<skiplist.length;i++){
        skip(skiplist[i][0],skiplist[i][1])
    }

})();