Greasy Fork

Greasy Fork is available in English.

维基百科不转换中文,保留源码

强制维基百科不转换中文

目前为 2021-12-19 提交的版本。查看 最新版本

// ==UserScript==
// @name				Fuck Wikipeida Chinese Converting
// @name:zh-CN          维基百科不转换中文,保留源码 
// @name:zh-TW             維基百科不轉換中文,保留原始碼
// @version				0.1
// @author				edr1412 <[email protected]>
// @namespace            https://github.com/edr1412
// @license          MIT
// @match       https://*.m.wikipedia.org/*
// @match				https://zh.wikipedia.org/zh/*
// @match				https://zh.wikipedia.org/zh-cn/*
// @match				https://zh.wikipedia.org/zh-hk/*
// @match				https://zh.wikipedia.org/zh-mo/*
// @match				https://zh.wikipedia.org/zh-tw/*
// @match				https://zh.wikipedia.org/zh-sg/*
// @match				https://zh.wikipedia.org/zh-my/*
// @match       https://zh.moegirl.org.cn/zh/*
// @match       https://zh.moegirl.org.cn/zh-tw/*
// @match       https://zh.moegirl.org.cn/zh-hk/*
// @match       https://zh.moegirl.org.cn/zh-hans/*
// @match       https://zh.moegirl.org.cn/zh-hant/*
// @match       https://zh.moegirl.org.cn/zh-cn/*
// @match       https://mzh.moegirl.org.cn/zh/*
// @match       https://mzh.moegirl.org.cn/zh-tw/*
// @match       https://mzh.moegirl.org.cn/zh-hk/*
// @match       https://mzh.moegirl.org.cn/zh-hans/*
// @match       https://mzh.moegirl.org.cn/zh-hant/*
// @match       https://mzh.moegirl.org.cn/zh-cn/*
// @grant				none
// @icon				https://zh.wikipedia.org/static/favicon/wikipedia.ico
// @description force redirect https://zh.wikipedia.org/zh-??/* to https://zh.wikipedia.org/wiki/* ; force using desktop view instead of mobile; work for zh.moegirl.org.cn too
// @description:zh-cn 强制维基百科不转换中文
// @description:zh-tw 強制Wikipedia採用原始碼顯示中文
// ==/UserScript==

(function() {
  'use strict';
  let replacedUrl = document.URL;
  replacedUrl = replacedUrl.replace(/([^\/]+\/\/[^\.]+\.)m\.(wikipedia.org.*)/,'$1$2');
  replacedUrl = replacedUrl.replace(/([^\/]+\/\/)m?(zh.moegirl.org.cn\/)(?:zh\/|zh-tw\/|zh-hk\/|zh-hans\/|zh-hant\/|zh-cn\/)?(.*)/,'$1$2$3');
  replacedUrl = replacedUrl.replace(/([^\/]+\/\/zh\.wikipedia.org\/)(?:zh\/|zh-cn\/|zh-tw\/|zh-hk\/|zh-mo\/|zh-my\/|zh-sg\/)(.*)/,'$1wiki/$2');
  if (replacedUrl !== document.URL) {
        window.location = replacedUrl;
    }
})();