Greasy Fork

来自缓存

Greasy Fork is available in English.

维基百科简体中文化

Wikipedia 维基百科和 wikiwand 默认语言转简体中文。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         维基百科简体中文化
// @version      0.03
// @description  Wikipedia 维基百科和 wikiwand 默认语言转简体中文。
// @author       Fionnghall
// @include      http*://zh.wikipedia.org/*
// @include      http*://en.wikipedia.org/*
// @include      http*://www.wikiwand.com/*
// @namespace    http://greasyfork.icu/users/293425
// ==/UserScript==

(function() {
    'use strict';
    
    // ==================================================
    // 请优先使用维基百科自带的语言选择功能,需要登陆账号。
    // 在参数设置里选择,不同的地区语言,链接可能不同。
    // https://zh.wikipedia.org/wiki/Special:参数设置
    // ==================================================

     console.log('自动切换维基语言')
  
  
    //let current_lang = document.querySelector('.uls-display-settings-anon-label span').firstChild.nodeValue
    if (document.URL.includes('en')) {
      let wiki_href = ""
      // if (document.URL.includes.('wikipedia.org')){
        let target_href = document.querySelector('#p-lang .vector-menu-content .vector-menu-content-list .interwiki-zh a').getAttribute('href')
        wiki_href = target_href
        window.location = target_href
        console.log('切换成功!')
      // }
      // if (document.URL.includes.('wikiwand.com')){
      //   window.location = target_href
      //   console.log('切换成功!')
      // }
    }
    


})();