def javaScriptPrompt(self, frame, msg, default_value, *args): if self.view() is not None: return QWebPage.javaScriptPrompt(self, frame, msg, default_value, *args) if self.prompt_callback is None: return (False, default_value) if ispy3 else False value = self.prompt_callback(unicode(msg), unicode(default_value)) ok = value is not None if ispy3: return ok, value if ok: result = args[0] result.clear() result.append(value) return ok