Redirect Wikimedia Projects from Mobile Version to Desktop Version

Redirect wiki projects from mobile version to desktop version with ManifestV3. Including wikipedia, wikibooks, wiktionary, wikiquote, wikimedia, wikisource, wikiversity, wikispecies, wikidata, wikivoyage and wikinews.

  1. // ==UserScript==
  2. // @name Redirect Wikimedia Projects from Mobile Version to Desktop Version
  3. // @version 1.0.0
  4. // @description Redirect wiki projects from mobile version to desktop version with ManifestV3. Including wikipedia, wikibooks, wiktionary, wikiquote, wikimedia, wikisource, wikiversity, wikispecies, wikidata, wikivoyage and wikinews.
  5. // @namespace AmaniNakupendaWeWe
  6. // @match *://*.m.wikipedia.org/*
  7. // @match *://*.m.wikibooks.org/*
  8. // @match *://*.m.wiktionary.org/*
  9. // @match *://*.m.wikiquote.org/*
  10. // @match *://*.m.wikimedia.org/*
  11. // @match *://*.m.wikisource.org/*
  12. // @match *://*.m.wikiversity.org/*
  13. // @match *://*.m.wikispecies.org/*
  14. // @match *://*.m.wikidata.org/*
  15. // @match *://*.m.wikivoyage.org/*
  16. // @match *://*.m.wikinews.org/*
  17. // @run-at document-start
  18. // @grant none
  19. // @license MIT
  20. // ==/UserScript==
  21.  
  22. const re = /m.wik(.+)\.org/;
  23.  
  24. location.replace(
  25. location.href
  26. .replace(re, location.href.match(re)[0].slice(2))
  27. );