Skip to content

Instantly share code, notes, and snippets.

@usrme
Last active August 6, 2016 12:10
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 usrme/07fe0b5c4201f43b6fc3 to your computer and use it in GitHub Desktop.
Save usrme/07fe0b5c4201f43b6fc3 to your computer and use it in GitHub Desktop.
[GreaseMonkey] Force Wikipedia Mobile View
// ==UserScript==
// @name Force Wikipedia Mobile View
// @namespace https://github.com/usrme
// @description Forces mobile view on desktop for a better reading experience
// @include http*://*wikipedia.org*
// @version 1
// @grant none
// ==/UserScript==
let uri = window.location.href;
if (uri.indexOf('.m.') === -1) {
let idx = uri.indexOf('wikipedia'),
out = uri.substr(0, idx - 1) + '.m.' + uri.substr(idx);
window.location.href = out;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment