Last active
April 29, 2025 20:17
-
-
Save maoyeedy/3fce9550261e088d2c736b1d13954718 to your computer and use it in GitHub Desktop.
[Userscript] Redirect Unity docs to latest LTS version
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 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) | |
} | |
})() |
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
Install
https://gist.github.com/Maoyeedy/3fce9550261e088d2c736b1d13954718/raw/UnityDocsRedirect.user.js
Test Page
https://docs.unity3d.com/2017.4/Documentation/ScriptReference/Random.Range.html