if (reloadWebsite)
reload();
+ // Reset the HTTP authentication dialog counter.
+ httpAuthenticationDialogsDisplayed = 0;
+
// Update the UI.
emit updateUi(this);
}
void PrivacyWebEngineView::handleAuthenticationRequest(const QUrl &requestUrl, QAuthenticator *authenticatorPointer)
{
- // Instantiate an HTTP authentication dialog.
- HttpAuthenticationDialog *httpAuthenticationDialogPointer = new HttpAuthenticationDialog(parentWidget(), requestUrl, authenticatorPointer);
+ // Only display the HTTP authentication dialog if it hasn't already been displayed three times for this URL.
+ if (httpAuthenticationDialogsDisplayed < 3) {
+ // Increment the HTTP authentication dialog display counter.
+ ++httpAuthenticationDialogsDisplayed;
+
+ // Instantiate an HTTP authentication dialog.
+ HttpAuthenticationDialog *httpAuthenticationDialogPointer = new HttpAuthenticationDialog(parentWidget(), requestUrl, authenticatorPointer);
- // Display the dialog. This must be `exec()` instead of `show()` so that the website doesn't proceed before populating the authentication pointer.
- httpAuthenticationDialogPointer->exec();
+ // Display the dialog. This must be `exec()` instead of `show()` so that the website doesn't proceed before populating the authentication pointer.
+ httpAuthenticationDialogPointer->exec();
+ }
}
void PrivacyWebEngineView::removeCookieFromList(const QNetworkCookie &cookie) const
bool findCaseSensitive = false;
QString findString = QLatin1String("");
QWebEngineFindTextResult findTextResult = QWebEngineFindTextResult();
+ int httpAuthenticationDialogsDisplayed = 0;
bool isLoading = false;
int loadProgressInt = -1;
bool localStorageEnabled = false;
void TabWidget::refresh() const
{
+ // Reset the HTTP authentication dialog counter.
+ currentPrivacyWebEngineViewPointer->httpAuthenticationDialogsDisplayed = 0;
+
// Reload the website.
currentPrivacyWebEngineViewPointer->reload();
}