自动跳转到中文网站

当打开其他语言的官方网站时,自动重定向到相应的中文官方网站。支持: Rollup Vue.js

目前为 2023-04-24 提交的版本。查看 最新版本

// ==UserScript==
// @name         自动跳转到中文网站
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Automatically redirect to the corresponding Chinese official website when opening official websites in other languages. Support: Rollup Vue.js
// @description:zh-CN 当打开其他语言的官方网站时,自动重定向到相应的中文官方网站。支持: Rollup Vue.js
// @run-at       document-start
// @author       wasdjkl
// @match        https://*.rollupjs.org/*
// @match        https://*.vuejs.org/*
// @match        https://*.vitejs.dev/*
// @copyright    https://www.wasdjkl.com
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license MIT
// ==/UserScript==

(function () {
  'use strict'
  const host = location.host.toString()
  const hostListCN = [
    { rules: 'rollupjs.org', cn: 'cn.rollupjs.org' },
    { rules: 'vuejs.org', cn: 'cn.vuejs.org' },
    { rules: 'ja.vuejs.org', cn: 'cn.vuejs.org' },
    { rules: 'ua.vuejs.org', cn: 'cn.vuejs.org' },
    { rules: 'fr.vuejs.org', cn: 'cn.vuejs.org' },
    { rules: 'vitejs.dev', cn: 'cn.vitejs.dev' },
    { rules: 'ja.vitejs.dev', cn: 'cn.vitejs.dev' },
    { rules: 'es.vitejs.dev', cn: 'cn.vitejs.dev' },
    { rules: 'pt.vitejs.dev', cn: 'cn.vitejs.dev' },
  ]
  for (const item of hostListCN) {
    if (host === item.rules) {
      location.host = item.cn
    }
  }
})()

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址