Skip to content

Instantly share code, notes, and snippets.

@leakypixel
Last active May 26, 2019 22:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save leakypixel/1b0a30fbdc815016c14264b82172d841 to your computer and use it in GitHub Desktop.
Save leakypixel/1b0a30fbdc815016c14264b82172d841 to your computer and use it in GitHub Desktop.
UserScript: Redirect desktop Wikipedia to mobile
// ==UserScript==
// @name always_mobile_wikipedia
// @namespace https://gist.github.com/leakypixel
// @description Redirect desktop Wikipedia to mobile
// @author leakypixel
// @include http://*.wikipedia.org/*
// @include https://*.wikipedia.org/*
// @version 0.2
// @grant none
// ==/UserScript==
'use strict';
var m = /^(https?:\/\/[a-z]+)(\.wikipedia\.org\/.*)/.exec(location.href);
if (m) { window.location = m[1] + ".m" + m[2] };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment