Skip to content

Instantly share code, notes, and snippets.

@phelma
Last active January 8, 2019 14:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phelma/45c111839dc96bc1456018a584791495 to your computer and use it in GitHub Desktop.
Save phelma/45c111839dc96bc1456018a584791495 to your computer and use it in GitHub Desktop.
script for viewing mobile wikipedia on desktop
// ==UserScript==
// @name Wikipedia Desktop to mobile redirect
// @namespace phelm
// @version 0.1
// @description Load mobile page on desktop because it is easier to read
// @author phelm
// @include https://en.wikipedia.org/*
// @include http://en.wikipedia.org/*
// ==/UserScript==
// https://gist.github.com/phelma/45c111839dc96bc1456018a584791495/edit
(function() {
'use strict';
var newUrl = window.location.toString().replace('en.wikipedia.org','en.m.wikipedia.org');
window.location.replace(newUrl);
})();
@phelma
Copy link
Author

phelma commented Jan 8, 2019

replace (rather than add to) window url, so as to not break back button

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment