diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 10691e465..7d05bfab5 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -88,6 +88,7 @@ MainApplication::MainApplication(int &argc, char** argv) , m_searchEnginesManager(0) , m_html5PermissionsManager(0) , m_desktopNotifications(0) + , m_webProfile(0) , m_autoSaver(0) , m_proxyStyle(0) , m_lastActiveWindow(0) @@ -576,6 +577,14 @@ DesktopNotificationsFactory* MainApplication::desktopNotifications() return m_desktopNotifications; } +QWebEngineProfile *MainApplication::webProfile() +{ + if (!m_webProfile) { + m_webProfile = m_isPrivate ? new QWebEngineProfile(this) : QWebEngineProfile::defaultProfile(); + } + return m_webProfile; +} + // static MainApplication* MainApplication::instance() { @@ -891,8 +900,6 @@ void MainApplication::loadSettings() #if QTWEBENGINE_DISABLED webSettings->setAttribute(QWebSettings::PrivateBrowsingEnabled, true); #endif - profile->setHttpCacheType(QWebEngineProfile::MemoryHttpCache); - profile->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies); history()->setSaving(false); } diff --git a/src/lib/app/mainapplication.h b/src/lib/app/mainapplication.h index ba3fb11bb..e7498f727 100644 --- a/src/lib/app/mainapplication.h +++ b/src/lib/app/mainapplication.h @@ -27,6 +27,7 @@ #include "qzcommon.h" class QMenu; +class QWebEngineProfile; class QNetworkAccessManager; class History; @@ -97,6 +98,7 @@ public: SearchEnginesManager* searchEnginesManager(); HTML5PermissionsManager* html5PermissionsManager(); DesktopNotificationsFactory* desktopNotifications(); + QWebEngineProfile* webProfile(); static MainApplication* instance(); @@ -161,6 +163,7 @@ private: SearchEnginesManager* m_searchEnginesManager; HTML5PermissionsManager* m_html5PermissionsManager; DesktopNotificationsFactory* m_desktopNotifications; + QWebEngineProfile* m_webProfile; AutoSaver* m_autoSaver; ProxyStyle* m_proxyStyle; diff --git a/src/lib/webkit/webpage.cpp b/src/lib/webkit/webpage.cpp index 4abd8e288..a77422ea8 100644 --- a/src/lib/webkit/webpage.cpp +++ b/src/lib/webkit/webpage.cpp @@ -71,7 +71,7 @@ QTime WebPage::s_lastUnsupportedUrlTime; QList WebPage::s_livingPages; WebPage::WebPage(QObject* parent) - : QWebEnginePage(parent) + : QWebEnginePage(mApp->webProfile(), parent) , m_view(0) , m_fileWatcher(0) , m_runningLoop(0)