Skip to content

Instantly share code, notes, and snippets.

@johnroyer
Last active July 4, 2022 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnroyer/f250e2563cb7134cbc88ee65173215e2 to your computer and use it in GitHub Desktop.
Save johnroyer/f250e2563cb7134cbc88ee65173215e2 to your computer and use it in GitHub Desktop.
Redirect Mediawiki mobile page to general page
// ==UserScript==
// @name Redirect Mobile Mediawiki to Desktop URL
// @namespace http://blog.zeroplex.tw/
// @version 0.1
// @description If Mediawiki opened in mobile page, redirect it to general page
// @author zeroplex
// @match https://*.m.wikipedia.org/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
let url = document.URL;
let desktopUrl = url.replace(/\.m\.wikipedia/, '.wikipedia');
console.log('zeroplex: ' + desktopUrl);
window.location.replace(desktopUrl);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment