mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1543314 - Cookies should be sent to the content process also for first-party channels when cookieBehavior is set to 2, r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D26859 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
6ac6c635da
commit
ddda66db66
@ -140,8 +140,8 @@ void CookieServiceParent::TrackCookieLoad(nsIChannel *aChannel) {
|
||||
// Check first-party storage access even for non-tracking resources, since
|
||||
// we will need the result when computing the access rights for the reject
|
||||
// foreign cookie behavior mode.
|
||||
if (isForeign && AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
|
||||
httpChannel, uri, nullptr)) {
|
||||
if (AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(httpChannel,
|
||||
uri, nullptr)) {
|
||||
storageAccessGranted = true;
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ support-files =
|
||||
3rdPartyOpen.html
|
||||
3rdPartyOpenUI.html
|
||||
empty.js
|
||||
empty.html
|
||||
popup.html
|
||||
server.sjs
|
||||
storageAccessAPIHelpers.js
|
||||
@ -85,3 +86,4 @@ support-files = localStorage.html
|
||||
support-files = localStorageEvents.html
|
||||
[browser_workerPropagation.js]
|
||||
support-files = workerIframe.html
|
||||
[browser_cookieBetweenTabs.js]
|
||||
|
@ -0,0 +1,44 @@
|
||||
add_task(async function() {
|
||||
await SpecialPowers.flushPrefEnv();
|
||||
await SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.storage_access.enabled", true],
|
||||
["network.cookie.cookieBehavior", BEHAVIOR_REJECT],
|
||||
["privacy.trackingprotection.enabled", false],
|
||||
["privacy.trackingprotection.pbmode.enabled", false],
|
||||
["privacy.trackingprotection.annotate_channels", true],
|
||||
["dom.ipc.processCount", 4],
|
||||
]});
|
||||
|
||||
info("First tab opened");
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, TEST_DOMAIN + TEST_PATH + "empty.html");
|
||||
gBrowser.selectedTab = tab;
|
||||
|
||||
let browser = gBrowser.getBrowserForTab(tab);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
info("Disabling content blocking for this page");
|
||||
ContentBlocking.disableForCurrentPage();
|
||||
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
await ContentTask.spawn(browser, null, async _ => {
|
||||
is(content.document.cookie, "", "No cookie set");
|
||||
content.document.cookie = "a=b";
|
||||
is(content.document.cookie, "a=b", "Cookie set");
|
||||
});
|
||||
|
||||
info("Second tab opened");
|
||||
let tab2 = BrowserTestUtils.addTab(gBrowser, TEST_DOMAIN + TEST_PATH + "empty.html");
|
||||
gBrowser.selectedTab = tab2;
|
||||
|
||||
let browser2 = gBrowser.getBrowserForTab(tab2);
|
||||
await BrowserTestUtils.browserLoaded(browser2);
|
||||
|
||||
await ContentTask.spawn(browser2, null, async _ => {
|
||||
is(content.document.cookie, "a=b", "Cookie set");
|
||||
});
|
||||
|
||||
info("Removing tabs");
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
BrowserTestUtils.removeTab(tab2);
|
||||
});
|
1
toolkit/components/antitracking/test/browser/empty.html
Normal file
1
toolkit/components/antitracking/test/browser/empty.html
Normal file
@ -0,0 +1 @@
|
||||
<h1>Empty</h1>
|
Loading…
Reference in New Issue
Block a user