diff options
| author | Michal Klocek <michal.klocek@qt.io> | 2021-06-02 19:40:10 +0200 |
|---|---|---|
| committer | Michal Klocek <michal.klocek@qt.io> | 2021-06-25 01:33:45 +0200 |
| commit | d0ff107c0096fa0e0347ddadda9a98438d27631e (patch) | |
| tree | c11519ed00eeff9092c83401b2b337a507aa9815 /src | |
| parent | a5e627160cf9a05ce0dd92e541d44b1861eb84c0 (diff) | |
Make default profile off the record
Make default profile otr, this prevents accessing
data cache which could be created by older other
version of Chromium. Allow to register a protocol
handler on ort profile.
[ChangeLog][QtWebEngineCore] Default profile is off-the-record
Off-the-record profile can have registered protocol handlers.
Task-number: QTBUG-66068
Pick-to: 6.2
Change-Id: Ief202de5c6734d293cb64d83ad447b1eba19e9a4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/api/qwebengineprofile.cpp | 2 | ||||
| -rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 4 | ||||
| -rw-r--r-- | src/core/web_engine_context.cpp | 2 |
3 files changed, 2 insertions, 6 deletions
diff --git a/src/core/api/qwebengineprofile.cpp b/src/core/api/qwebengineprofile.cpp index 40f9ca9d4..13ad0f992 100644 --- a/src/core/api/qwebengineprofile.cpp +++ b/src/core/api/qwebengineprofile.cpp @@ -666,7 +666,7 @@ std::function<void(std::unique_ptr<QWebEngineNotification>)> QWebEngineProfile:: /*! Returns the default profile. - The default profile uses the storage name "Default". + The default profile is off-the-record. \sa storageName() */ diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index a04ef700b..afa48a5b1 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -794,8 +794,6 @@ bool WebContentsDelegateQt::CheckMediaAccessPermission(content::RenderFrameHost void WebContentsDelegateQt::RegisterProtocolHandler(content::RenderFrameHost *frameHost, const std::string &protocol, const GURL &url, bool) { content::BrowserContext *context = frameHost->GetBrowserContext(); - if (context->IsOffTheRecord()) - return; ProtocolHandler handler = ProtocolHandler::CreateProtocolHandler(protocol, url); @@ -813,8 +811,6 @@ void WebContentsDelegateQt::RegisterProtocolHandler(content::RenderFrameHost *fr void WebContentsDelegateQt::UnregisterProtocolHandler(content::RenderFrameHost *frameHost, const std::string &protocol, const GURL &url, bool) { content::BrowserContext* context = frameHost->GetBrowserContext(); - if (context->IsOffTheRecord()) - return; ProtocolHandler handler = ProtocolHandler::CreateProtocolHandler(protocol, url); diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 83abd17b6..3806d3e7e 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -525,7 +525,7 @@ ProfileAdapter *WebEngineContext::createDefaultProfileAdapter() { Q_ASSERT(!m_destroyed); if (!m_defaultProfileAdapter) { - ProfileAdapter *profile = new ProfileAdapter(QStringLiteral("Default")); + ProfileAdapter *profile = new ProfileAdapter(); // profile when added to m_profileAdapters might be set default // profile in case of single-process if (!m_defaultProfileAdapter) |
