Changes

Jump to: navigation, search

Localized Search in Firefox Search Box

1,256 bytes removed, 14:15, 11 February 2008
'''Patch File'''
diff -u -8 -p -r1.961 browser.js
--- browser/base/content/browser.js 10 Feb 2008 06:57:05 -0000 1.961
+++ browser/base/content/browser.js 10 11 Feb 2008 2019:0711:04 21 -0000@@ -27712791,38 16 +27712791,30 18 @@ const BrowserSearch = { if engines.push(!this{ uri: engine.searchBar)href, return; var browser = gBrowser title: engine.getBrowserForDocument(targetDoc); // Append the URI and an appropriate title to the browser data., var icon: iconURL = null; if (gBrowser.shouldLoadFavIcon(browser.currentURI)}) iconURL = browser.currentURI.prePath + "/favicon.ico";
- var hidden = false; // If this engine if (identified by titlehidden) is already in the list, add it // to the list of hidden engines rather than to the main list browser. // XXX This will need to be changed when hiddenEngines = engines are identified by URL; // see bug 335102.else { var searchService = Cc["@mozilla.org/ browser/search-service;1"]. getService(Ci.nsIBrowserSearchService);- if (searchService.getEngineByName(engine.title))- hidden = true; - var engines = (hidden ? browser.hiddenEngines : browser.engines) || [];-- engines.push({ uri: engine.href,- title: engine.title,- icon: iconURL });-- if (hidden)+ // Dynamically "Add" the web site's search engine plugin if it is NOT+ // already on the search engine list and then add it to the + // searchbar's array of "hidden" engines.+ if (!searchService.getEngineByName(engine.title)) {
+ searchService.addEngine(engine.href, Components.interfaces.nsISearchEngine.DATA_XML, iconURL, false);
+ var engines = browser.hiddenEngines || [];+ engines.push({ uri: engine.href,+ title: engine.title,+ icon: iconURL }); browser.hiddenEngines = engines;- else {- browser.engines = engines;- if (browser == gBrowser || browser == gBrowser.mCurrentBrowser)- this.updateSearchButton();
}
},
* Update the browser UI to show whether or not additional engines are
* available when a page is loaded or the user switches tabs to a page that
* has search engines.
*/
</pre>
 
=== '''Code Modifications''' ===
1
edit

Navigation menu