Skip to content

Instantly share code, notes, and snippets.

@usrme
Last active August 6, 2016 12:10
Show Gist options
  • Save usrme/07fe0b5c4201f43b6fc3 to your computer and use it in GitHub Desktop.
Save usrme/07fe0b5c4201f43b6fc3 to your computer and use it in GitHub Desktop.

Revisions

  1. usrme revised this gist Aug 6, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions force-mobile.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    // ==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
  2. usrme revised this gist Jul 29, 2016. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions force-mobile.js
    Original file line number Diff line number Diff line change
    @@ -6,10 +6,10 @@
    // @grant none
    // ==/UserScript==

    var uri = window.location.href
    let uri = window.location.href;

    if (uri.indexOf('.m.') === -1) {
    var idx = uri.indexOf('wikipedia');
    var out = uri.substr(0, idx - 1) + '.m.' + uri.substr(idx);
    window.location.href = out;
    let idx = uri.indexOf('wikipedia'),
    out = uri.substr(0, idx - 1) + '.m.' + uri.substr(idx);
    window.location.href = out;
    }
  3. usrme created this gist Mar 29, 2016.
    15 changes: 15 additions & 0 deletions force-mobile.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    // ==UserScript==
    // @name Force Wikipedia Mobile View
    // @namespace https://github.com/usrme
    // @include http*://*wikipedia.org*
    // @version 1
    // @grant none
    // ==/UserScript==

    var uri = window.location.href

    if (uri.indexOf('.m.') === -1) {
    var idx = uri.indexOf('wikipedia');
    var out = uri.substr(0, idx - 1) + '.m.' + uri.substr(idx);
    window.location.href = out;
    }