Skip to content

Instantly share code, notes, and snippets.

@alexdelorenzo
Created February 8, 2022 01:50
Show Gist options
  • Save alexdelorenzo/a6789b8d58316d6ba58f3cb46596f677 to your computer and use it in GitHub Desktop.
Save alexdelorenzo/a6789b8d58316d6ba58f3cb46596f677 to your computer and use it in GitHub Desktop.
Force desktop interface on Wikipedia and disable Wikipedia's mobile UI
// ==UserScript==
// @name Force desktop Wikipedia
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Disable Wikipedia's mobile UI in favor of its desktop UI
// @author Alex DeLorenzo <AlexDeLorenzo.dev>
// @match https://*.m.wikipedia.org/*
// @grant none
// @license GPL-3.0
// ==/UserScript==
(function() {
'use strict';
const MOBILE_SUB = ".m.";
const DOT = '.';
const newUrl = new URL(location);
newUrl.host = newUrl.host.replace(MOBILE_SUB, DOT);
location.replace(newUrl);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment