diff --git a/qutebrowser/javascript/webelem.js b/qutebrowser/javascript/webelem.js index 3b0e324dd..f9bd7d1af 100644 --- a/qutebrowser/javascript/webelem.js +++ b/qutebrowser/javascript/webelem.js @@ -50,7 +50,6 @@ window._qutebrowser.webelem = (function() { var out = { "id": id, - "text": elem.text, "value": elem.value, "outer_xml": elem.outerHTML, "rects": [], // Gets filled up later @@ -72,6 +71,12 @@ window._qutebrowser.webelem = (function() { out.class_name = ""; } + if (typeof elem.textContent === "string") { + out.text = elem.textContent; + } else if (typeof elem.text === "string") { + out.text = elem.text; + } // else: don't add the text at all + var attributes = {}; for (var i = 0; i < elem.attributes.length; ++i) { var attr = elem.attributes[i]; diff --git a/tests/end2end/data/issue2569.html b/tests/end2end/data/issue2569.html index 4bff70e14..8f613be2d 100644 --- a/tests/end2end/data/issue2569.html +++ b/tests/end2end/data/issue2569.html @@ -1,11 +1,21 @@ +