From: John Foerch Date: Mon, 4 Nov 2013 18:08:24 +0000 (-0500) Subject: opensearch_description.completer: do not require hitcount in XML results X-Git-Tag: debian-1.0--pre-1+git160130-1~135 X-Git-Url: https://repo.or.cz/w/conkeror.git/commitdiff_plain/ec7aa4a95c0ce2869964f68dfda2475311f34e81 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. --- 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);