diff --git a/mozilla/browser/base/content/browser.js b/mozilla/browser/base/content/browser.js index 0dcfd9362f7..85cfb33c3c4 100644 --- a/mozilla/browser/base/content/browser.js +++ b/mozilla/browser/base/content/browser.js @@ -2942,6 +2942,16 @@ const BrowserSearch = { if (!etype) return; + + if (target.title) { + // If this engine (identified by title) is already in the list, ignore it. + // XXX This will need to be changed when engines are identified by URL; + // see bug 335102. + var searchService = Components.classes["@mozilla.org/browser/search-service;1"] + .getService(Components.interfaces.nsIBrowserSearchService); + if (searchService.getEngineByName(target.title)) + return; + } if (etype == "application/opensearchdescription+xml" && searchRelRegex.test(erel) && searchHrefRegex.test(ehref)) diff --git a/mozilla/browser/components/search/content/search.xml b/mozilla/browser/components/search/content/search.xml index a8ed7deb4d7..b505fc36ea8 100644 --- a/mozilla/browser/components/search/content/search.xml +++ b/mozilla/browser/components/search/content/search.xml @@ -109,9 +109,6 @@ - document.getAnonymousElementByAttribute(this, "anonid", "searchbar-stringbundle"); - document.getAnonymousElementByAttribute(this, "anonid", "searchbar-textbox"); - null + document.getAnonymousElementByAttribute(this, + "anonid", "searchbar-stringbundle"); + document.getAnonymousElementByAttribute(this, + "anonid", "searchbar-textbox"); + document.getAnonymousElementByAttribute(this, + "anonid", "searchbar-popup"); + document.getAnonymousElementByAttribute(this, + "anonid", "search-go-button"); null null @@ -341,21 +343,37 @@