Last active
November 28, 2021 15:14
-
-
Save gue-ni/7de602dc5af933b2c47b6db5f4370ac8 to your computer and use it in GitHub Desktop.
Redirect from wikipedia mobile pages to desktop pages
This file contains hidden or 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 from mobile wikipedia | |
// @namespace http://tampermonkey.net/ | |
// @version 1.3 | |
// @description Redirect wikipedia mobile pages to desktop pages | |
// @author Jakob Maier | |
// @match https://*.m.wikipedia.org/* | |
// @icon https://www.google.com/s2/favicons?domain=wikipedia.org | |
// @updateURL https://gist.githubusercontent.com/gue-ni/7de602dc5af933b2c47b6db5f4370ac8/raw/redirect_from_mobile_wikipedia.js | |
// @downloadURL https://gist.githubusercontent.com/gue-ni/7de602dc5af933b2c47b6db5f4370ac8/raw/redirect_from_mobile_wikipedia.js | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
let href = document.location.href; | |
if (/^https:\/\/\w{2}\.m\./.test(href)){ | |
window.location.replace(href.replace(/.m./, ".")); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment