mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Backed out changeset 279d7f0290da (bug 1017903)
This commit is contained in:
parent
2265acfe26
commit
d188085740
@ -3922,52 +3922,50 @@ Tab.prototype = {
|
||||
// Check that type matches opensearch.
|
||||
let isOpenSearch = (type == "application/opensearchdescription+xml");
|
||||
if (isOpenSearch && target.title && /^(?:https?|ftp):/i.test(target.href)) {
|
||||
Services.search.init(() => {
|
||||
let visibleEngines = Services.search.getVisibleEngines();
|
||||
// NOTE: Engines are currently identified by name, but this can be changed
|
||||
// when Engines are identified by URL (see bug 335102).
|
||||
if (visibleEngines.some(function(e) {
|
||||
return e.name == target.title;
|
||||
let visibleEngines = Services.search.getVisibleEngines();
|
||||
// NOTE: Engines are currently identified by name, but this can be changed
|
||||
// when Engines are identified by URL (see bug 335102).
|
||||
if (visibleEngines.some(function(e) {
|
||||
return e.name == target.title;
|
||||
})) {
|
||||
// This engine is already present, do nothing.
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.browser.engines) {
|
||||
// This engine has already been handled, do nothing.
|
||||
if (this.browser.engines.some(function(e) {
|
||||
return e.url == target.href;
|
||||
})) {
|
||||
// This engine is already present, do nothing.
|
||||
return;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this.browser.engines = [];
|
||||
}
|
||||
|
||||
if (this.browser.engines) {
|
||||
// This engine has already been handled, do nothing.
|
||||
if (this.browser.engines.some(function(e) {
|
||||
return e.url == target.href;
|
||||
})) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this.browser.engines = [];
|
||||
}
|
||||
// Get favicon.
|
||||
let iconURL = target.ownerDocument.documentURIObject.prePath + "/favicon.ico";
|
||||
|
||||
// Get favicon.
|
||||
let iconURL = target.ownerDocument.documentURIObject.prePath + "/favicon.ico";
|
||||
let newEngine = {
|
||||
title: target.title,
|
||||
url: target.href,
|
||||
iconURL: iconURL
|
||||
};
|
||||
|
||||
let newEngine = {
|
||||
title: target.title,
|
||||
url: target.href,
|
||||
iconURL: iconURL
|
||||
};
|
||||
this.browser.engines.push(newEngine);
|
||||
|
||||
this.browser.engines.push(newEngine);
|
||||
// Don't send a message to display engines if we've already handled an engine.
|
||||
if (this.browser.engines.length > 1)
|
||||
return;
|
||||
|
||||
// Don't send a message to display engines if we've already handled an engine.
|
||||
if (this.browser.engines.length > 1)
|
||||
return;
|
||||
// Broadcast message that this tab contains search engines that should be visible.
|
||||
let newEngineMessage = {
|
||||
type: "Link:OpenSearch",
|
||||
tabID: this.id,
|
||||
visible: true
|
||||
};
|
||||
|
||||
// Broadcast message that this tab contains search engines that should be visible.
|
||||
let newEngineMessage = {
|
||||
type: "Link:OpenSearch",
|
||||
tabID: this.id,
|
||||
visible: true
|
||||
};
|
||||
|
||||
Messaging.sendRequest(newEngineMessage);
|
||||
});
|
||||
Messaging.sendRequest(newEngineMessage);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user