diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 165823b99..622e255f9 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -36,6 +36,8 @@ Fixed - Fixed starting with -c "". - Fixed crash when a tab is closed twice via javascript (e.g. Dropbox authentication dialogs) +- Fixed crash when a notification/geolocation prompt is answered after closing + the tab it belongs to. v0.5.1 ------ diff --git a/qutebrowser/browser/webpage.py b/qutebrowser/browser/webpage.py index 49a77cc8c..2946f4f12 100644 --- a/qutebrowser/browser/webpage.py +++ b/qutebrowser/browser/webpage.py @@ -372,6 +372,7 @@ class BrowserPage(QWebPage): q.answered_no.connect(no_action) q.cancelled.connect(no_action) + self.shutting_down.connect(q.abort) q.completed.connect(q.deleteLater) self.featurePermissionRequestCanceled.connect(functools.partial( diff --git a/tests/integration/features/prompts.feature b/tests/integration/features/prompts.feature index d3f77f6da..f00c1184d 100644 --- a/tests/integration/features/prompts.feature +++ b/tests/integration/features/prompts.feature @@ -178,6 +178,15 @@ Feature: Prompts And I run :leave-mode Then the javascript message "notification permission aborted" should be logged + Scenario: answering notification after closing tab + When I set content -> notifications to ask + And I open data/prompt/notifications.html in a new tab + And I click the button + And I wait for a prompt + And I run :tab-close + And I wait for "Leaving mode KeyMode.yesno (reason: aborted)" in the log + Then no crash should happen + # Page authentication Scenario: Successful webpage authentification