Vector Layout For Wikipedia

This script appends ?useskin=vector to any Wikipedia Wiki page you visit. This returns the site to its old default desktop layout before the 2023 redesign.

  1. // ==UserScript==
  2. // @name Vector Layout For Wikipedia
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.32
  5. // @description This script appends ?useskin=vector to any Wikipedia Wiki page you visit. This returns the site to its old default desktop layout before the 2023 redesign.
  6. // @author Ata Sancaktar
  7. // @match *://*.wikipedia.org/*/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=wikipedia.org
  9. // @run-at document-start
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. if(window.location.href.includes("useskin=vector")===false){
  17. if(window.location.href.includes("?")){
  18. if(window.location.href.includes("#")){
  19. window.location.replace (window.location.href.substring(0, window.location.href.indexOf('#')) + "&useskin=vector" + window.location.href.substring(window.location.href.indexOf('#'),window.location.href.length));
  20. }
  21. else{
  22. window.location.replace (window.location.href + "&useskin=vector");
  23. }
  24. }
  25. else if(window.location.href.includes("#")){
  26. window.location.replace (window.location.href.substring(0, window.location.href.indexOf('#')) + "?useskin=vector" + window.location.href.substring(window.location.href.indexOf('#'),window.location.href.length));
  27. }
  28. else{
  29. window.location.replace (window.location.pathname + "?useskin=vector");
  30. }
  31. }
  32. //var wikipediaLinks = Array.from(document.links).filter(link => link.href.includes("wikipedia"));
  33. //for (var i = 0; i < wikipediaLinks.length; i++) {
  34. // if(wikipediaLinks[i].href.includes("?" && ! "?u")){
  35. // wikipediaLinks[i].href = wikipediaLinks[i].origin + wikipediaLinks[i].pathname + "&useskin=vector" + wikipediaLinks[i].hash
  36. // }
  37. // else{
  38. // wikipediaLinks[i].href = wikipediaLinks[i].origin + wikipediaLinks[i].pathname + "?useskin=vector" + wikipediaLinks[i].hash
  39. // }
  40. //}
  41. // uncomment the lines above (erase the "//"s) to automatically convert Wikipedia links on the page for smoother browsing.
  42. })();

QingJ © 2025

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