Last active
July 22, 2023 07:58
-
-
Save jxxe/fb8e52251e67fd269964c20bda846e1d to your computer and use it in GitHub Desktop.
Redirect to latest Laravel documentation
This file contains hidden or 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 Documentation Redirect | |
// @match https://laravel.com/docs/* | |
// @version 1.0 | |
// @author Jerome Paulos | |
// @description Automatically redirect to the latest Laravel documentation | |
// @downloadURL https://gist.github.com/jxxe/fb8e52251e67fd269964c20bda846e1d/raw/laravelDocRedirect.user.js | |
// ==/UserScript== | |
(() => { | |
const latestUrl = document.querySelector('#version-switcher option[value*="/master/"] + option').value; | |
const latestPath = new URL(latestUrl).pathname; | |
if(location.pathname !== latestPath) location.href = latestUrl + location.hash; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.