Handle {} elements in elements._js_cb_single

When using document.getElementById like in find_id, we can get {}
instead of null/None back when nothing was found.
This commit is contained in:
Florian Bruhin 2016-08-18 15:50:00 +02:00
parent d9d14d4a4c
commit f98820971d

View File

@ -339,7 +339,7 @@ class WebEngineElements(browsertab.AbstractElements):
js_elem: The element serialized from javascript.
"""
log.webview.debug("Got element from JS: {!r}".format(js_elem))
if js_elem is None:
if not js_elem:
callback(None)
else:
elem = webengineelem.WebEngineElement(js_elem, tab=self)