{"id":2330,"date":"2013-08-20T15:23:17","date_gmt":"2013-08-20T12:23:17","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=2330"},"modified":"2013-08-20T15:26:50","modified_gmt":"2013-08-20T12:26:50","slug":"unity-docs-middlemousebutton-new-tab","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2013\/08\/20\/unity-docs-middlemousebutton-new-tab\/","title":{"rendered":"Unity Docs MiddleMouseButton New Tab"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2331\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2013\/08\/20\/unity-docs-middlemousebutton-new-tab\/unity_documentation_open_new_tab_middle_mouse\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/08\/unity_documentation_open_new_tab_middle_mouse.jpg?fit=680%2C253&amp;ssl=1\" data-orig-size=\"680,253\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"unity_documentation_open_new_tab_middle_mouse\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/08\/unity_documentation_open_new_tab_middle_mouse.jpg?fit=680%2C253&amp;ssl=1\" class=\"alignnone size-full wp-image-2331\" alt=\"unity_documentation_open_new_tab_middle_mouse\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/08\/unity_documentation_open_new_tab_middle_mouse.jpg?resize=680%2C253\" width=\"680\" height=\"253\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/08\/unity_documentation_open_new_tab_middle_mouse.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/08\/unity_documentation_open_new_tab_middle_mouse.jpg?resize=300%2C111&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p>Unity &#8220;broke&#8221; the documentation in some update..cannot middle mouse button click them to open in new tab..<br \/>\n<a title=\"http:\/\/forum.unity3d.com\/threads\/193569-Script-documentation-doesn-t-allow-opening-links-in-new-tab-%28ctrl-or-middle-click%29\" href=\"http:\/\/forum.unity3d.com\/threads\/193569-Script-documentation-doesn-t-allow-opening-links-in-new-tab-%28ctrl-or-middle-click%29\" target=\"_blank\">http:\/\/forum.unity3d.com\/threads\/193569-Script-documentation-doesn-t-allow-opening-links-in-new-tab-%28ctrl-or-middle-click%29<\/a><\/p>\n<p>While waiting for the fix here&#8217;s small <a title=\"https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/greasemonkey\/\" href=\"https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/greasemonkey\/\" target=\"_blank\">GreaseMonkey plugin<\/a> userscript (firefox) :<br \/>\n&#8211; It fixes the links for middle mouse button (so that they open in new tab)<br \/>\n&#8211; Also it fixes the page titles (to use the page file name)<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\/\/ ==UserScript==\r\n\/\/ @name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 UnityDocsMiddleButton\r\n\/\/ @namespace\u00a0\u00a0 unitycoder.com\r\n\/\/ @description UnityDocsOpenMiddleButtonNewTab by UnityCoder.com\r\n\/\/ @include\u00a0\u00a0\u00a0\u00a0 http:\/\/docs.unity3d.com\/Documentation\/ScriptReference\/*\r\n\/\/ @version\u00a0\u00a0\u00a0\u00a0 1.0\r\n\/\/ ==\/UserScript==\r\n\r\n\/\/ search page\r\nvar scriptCode = new Array();\r\nscriptCode.push('$(document).on(&quot;mousedown&quot;, &quot;.searchres a&quot;, function(e){if(e.which== 2){');\r\nscriptCode.push('$(this).attr(&quot;href&quot;, (location.href.substring(0,location.href.lastIndexOf(&quot;\/&quot;)+1))+$(this).attr(&quot;onclick&quot;).split(&quot;;&quot;)&#x5B;0].split(\\'&quot;\\')&#x5B;1]+&quot;.html&quot;);');\r\nscriptCode.push('$(this).removeAttr(&quot;onclick&quot;);$(this).trigger(&quot;click&quot;);e.preventDefault();}});');\r\nvar script = document.createElement('script');\r\nscript.innerHTML = scriptCode.join('\\n');\r\nscriptCode.length = 0;\r\ndocument.getElementsByTagName('body')&#x5B;0].appendChild(script);\r\n\r\n\/\/ fix most of the links by removing onclick and placing the url on href src instead..\r\nvar scriptCode = new Array();\r\nscriptCode.push('$(document).on(&quot;mousedown&quot;, &quot;.classRuntime a,.attrRuntime a,.enumRuntime a,.classEditor a,.enumEditor a,.attrEditor a,.decText a,.subsection a,.memberTableName a,.heading a&quot;, function(e){if(e.which== 2){');\r\nscriptCode.push('$(this).attr(&quot;href&quot;, (location.href.substring(0,location.href.lastIndexOf(&quot;\/&quot;)+1))+$(this).attr(&quot;onclick&quot;).split(&quot;;&quot;)&#x5B;0].split(\\&quot;\\'&quot;)&#x5B;1]+&quot;.html&quot;);');\r\nscriptCode.push('$(this).removeAttr(&quot;onclick&quot;);$(this).trigger(&quot;click&quot;);e.preventDefault();}});');\r\nvar script = document.createElement('script');\r\nscript.innerHTML = scriptCode.join('\\n');\r\nscriptCode.length = 0;\r\ndocument.getElementsByTagName('body')&#x5B;0].appendChild(script);\r\n\r\n\/\/ update page title, TODO: remove &quot;.html&quot;?\r\ndocument.title = &quot;Docs:&quot;+location.pathname.substring(location.pathname.lastIndexOf(&quot;\/&quot;) + 1);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Unity &#8220;broke&#8221; 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&#8217;s small GreaseMonkey plugin userscript (firefox) : &#8211; It fixes the links for middle mouse button (so that they open in new [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2331,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[148,3],"tags":[539,538,537,540,28,171],"class_list":["post-2330","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-help","category-unity3d","tag-docs","tag-documentation","tag-greasemonkey","tag-middlemouse","tag-plugin","tag-unity"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2013\/08\/unity_documentation_open_new_tab_middle_mouse.jpg?fit=680%2C253&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-BA","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/2330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=2330"}],"version-history":[{"count":5,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/2330\/revisions"}],"predecessor-version":[{"id":2336,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/2330\/revisions\/2336"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/2331"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=2330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=2330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=2330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}