Created
November 5, 2015 11:52
-
-
Save snemarch/5ce633daccabad591ce9 to your computer and use it in GitHub Desktop.
GreaseMonkey redirect script for Berlingske mobile->desktop site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Berlingske mobile->desktop redirect | |
// @namespace kthx.dk | |
// @include http://m.b.dk/* | |
// @include https://m.b.dk/* | |
// @version 1 | |
// @run-at document-start | |
// @grant none | |
// ==/UserScript== | |
var matcher = /(https?:\/\/)m.b.dk\/\?redirect=(.*)/; | |
var match = matcher.exec(window.location); | |
if(match != null) { | |
var uri = match[1] + decodeURIComponent(match[2]); | |
window.location = uri; | |
// use .replace() instead of assignment if you don't want the mobile version in browser history. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment