Blog page: https://unitycoder.com/blog/2023/03/07/greasemonkey-display-unity-version-added-info-in-api-docs/
Last active
February 14, 2024 19:47
Star
You must be signed in to star a gist
GreaseMonkey script to display unity api version first added
This file contains 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 UnityDocsShowFirstVersionAdded | |
// @namespace https://unitycoder.com | |
// @description Displays unity version when this method was added (takes from the dropdown list) | |
// @include https://docs.unity3d.com/ScriptReference/* | |
// @include https://docs.unity3d.com/*/Documentation/* | |
// @version 1.1 (14.02.2024) | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const interval = setInterval(function() { | |
const lastListItem = document.querySelector('#versionsWithThisPage li:last-child a'); | |
if (lastListItem) | |
{ | |
const lastListItemValue = lastListItem.innerText; | |
//console.log(`Last LI value: ${lastListItemValue}`); | |
// get the reference to the h1 element | |
const heading = document.querySelector('.heading.inherit'); | |
// create a new p element | |
const newElement = document.createElement('p'); | |
newElement.innerHTML = "Added in "+lastListItemValue; | |
// insert the new p element after the h1 element | |
heading.parentNode.insertBefore(newElement, heading.nextSibling); | |
clearInterval(interval); | |
} | |
}, 1000); // check every 1 second | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment