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; | |
})(); |
Author
jxxe
commented
Jul 22, 2023
•
- Install the Violentmonkey extension for Chrome, Firefox, or Edge
- Click here to install this script
- Visit any out-of-date Laravel documentation URL (example)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment