webEnginePagePointer->deleteLater();
}
+// The cookie is copied instead of referenced so that changes made to the cookie do not create a race condition with the display of the cookie in the dialog.
+void BrowserView::addCookieToStore(QNetworkCookie cookie) const
+{
+ // Create a url.
+ QUrl url;
+
+ // Check to see if the domain does not start with a `.` because Qt makes this harder than it should be. <https://doc.qt.io/qt-5/qwebenginecookiestore.html#setCookie>
+ if (!cookie.domain().startsWith(QStringLiteral(".")))
+ {
+ // Populate the URL.
+ url.setHost(cookie.domain());
+ url.setScheme(QStringLiteral("https"));
+
+ // Clear the domain from the cookie.
+ cookie.setDomain(QStringLiteral(""));
+ }
+
+ // Add the cookie to the store.
+ webEngineCookieStorePointer->setCookie(cookie, url);
+}
+
void BrowserView::applyApplicationSettings()
{
// Set the search engine URL.