Created
September 14, 2015 23:03
-
-
Save dccampbell/88707f2947a98190133c to your computer and use it in GitHub Desktop.
Tampermonkey: Redirect all Laravel doc pages to their master version.
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 Laravel Latest Docs | |
// @description Always redirect to the master version laravel docs. | |
// @author David C. Campbell | |
// @match http://laravel.com/docs/* | |
// ==/UserScript== | |
var url = window.location.href; | |
var matches = url.match(/[0-9].[0-9]/); | |
if(matches !== null) { | |
var version = matches.shift(); | |
var newUrl = url.replace(version, 'master'); | |
window.location.replace(newUrl); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment