Serlo said:
Awesome, though it still needs a "open search in a new tab/window" button.
Okay. Stick this somewhere:
Middle click
setTimeout( function(){ document.getElementById("search-box").getElementsByTagName("form")[0].addEventListener("mousedown", function(e) { if(e.button == 1) { var value = encodeURIComponent( document.getElementById("tags").value.replace( /(^ +| +$)/g, '') ); if( value.length ) GM_openInTab(location.protocol+"//"+location.host+"/posts?tags="+value); else GM_openInTab(location.protocol+"//"+location.host+"/posts"); } }, true); },0 );
I still get the "scroll" thing that happens when you middle click on a page, but oh well.
EDIT: I prefer the "hold CTRL while left clicking" approach:
Left click
setTimeout( function(){ document.getElementById("search-box").getElementsByTagName("form")[0].addEventListener("click", function(e) { if( e.button == 0 && e.ctrlKey ) { e.preventDefault(); var value = encodeURIComponent( document.getElementById("tags").value.replace( /(^ +| +$)/g, '') ); if( value.length ) GM_openInTab(location.protocol+"//"+location.host+"/posts?tags="+value); else GM_openInTab(location.protocol+"//"+location.host+"/posts"); } }, true); },0 );
Updated