Last active
July 4, 2022 11:26
-
-
Save johnroyer/f250e2563cb7134cbc88ee65173215e2 to your computer and use it in GitHub Desktop.
Redirect Mediawiki mobile page to general page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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