зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1915383 - Fix browser_storage_dfpi.js for third-party cookie blocking. r=bvandersloot,devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D220665
This commit is contained in:
Родитель
a9d1f17489
Коммит
52e9793cdc
|
@ -69,13 +69,21 @@ async function setPartitionedStorage(browser, type, key) {
|
|||
content.localStorage.setItem(storageKey, storageValue);
|
||||
};
|
||||
|
||||
const thirdPartyHandler = async (storageType, storageKey, storageValue) => {
|
||||
if (storageType == "cookie") {
|
||||
content.document.cookie = `${storageKey}=${storageValue}; SameSite=None; Secure; Partitioned;`;
|
||||
return;
|
||||
}
|
||||
content.localStorage.setItem(storageKey, storageValue);
|
||||
};
|
||||
|
||||
// Set first party storage.
|
||||
await SpecialPowers.spawn(browser, [type, key, "first"], handler);
|
||||
// Set third-party (partitioned) storage in the iframe.
|
||||
await SpecialPowers.spawn(
|
||||
browser.browsingContext.children[0],
|
||||
[type, key, "third"],
|
||||
handler
|
||||
thirdPartyHandler
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче