def shouldInterruptJavaScript(self): if self.view() is not None: return QWebPage.shouldInterruptJavaScript(self) return True