Adjust WebEngineEleement _js_dict in remove_blank_target
Otherwise, when checking later if the element has target=_blank set, we still think it is. This is not perfect as remove_blank_target also removes it from sub-elements, but it's a good start.
This commit is contained in:
parent
3de2bfb277
commit
40e1337e03
@ -147,6 +147,8 @@ class WebEngineElement(webelem.AbstractWebElement):
|
|||||||
return QRect()
|
return QRect()
|
||||||
|
|
||||||
def remove_blank_target(self):
|
def remove_blank_target(self):
|
||||||
|
if self._js_dict['attributes'].get('target') == '_blank':
|
||||||
|
self._js_dict['attributes']['target'] = '_top'
|
||||||
js_code = javascript.assemble('webelem', 'remove_blank_target',
|
js_code = javascript.assemble('webelem', 'remove_blank_target',
|
||||||
self._id)
|
self._id)
|
||||||
self._tab.run_js_async(js_code)
|
self._tab.run_js_async(js_code)
|
||||||
|
Loading…
Reference in New Issue
Block a user