예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
파일: browser.py 프로젝트: kba/calibre
 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
예제 #4
0
 def _javascript_confirm(self, webframe, message):
     print "_javascript_confirm"
     return QWebPage.javaScriptConfirm(self.WebView.page(), webframe, message)