From ec7aa4a95c0ce2869964f68dfda2475311f34e81 Mon Sep 17 00:00:00 2001 From: John Foerch Date: Mon, 4 Nov 2013 13:08:24 -0500 Subject: [PATCH] opensearch_description.completer: do not require hitcount in XML results The google opensearch webjump has been failing, because google's search completions service no longer provides the hitcount in their XML results. --- modules/opensearch.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/opensearch.js b/modules/opensearch.js index d90ec7b..cc81ba8 100644 --- a/modules/opensearch.js +++ b/modules/opensearch.js @@ -128,7 +128,7 @@ opensearch_description.prototype = { let node = elems[i]; let name = node.firstChild.getAttribute("data"); let desc = node.lastChild.getAttribute("int"); - if (name && desc) + if (name) data.push([name,desc]); } delete doc; @@ -137,7 +137,11 @@ opensearch_description.prototype = { delete lspec; let c = { count: data.length, get_string: function (i) data[i][0], - get_description: function (i) data[i][1] + " results", + get_description: function (i) { + if (data[i][1]) + return data[i][1] + " results"; + return ""; + }, get_input_state: function (i) [data[i][0]] }; yield co_return(c); -- 2.11.4.GIT