Skip to content

Instantly share code, notes, and snippets.

@vimtaku
Last active December 17, 2015 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vimtaku/5603486 to your computer and use it in GitHub Desktop.
Save vimtaku/5603486 to your computer and use it in GitHub Desktop.
unity reference default select
// ==UserScript==
// @name unity_reference_switch
// @namespace unity_reference_switch
// @include http://docs.unity3d.com/Documentation/ScriptReference/*.html
// @version 1
// @grant none
// ==/UserScript==
(function() {
var selectLanguage = "C#";
var codes = document.getElementsByClassName("code");
setTimeout(function() {
for (var i = 0; i < codes.length; i++) {
var code = codes[i];
var codeText = code.getAttribute("code_lang_name");
if (selectLanguage != codeText) {
code.style.display = 'none';
continue;
}
var span = document.getElementsByClassName('cSelect-Selected')[0];
span.innerHTML = selectLanguage;
code.style.display = 'block';
}
}, 0);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment