Bug 343788: throw an error instead of silently failing when trying to install an OpenSearch search engine that doesn't have an HTML result type, r=jhughes, r=mconnor

This commit is contained in:
gavin%gavinsharp.com 2006-07-20 17:38:43 +00:00
Родитель 44c6212ba0
Коммит c02fd73bbd
1 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -1429,6 +1429,9 @@ Engine.prototype = {
ENSURE(this.name && (this._urls.length > 0),
"_parseAsOpenSearch: No name, or missing URL!",
Cr.NS_ERROR_FAILURE);
ENSURE(this.supportsResponseType(URLTYPE_SEARCH_HTML),
"_parseAsOpenSearch: No text/html result type!",
Cr.NS_ERROR_FAILURE);
},
/**
@ -2072,11 +2075,6 @@ SearchService.prototype = {
// added through a user action
}
if (!aEngine.supportsResponseType(URLTYPE_SEARCH_HTML)) {
LOG("_addEngineToStore: Won't add engines that have no HTML output!");
return;
}
this._engines[aEngine.name] = aEngine;
this._sortedEngines.push(aEngine);
notifyAction(aEngine, SEARCH_ENGINE_ADDED);