From gandalfsnews at yahoo.com Mon Sep 17 02:39:24 2007 From: gandalfsnews at yahoo.com (Lutz Fischer) Date: Mon, 17 Sep 2007 02:39:24 -0700 (PDT) Subject: [Needlesearch] Search in new tab Message-ID: <736196.17746.qm@web52011.mail.re2.yahoo.com> Hello. I found a slightly anoying bug When the ns-search-tab-button is pressed it needlesearch opens a new tab and then starts the search - which is quite nice. Only if you have installed an extension (e.g. tab mix plus) so that the new tab is not the last tab, then needlesearch still searches in the last tab :( As far as I can the is problem in needlesearch/jslib/nsVirtualForm.js function nsVirtualForm (aUrl, aTarget, mSearchterms, aMethod, aEncoding) { var NS_SPLITSTRING_DEFAULT = ';'; var NS_SPLITSTRING_PREF = 'multiFieldSplitter'; var NS_DEFAULT_ENCODING = 'UTF-8'; var NS_DEFAULT_METHOD = 'GET'; var aVForm var isSuccess = false; if (aUrl.length > 0) { //Is a searchengine selected? if ( aTarget == 'newtab' ){ //For a new tab win = getBrowser() var newTab = win.addTab('about:blank') var inBg = nsPrefs.getBoolPref('browser.tabs.loadInBackground') if ( !inBg ) { getBrowser().selectedTab = newTab; } //get the document for that tab var amountTabs = getBrowser().browsers.length var tabD = getBrowser().browsers[amountTabs-1].contentWindow.document; aVForm = createForm( tabD ) this.isSuccess = true; } else if ( aTarget == "_blank" ) { Should be something like: function nsVirtualForm (aUrl, aTarget, mSearchterms, aMethod, aEncoding) { var NS_SPLITSTRING_DEFAULT = ';'; var NS_SPLITSTRING_PREF = 'multiFieldSplitter'; var NS_DEFAULT_ENCODING = 'UTF-8'; var NS_DEFAULT_METHOD = 'GET'; var aVForm var isSuccess = false; if (aUrl.length > 0) { //Is a searchengine selected? if ( aTarget == 'newtab' ){ //For a new tab win = getBrowser() var newTab = win.addTab('about:blank') var inBg = nsPrefs.getBoolPref('browser.tabs.loadInBackground') if ( !inBg ) { getBrowser().selectedTab = newTab; } //get the document for that tab aVForm = createForm( newTab ) this.isSuccess = true; } else if ( aTarget == "_blank" ) { I never did any XUL-Programming - so it's just an idea - didn't try it myself. ____________________________________________________________________________________ Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more! http://tv.yahoo.com/collections/3658