Skip to content

Instantly share code, notes, and snippets.

@lostfictions
Last active April 29, 2024 02:30
Show Gist options
  • Save lostfictions/6130207 to your computer and use it in GitHub Desktop.
Save lostfictions/6130207 to your computer and use it in GitHub Desktop.
Greasemonkey and Tampermonkey script to rewrite Unity3d.com API documentation URIs (so that you can open links in a new tab/window.) Works on both docs.unity3d.com and locally-installed copies (though you may have to change the @match directive to work on OSX.)Also fixes page titles, which have been broken ever since the documentation format was…
// ==UserScript==
// @name Unity Documentation Helper
// @namespace http://twitter.com/doam
// @version 0.15
// @description Tweak Unity docs to show API names and search queries in the title.
// @match http://docs.unity3d.com/ScriptReference/*.html*
// @match file:///*/Unity/Editor/Data/Documentation/*/ScriptReference/*.html*
// @copyright 2013-2015 six
// ==/UserScript==
var searchPath = "30_search.html?q=";
var index = location.href.indexOf(searchPath);
if(index !== -1) {
document.title = "Search: '" + location.href.substring(index + searchPath.length) + "' - Unity Script Reference";
return;
}
document.title = document.querySelector("h1.heading").textContent + " - Unity Script Reference";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment