20
2013
Unity Docs MiddleMouseButton New Tab
Unity “broke” the documentation in some update..cannot middle mouse button click them to open in new tab..
http://forum.unity3d.com/threads/193569-Script-documentation-doesn-t-allow-opening-links-in-new-tab-%28ctrl-or-middle-click%29
While waiting for the fix here’s small GreaseMonkey plugin userscript (firefox) :
– It fixes the links for middle mouse button (so that they open in new tab)
– Also it fixes the page titles (to use the page file name)
// ==UserScript== // @name UnityDocsMiddleButton // @namespace unitycoder.com // @description UnityDocsOpenMiddleButtonNewTab by UnityCoder.com // @include http://docs.unity3d.com/Documentation/ScriptReference/* // @version 1.0 // ==/UserScript== // search page var scriptCode = new Array(); scriptCode.push('$(document).on("mousedown", ".searchres a", function(e){if(e.which== 2){'); scriptCode.push('$(this).attr("href", (location.href.substring(0,location.href.lastIndexOf("/")+1))+$(this).attr("onclick").split(";")[0].split(\'"\')[1]+".html");'); scriptCode.push('$(this).removeAttr("onclick");$(this).trigger("click");e.preventDefault();}});'); var script = document.createElement('script'); script.innerHTML = scriptCode.join('\n'); scriptCode.length = 0; document.getElementsByTagName('body')[0].appendChild(script); // fix most of the links by removing onclick and placing the url on href src instead.. var scriptCode = new Array(); scriptCode.push('$(document).on("mousedown", ".classRuntime a,.attrRuntime a,.enumRuntime a,.classEditor a,.enumEditor a,.attrEditor a,.decText a,.subsection a,.memberTableName a,.heading a", function(e){if(e.which== 2){'); scriptCode.push('$(this).attr("href", (location.href.substring(0,location.href.lastIndexOf("/")+1))+$(this).attr("onclick").split(";")[0].split(\"\'")[1]+".html");'); scriptCode.push('$(this).removeAttr("onclick");$(this).trigger("click");e.preventDefault();}});'); var script = document.createElement('script'); script.innerHTML = scriptCode.join('\n'); scriptCode.length = 0; document.getElementsByTagName('body')[0].appendChild(script); // update page title, TODO: remove ".html"? document.title = "Docs:"+location.pathname.substring(location.pathname.lastIndexOf("/") + 1);
Related Posts
5 Comments + Add Comment
Leave a comment
Recent posts
- MotionVector Effect: Object “disappears” when paused
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
Recent Comments
- Using RenderDoc with Unity (graphics debugger) on
- UI Scroll View automatic Content height on
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
Appreciate the effort, but it ain’t working either.
What is your doc’s url?
Because there are some different url’s there..should use this:
http://docs.unity3d.com/Documentation/ScriptReference/CharacterController-velocity.html
doesnt work on these or others,
http://docs.unity3d.com/420/Documentation/ScriptReference/CharacterController-velocity.html
http://docs.unity3d.com/410/Documentation/ScriptReference/CharacterController-velocity.html
..
Doesn’t work on offline documentation.I added this in the script:
// @include file:///D:/User/Programmes/Level2/Unity.4.1.2/Unity4.2.1/Data/Documentation/Documentation/ScriptReference/*
but it doesn’t work.
Solution?
Need to do some settings for local files,
http://stackoverflow.com/questions/9931115/run-greasemonkey-on-html-files-located-on-the-local-filesystem
for me this one didnt work:
file:///C:/Program Files (x86)/Unity4/Editor/Data/Documentation/Documentation/ScriptReference/*
but this one works:
file:///C:/*
(maybe something to do with () characters..?)
this is interesting also,
“css skins for the Unity3D Documentation, Release Notes and Forums”
http://forum.unity3d.com/threads/211442-Dark-Unity3D-Site-Skins