Prevent questions from being aborted twice

When we abort a question (e.g. by closing a tab with SSL errors) while
another prompt is queued, the right prompt gets closed by the question
being aborted, but that in turn aborts the question again, affecting the
next prompt.
This commit is contained in:
Florian Bruhin 2016-11-04 13:21:22 +01:00
parent 15de465dbe
commit 7256641288
2 changed files with 18 additions and 0 deletions

View File

@ -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()

View File

@ -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