Added a page variable.

This commit is contained in:
Antoni Boucher 2015-05-31 12:18:27 -04:00
parent 1cd64481de
commit d0eda3336c

View File

@ -996,11 +996,12 @@ class CommandDispatcher:
tab: Load the selected link in a new tab. tab: Load the selected link in a new tab.
""" """
widget = self._current_widget() widget = self._current_widget()
page = widget.page()
if QWebSettings.globalSettings().testAttribute( if QWebSettings.globalSettings().testAttribute(
QWebSettings.JavascriptEnabled): QWebSettings.JavascriptEnabled):
if tab: if tab:
widget.page().open_target = usertypes.ClickTarget.tab page.open_target = usertypes.ClickTarget.tab
widget.page().currentFrame().evaluateJavaScript( page.currentFrame().evaluateJavaScript(
'window.getSelection().anchorNode.parentNode.click()') 'window.getSelection().anchorNode.parentNode.click()')
else: else:
try: try: