Skip to content

Instantly share code, notes, and snippets.

@maoyeedy
Last active April 29, 2025 20:17
Show Gist options
  • Save maoyeedy/3fce9550261e088d2c736b1d13954718 to your computer and use it in GitHub Desktop.
Save maoyeedy/3fce9550261e088d2c736b1d13954718 to your computer and use it in GitHub Desktop.
[Userscript] Redirect Unity docs to latest LTS version
// ==UserScript==
// @name Unity Docs Redirect
// @namespace https://github.com/Maoyeedy/
// @version 1.1
// @author Yidi Mao
// @license MIT
// @description Redirect old Unity docs to latest LTS version
// @icon https://unity.com/favicon.ico
// @match https://docs.unity3d.com/*/Documentation/**
// @run-at document-start
// @grant none
// ==/UserScript==
(function () {
const regex = /^https:\/\/docs\.unity3d\.com\/[0-9.]+\/Documentation\//
if (regex.test(window.location.href)) {
const originalUrl = window.location.href
const newUrl = originalUrl.replace(regex, 'https://docs.unity3d.com/Documentation/')
console.log(`Redirecting: "${originalUrl}" to "${newUrl}"`)
window.location.replace(newUrl)
}
})()
@maoyeedy
Copy link
Author

maoyeedy commented Nov 5, 2023

@maoyeedy
Copy link
Author

maoyeedy commented Apr 28, 2025

Made this when I first started to learn Unity. Back then, I was pissed off that topmost search results are usually Unity 5.x or Unity 2017/2018 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment