Skip to content

Commit

Permalink
Adapt tests to the updated navigator.cookieEnabled behavior.
Browse files Browse the repository at this point in the history
Chromium change:
commit 2c885728f29b653f404e6a42da86b19e055def72
Author: Ari Chivukula <arichiv@chromium.org>
Date:   Mon May 6 20:03:59 2024 +0000

    [CookieEnabled] Align with spec

    navigator.cookieEnabled currently indicates if “the user agent attempts
    to handle cookies” in a given context. A change in Chrome, shipping as
    part of third-party cookie deprecation (3PCD), would cause it to
    indicate whether unpartitioned cookie access is possible (causing it to
    return false in most cross-site iframes). We should restore the prior
    behavior of navigator.cookieEnabled which indicated only if cookies were
    enabled/disabled for the site and rely on the cross-vendor function
    document.hasStorageAccess to indicate if unpartitioned cookie access is
    possible.

    whatwg/html#10256
    https://chromestatus.com/feature/6227655153418240
    https://groups.google.com/a/chromium.org/g/blink-dev/c/xU3gTW4aTfg

    Bug: 335553590
    Change-Id: I6cc1f2a9caea6220b6f85240ae9875a65a91d179
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5464207
    Commit-Queue: Daniel Cheng <dcheng@chromium.org>
    Auto-Submit: Ari Chivukula <arichiv@chromium.org>
    Reviewed-by: Jonathan Njeunje <njeunje@chromium.org>
    Reviewed-by: Daniel Cheng <dcheng@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1297071}
  • Loading branch information
goodov committed May 13, 2024
1 parent 55aec28 commit 1e6cb20
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -66,7 +66,7 @@
const readStorageAction = async key => {
const result = Object.create(null)
try {
if (W.navigator.cookieEnabled === false) {
if (W.navigator.cookieEnabled === false || !await W.document.hasStorageAccess()) {
result.cookies = exceptionEncoding
} else {
const readCookieValue = C.get(key)
Expand Down

0 comments on commit 1e6cb20

Please sign in to comment.