Closed Bug 1695050 Opened 4 years ago Closed 4 years ago

Make the CookieBehavior to be able to set for Private Browsing Mode

Categories

(Core :: Privacy: Anti-Tracking, task, P2)

task

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: timhuang, Assigned: timhuang)

References

Details

Attachments

(11 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Currently, Private Browsing Mode shares the setting of CookieBehavior with the regular browsing mode. We are going to provide a separate pref to control the CookieBehavior for the Private Browsing Mode.

Status: NEW → ASSIGNED

This patch adds a new function
CookieJarSettings::CreateForPrivateBrowsing() which should be used for
private browsing window to get the cookieJarSettings. It will get the
cookieBehavior from the pref 'network.cookie.cookieBehavior.pbmode' to
create the cookieJarSettings.

Depends on D109044

This patch updates the pref for existing content blocking tests. And it
also adds a new test to verify that the cookieBehavior in regular
windowa and private window are both correct.

Depends on D109045

This patch makes the service worker to use
CookieJarSettings::CreateForPrivateBrowsing() to create
CookieJarSettings for private browsing window.

Depends on D109046

This patch makes two changes to Necko. First, the loadInfo will use the
CookieJarSettings::CreateForPrivateBrowsing() to create the
cookieJarSettings if the loadInfo is for a private channel. Second, it
updates nsHttpChannel::ReEvaluateReferrerAfterTrackingStatusIsKnown() to
use this function if the channel is private.

Depends on D109047

This patch modifies the Document::CookieJarSettings() to use the
function when creating the cookieJarSettings for documents in the
private browsing window.

Depends on D109048

This patch modifies ReferrerInfo::GetDefaultReferrerPolicy() to use this
function in the private browsing window.

Depends on D109049

This patch makes the nsWebBrowserPersist to use this function to create
the cookieJarSettings if it is not present when the target is in the
private mode.

Depends on D109050

The WebExecutorSupport::CreateStreamLoader() would need the
cookieJarSettings. This patch makes it to use the function to get the
cookieJarSettings for the request from the private mode.

Depends on D109051

This patch makes the StoraeAccess.cpp to use the function to get the
cookieJarSettings for private browsing mode.

Depends on D109052

Tim, is there a plan to expose network.cookie.cookieBehavior.pbmode in the UI? That will determine whether or not we need any GV-specific code for this right now.

Flags: needinfo?(tihuang)

Thanks for raising this Dylan, we will expose the pref through the Standard mode labels showing the new default value, so there might be a need to update the labels in Fenix as well, depending on the value of this pref. What's the best way to surface that to your team?

Flags: needinfo?(tihuang) → needinfo?(droeh)

To add to this, we will not add a specific UI that will expose this pref to users, but only strings changes like what Johann mentioned above. And we will update the logic of ContentBlocking pref controller for ETP custom mode to ensure regular mode and pb mode will use the same CookieBehavior setting. I believe this part won't affect GV because there is no custom mode in GV. Do I understand it correctly?

Attachment #9210242 - Attachment description: Bug 1695050 - Part 2: Add CookieJarSettings::CreateForPrivateBrowsing() for PrivateBrowsingMode. r?dimi! → Bug 1695050 - Part 2: Modify CookieJarSettings::Create() to be able to creat cookieJarSettings according to the browsing mode. r?dimi!
Attachment #9210244 - Attachment description: Bug 1695050 - Part 4: Use CookieJarSettings::CreateForPrivateBrowsing() to create CookieJarSettings in Private mode for ServiceWorker. r?asuth! → Bug 1695050 - Part 4: Update the call-sites of CookieJarSettings::Create() for ServiceWorker and Worker. r?asuth!
Attachment #9210245 - Attachment description: Bug 1695050 - Part 5: Use CookieJarSettings::CreateForPrivateBrowsing() in private window for Necko. r?dimi → Bug 1695050 - Part 5: Update the call-sites of CookieJarSettings::Create() for Necko. r?dimi
Attachment #9210247 - Attachment description: Bug 1695050 - Part 6: Use CookieJarSettings::CreateForPrivateBrowsing() in private window when getting cookieJarSettings from documents. r?dimi! → Bug 1695050 - Part 6: Update the call-site of CookieJarSettings::Create() for Document. r?dimi!
Attachment #9210248 - Attachment description: Bug 1695050 - Part 7: Use CookieJarSettings::CreateForPrivateBrowsing() in private window for ReferrerInfo. r?ckerschb! → Bug 1695050 - Part 7: Update the call-site of CookieJarSettings::Create() for ReferrerInfo. r?ckerschb!
Attachment #9210249 - Attachment description: Bug 1695050 - Part 8: Use CookieJarSettings::CreateForPrivateBrowsing() in private window for WebBrowserPersist. r?smaug! → Bug 1695050 - Part 8: Update the call-site of CookieJarSettings::Create() for WebBrowserPersist. r?smaug!
Attachment #9210250 - Attachment description: Bug 1695050 - Part 9: Use CookieJarSettings::CreateForPrivateBrowsing() in private window for WebExecutorSupport. r?esawin → Bug 1695050 - Part 9: Update the call-site of CookieJarSettings::Create() for WebExecutorSupport. r?esawin
Attachment #9210251 - Attachment description: Bug 1695050 - Part 10: Use CookieJarSettings::CreateForPrivateBrowsing() in private window for StorageAccess. r?dimi! → Bug 1695050 - Part 10: Updates the call-sites of CookieJarSettings::Create() for StorageAccess. r?dimi!
Attachment #9210252 - Attachment description: Bug 1695050 - Part 11: Use CookieJarSettings::CreateForPrivateBrowsing() in private mode for Fetch and XHR. r?smaug! → Bug 1695050 - Part 11: Update the call-sites of CookieJarSettings::Create() for Fetch and XHR. r?smaug!

(In reply to Tim Huang[:timhuang] from comment #14)

To add to this, we will not add a specific UI that will expose this pref to users, but only strings changes like what Johann mentioned above. And we will update the logic of ContentBlocking pref controller for ETP custom mode to ensure regular mode and pb mode will use the same CookieBehavior setting. I believe this part won't affect GV because there is no custom mode in GV. Do I understand it correctly?

There is actually a custom mode in Fenix, so it sounds like we'll need a bit more than string changes here.

(In reply to Johann Hofmann [:johannh] from comment #13)

Thanks for raising this Dylan, we will expose the pref through the Standard mode labels showing the new default value, so there might be a need to update the labels in Fenix as well, depending on the value of this pref. What's the best way to surface that to your team?

The best place to discuss is probably the Mobile Privacy & Security meeting -- and happily, we have one scheduled tomorrow. I'll make sure this gets on the agenda, and it looks like you're already on the invite list as an optional attendee (Tim, I can invite you as well if you'd like). Let me know if that sounds good.

Flags: needinfo?(droeh) → needinfo?(jhofmann)

Thanks Dylan, let's do that

We will slightly adjust the Fenix privacy preferences for this change, the same way that desktop will adjust in bug 1698845. Arturo and Dylan are taking care of that (thank you!).

Flags: needinfo?(jhofmann)
Pushed by tihuang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/59cda3c92f48 Part 1: Add a pref for controlling the cookieBehavior for Private Brwosing Mode. r=dimi,droeh https://hg.mozilla.org/integration/autoland/rev/201f0d5fabd6 Part 2: Modify CookieJarSettings::Create() to be able to creat cookieJarSettings according to the browsing mode. r=dimi,preferences-reviewers https://hg.mozilla.org/integration/autoland/rev/2c746f95236c Part 3: Update current test cases and add a new test case. r=dimi https://hg.mozilla.org/integration/autoland/rev/fd4e2d13a749 Part 4: Update the call-sites of CookieJarSettings::Create() for ServiceWorker and Worker. r=asuth https://hg.mozilla.org/integration/autoland/rev/6e1a1d6a17aa Part 5: Update the call-sites of CookieJarSettings::Create() for Necko. r=dimi,necko-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/b9126a85e2b6 Part 6: Update the call-site of CookieJarSettings::Create() for Document. r=dimi https://hg.mozilla.org/integration/autoland/rev/b3e24bec0318 Part 7: Update the call-site of CookieJarSettings::Create() for ReferrerInfo. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/ad8f1d20bcf5 Part 8: Update the call-site of CookieJarSettings::Create() for WebBrowserPersist. r=smaug https://hg.mozilla.org/integration/autoland/rev/964aae74959d Part 9: Update the call-site of CookieJarSettings::Create() for WebExecutorSupport. r=esawin https://hg.mozilla.org/integration/autoland/rev/1d853acaddcd Part 10: Updates the call-sites of CookieJarSettings::Create() for StorageAccess. r=dimi https://hg.mozilla.org/integration/autoland/rev/3f59f1f2aa57 Part 11: Update the call-sites of CookieJarSettings::Create() for Fetch and XHR. r=smaug
Depends on: 1701919
Regressions: 1701919
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: