Change Wikipedia skin to the previous one

Change Japanese Wikipedia skin to vector

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name           Change Wikipedia skin to the previous one
// @name:ja        Wikipediaのスキンを以前のものに変更する
// @namespace      https://greasyfork.org/users/783910
// @version        1.1.3
// @description    Change Japanese Wikipedia skin to vector
// @description:ja Wikipediaのスキンをvectorに変更する
// @author         ysnr777
// @match          *://*.wikipedia.org/*
// @icon           https://www.google.com/s2/favicons?domain=wikipedia.org
// @grant          none
// @license        WTFPL
// @run-at         document-start
// ==/UserScript==

const url = new URL(location.href);
if (!url.searchParams.has('useskin')) {
  url.searchParams.set('useskin', 'vector');
  location.replace(url);
}

/**
 * ページ内リンクのurlにパラメータ付与 ※ver1.1.0で削除
 */
// document.addEventListener('DOMContentLoaded', () => {
//   for (const el of document.getElementsByTagName('a')) {
//     if (0 < el.href.length) {
//       const href = new URL(el.href);
//       if (href.origin == url.origin && !href.searchParams.has('useskin')) {
//         href.searchParams.set('useskin', 'vector');
//         el.href = href.href;
//       }
//     }
//   }
// });