Skip to content

Instantly share code, notes, and snippets.

@jxxe
Created May 1, 2023 05:12
Show Gist options
  • Save jxxe/a76c6578562258888b9c38c482d6dddf to your computer and use it in GitHub Desktop.
Save jxxe/a76c6578562258888b9c38c482d6dddf to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Laravel Documentation Redirect
// @match https://laravel.com/docs/*
// @version 1.0
// @author Jerome Paulos
// @description Automatically redirect to the latest Laravel documentation
// ==/UserScript==
(() => {
const latestUrl = document.querySelector('#version-switcher option[value*="/master/"] + option').value;
if(location.href !== latestUrl) location.href = latestUrl;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment