Merge branch 'paretje-webengine-setitem'

This commit is contained in:
Florian Bruhin 2016-10-17 21:43:58 +02:00
commit b3620a99ff
2 changed files with 8 additions and 1 deletions

View File

@ -47,7 +47,10 @@ class WebEngineElement(webelem.AbstractWebElement):
return attrs[key]
def __setitem__(self, key, val):
log.stub()
self._js_dict['attributes'][key] = val
js_code = javascript.assemble('webelem', 'set_attribute', self._id,
key, val)
self._tab.run_js_async(js_code)
def __delitem__(self, key):
log.stub()

View File

@ -155,5 +155,9 @@ window._qutebrowser.webelem = (function() {
return serialize_elem(elem);
};
funcs.set_attribute = function(id, name, value) {
elements[id].setAttribute(name, value);
};
return funcs;
})();