def javaScriptConfirm(self, frame, msg): """Handle javascript confirm() dialogs. Overridden from QWebPage so that we can (if configured) force yes/no on these dialogs. """ if self.config.get("force_js_confirm") == "accept": return True elif self.config.get("force_js_confirm") == "deny": return False else: return QWebPage.javaScriptConfirm(self, frame, msg)
def javaScriptConfirm(self, frame, msg): if self.view() is not None: return QWebPage.javaScriptConfirm(self, frame, msg) if self.confirm_callback is not None: return self.confirm_callback(unicode(msg)) return True
def _javascript_confirm(self, webframe, message): print "_javascript_confirm" return QWebPage.javaScriptConfirm(self.WebView.page(), webframe, message)