From 7315712359ddbb1bcc37c3291daf1b1ad886b388 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 10 Jun 2014 16:49:56 +0200 Subject: [PATCH] Use statusbar to ask if long-running script should be interrupted. --- qutebrowser/browser/webpage.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qutebrowser/browser/webpage.py b/qutebrowser/browser/webpage.py index 014bd4b45..25a72b64d 100644 --- a/qutebrowser/browser/webpage.py +++ b/qutebrowser/browser/webpage.py @@ -184,3 +184,11 @@ class BrowserPage(QWebPage): """ filename, _ = QFileDialog.getOpenFileName(None, None, suggested_file) return filename + + def shouldInterruptJavaScript(self): + """Override shouldInterruptJavaScript to use the statusbar.""" + answer = message.modular_question("Interrupt long-running javascript?", + PromptMode.yesno) + if answer is None: + answer == True + return answer