From: Soren Stoutner Date: Mon, 11 Apr 2022 22:07:58 +0000 (-0700) Subject: Use an off-the-record profile. https://redmine.stoutner.com/issues/825 X-Git-Tag: v0.1~40 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=a790b1b5d9b18f385ebbdf84e5845a40b2089d5c;p=PrivacyBrowserPC.git Use an off-the-record profile. https://redmine.stoutner.com/issues/825 --- diff --git a/src/views/BrowserView.cpp b/src/views/BrowserView.cpp index edcd26c..fb2473a 100644 --- a/src/views/BrowserView.cpp +++ b/src/views/BrowserView.cpp @@ -43,10 +43,17 @@ BrowserView::BrowserView(QWidget *parent) : QWidget(parent) // Get handles for the views. webEngineViewPointer = browserViewUi.webEngineView; + // Create an off-the-record profile (the default when no profile name is specified). + webEngineProfilePointer = new QWebEngineProfile(QStringLiteral("")); + + // Create a WebEngine page. + QWebEnginePage *webEnginePagePointer = new QWebEnginePage(webEngineProfilePointer); + + // Set the WebEngine page. + webEngineViewPointer->setPage(webEnginePagePointer); + // Get handles for the aspects of the WebEngine. - QWebEnginePage *webEnginePagePointer = webEngineViewPointer->page(); webEngineHistoryPointer = webEnginePagePointer->history(); - webEngineProfilePointer = webEnginePagePointer->profile(); webEngineSettingsPointer = webEngineViewPointer->settings(); // Update the URL line edit when the URL changes. @@ -75,9 +82,6 @@ BrowserView::BrowserView(QWidget *parent) : QWidget(parent) // Reapply the domain settings when the host changes. connect(urlRequestInterceptorPointer, SIGNAL(applyDomainSettings(QString)), this, SLOT(applyDomainSettingsWithoutReloading(QString))); - // Disable the cache. - webEngineProfilePointer->setHttpCacheType(QWebEngineProfile::NoCache); - // Don't allow JavaScript to open windows. webEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, false);