diff --git a/qutebrowser/utils/usertypes.py b/qutebrowser/utils/usertypes.py index 40ec1c4a6..4e67a2eac 100644 --- a/qutebrowser/utils/usertypes.py +++ b/qutebrowser/utils/usertypes.py @@ -407,6 +407,9 @@ class Question(QObject): @pyqtSlot() def abort(self): """Abort the question.""" + if self.is_aborted: + log.misc.debug("Question was already aborted") + return self.is_aborted = True try: self.aborted.emit() diff --git a/tests/end2end/features/prompts.feature b/tests/end2end/features/prompts.feature index 9853b6176..fe39a90be 100644 --- a/tests/end2end/features/prompts.feature +++ b/tests/end2end/features/prompts.feature @@ -452,3 +452,18 @@ Feature: Prompts "authenticated": true, "user": "user2" } + + # https://github.com/The-Compiler/qutebrowser/issues/1249#issuecomment-175205531 + # https://github.com/The-Compiler/qutebrowser/pull/2054#issuecomment-258285544 + Scenario: Interrupting SSL prompt during a notification prompt + When I set content -> notifications to ask + And I set network -> ssl-strict to ask + And I open data/prompt/notifications.html in a new tab + And I run :click-element id button + And I wait for a prompt + And I open about:blank in a new tab + And I load an SSL page + And I wait for a prompt + And I run :tab-close + And I run :prompt-accept yes + Then the javascript message "notification permission granted" should be logged