From 1e2e976342ec5b9ac98dd54827efe5be602e400f Mon Sep 17 00:00:00 2001 From: Ari Chivukula Date: Tue, 30 Apr 2024 07:28:55 -0400 Subject: [PATCH 01/10] Create index.md --- .../en-us/web/api/document/hasunpartitionedcookieaccess/index.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 files/en-us/web/api/document/hasunpartitionedcookieaccess/index.md diff --git a/files/en-us/web/api/document/hasunpartitionedcookieaccess/index.md b/files/en-us/web/api/document/hasunpartitionedcookieaccess/index.md new file mode 100644 index 000000000000000..8b137891791fe96 --- /dev/null +++ b/files/en-us/web/api/document/hasunpartitionedcookieaccess/index.md @@ -0,0 +1 @@ + From cc5574bfd21ddec49652de0a35c89f7d9d9e39ac Mon Sep 17 00:00:00 2001 From: Ari Chivukula Date: Tue, 30 Apr 2024 11:47:01 +0000 Subject: [PATCH 02/10] content --- .../api/document/hasstorageaccess/index.md | 4 +- .../hasunpartitionedcookieaccess/index.md | 64 +++++++++++++++++++ files/en-us/web/api/document/index.md | 2 + .../document/requeststorageaccess/index.md | 2 +- .../document/requeststorageaccessfor/index.md | 2 +- .../en-us/web/api/storage_access_api/index.md | 3 + files/jsondata/GroupData.json | 1 + 7 files changed, 75 insertions(+), 3 deletions(-) diff --git a/files/en-us/web/api/document/hasstorageaccess/index.md b/files/en-us/web/api/document/hasstorageaccess/index.md index c9259cad9519126..1b5fd8d85c6a53f 100644 --- a/files/en-us/web/api/document/hasstorageaccess/index.md +++ b/files/en-us/web/api/document/hasstorageaccess/index.md @@ -12,6 +12,8 @@ The **`hasStorageAccess()`** method of the {{domxref("Document")}} interface ret This method is part of the [Storage Access API](/en-US/docs/Web/API/Storage_Access_API). +This method may be available under the new name {{DOMxRef("Document.hasUnpartitionedCookieAccess()")}}. + ## Syntax ```js-nolint @@ -63,6 +65,6 @@ document.hasStorageAccess().then((hasAccess) => { ## See also -- {{domxref("Document.requestStorageAccess()")}}, {{domxref("Document.requestStorageAccessFor()")}} +- {{domxref("Document.hasUnpartitionedCookieAccess()")}}, {{domxref("Document.requestStorageAccess()")}}, {{domxref("Document.requestStorageAccessFor()")}} - [Using the Storage Access API](/en-US/docs/Web/API/Storage_Access_API/Using) - [Introducing Storage Access API](https://webkit.org/blog/8124/introducing-storage-access-api/) (WebKit blog) diff --git a/files/en-us/web/api/document/hasunpartitionedcookieaccess/index.md b/files/en-us/web/api/document/hasunpartitionedcookieaccess/index.md index 8b137891791fe96..102c99aab2c2c6b 100644 --- a/files/en-us/web/api/document/hasunpartitionedcookieaccess/index.md +++ b/files/en-us/web/api/document/hasunpartitionedcookieaccess/index.md @@ -1 +1,65 @@ +--- +title: "Document: hasUnpartitionedCookieAccess() method" +short-title: hasUnpartitionedCookieAccess() +slug: Web/API/Document/hasUnpartitionedCookieAccess +page-type: web-api-instance-method +browser-compat: api.Document.hasUnpartitionedCookieAccess +--- +{{APIRef("Storage Access API")}} + +The **`hasUnpartitionedCookieAccess()`** method of the {{domxref("Document")}} interface returns a {{jsxref("Promise")}} that resolves with a boolean value indicating whether the document has access to [third-party](/en-US/docs/Web/HTTP/Cookies#third-party_cookies), [unpartitioned](/en-US/docs/Web/API/Storage_Access_API#unpartitioned_versus_partitioned_cookies) cookies. + +This method is part of the [Storage Access API](/en-US/docs/Web/API/Storage_Access_API). + +This method is a new name for {{DOMxRef("Document.hasStorageAccess()")}}. + +## Syntax + +```js-nolint +hasUnpartitionedCookieAccess() +``` + +### Parameters + +None. + +### Return value + +A {{jsxref("Promise")}} that resolves with a boolean value indicating whether the document has access to third-party cookies — `true` if it does, and `false` if not. + +See {{DOMxRef("Document.hasStorageAccess()")}} for more details. + +### Exceptions + +- `InvalidStateError` {{domxref("DOMException")}} + - : Thrown if the current {{domxref("Document")}} is not yet active. + +## Examples + +```js +document.hasUnpartitionedCookieAccess().then((hasAccess) => { + if (hasAccess) { + // storage access has been granted already. + } else { + // storage access hasn't been granted already; + // you may want to call requestStorageAccess(). + } +}); +``` + +> **Note:** See [Using the Storage Access API](/en-US/docs/Web/API/Storage_Access_API/Using) for a more complete example. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{domxref("Document.hasStorageAccess()")}}, {{domxref("Document.requestStorageAccess()")}}, {{domxref("Document.requestStorageAccessFor()")}} +- [Using the Storage Access API](/en-US/docs/Web/API/Storage_Access_API/Using) +- [Introducing Storage Access API](https://webkit.org/blog/8124/introducing-storage-access-api/) (WebKit blog) diff --git a/files/en-us/web/api/document/index.md b/files/en-us/web/api/document/index.md index 63dadf4833643c9..fe6c4d059dcaf0e 100644 --- a/files/en-us/web/api/document/index.md +++ b/files/en-us/web/api/document/index.md @@ -240,6 +240,8 @@ _This interface also inherits from the {{DOMxRef("Node")}} and {{DOMxRef("EventT - : Returns a {{DOMxRef('Selection')}} object representing the range of text selected by the user, or the current position of the caret. - {{DOMxRef("Document.hasStorageAccess()")}} - : Returns a {{jsxref("Promise")}} that resolves with a boolean value indicating whether the document has access to unpartitioned cookies. +- {{DOMxRef("Document.hasUnpartitionedCookieAccess()")}} + - : New name for {{DOMxRef("Document.hasStorageAccess()")}}. - {{DOMxRef("Document.importNode()")}} - : Returns a clone of a node from an external document. - {{DOMxRef("Document.mozSetImageElement()")}} {{Non-standard_Inline}} diff --git a/files/en-us/web/api/document/requeststorageaccess/index.md b/files/en-us/web/api/document/requeststorageaccess/index.md index 1a96b61f79d78f3..4b49da6b380c7cd 100644 --- a/files/en-us/web/api/document/requeststorageaccess/index.md +++ b/files/en-us/web/api/document/requeststorageaccess/index.md @@ -70,6 +70,6 @@ document.requestStorageAccess().then( ## See also -- {{domxref("Document.hasStorageAccess()")}}, {{domxref("Document.requestStorageAccessFor()")}} +- {{domxref("Document.hasStorageAccess()")}}, {{domxref("Document.hasUnpartitionedCookieAccess()")}}, {{domxref("Document.requestStorageAccessFor()")}} - [Using the Storage Access API](/en-US/docs/Web/API/Storage_Access_API/Using) - [Introducing Storage Access API](https://webkit.org/blog/8124/introducing-storage-access-api/) (WebKit blog) diff --git a/files/en-us/web/api/document/requeststorageaccessfor/index.md b/files/en-us/web/api/document/requeststorageaccessfor/index.md index 43801b89d906e27..6da894745b1b706 100644 --- a/files/en-us/web/api/document/requeststorageaccessfor/index.md +++ b/files/en-us/web/api/document/requeststorageaccessfor/index.md @@ -115,6 +115,6 @@ function checkCookie() { ## See also -- {{domxref("Document.hasStorageAccess()")}}, {{domxref("Document.requestStorageAccess()")}} +- {{domxref("Document.hasStorageAccess()")}}, {{domxref("Document.hasUnpartitionedCookieAccess()")}}, {{domxref("Document.requestStorageAccess()")}} - [Using the Storage Access API](/en-US/docs/Web/API/Storage_Access_API/Using) - [Introducing Storage Access API](https://webkit.org/blog/8124/introducing-storage-access-api/) (WebKit blog) diff --git a/files/en-us/web/api/storage_access_api/index.md b/files/en-us/web/api/storage_access_api/index.md index 4fdbcc6af0a0fd2..053faf060d675f1 100644 --- a/files/en-us/web/api/storage_access_api/index.md +++ b/files/en-us/web/api/storage_access_api/index.md @@ -4,6 +4,7 @@ slug: Web/API/Storage_Access_API page-type: web-api-overview browser-compat: - api.Document.hasStorageAccess + - api.Document.hasUnpartitionedCookieAccess - api.Document.requestStorageAccess - api.Document.requestStorageAccessFor - api.Permissions.permission_storage-access @@ -118,6 +119,8 @@ Documentation for Firefox's new storage access policy for blocking tracking cook - {{domxref("Document.hasStorageAccess()")}} - : Returns a {{jsxref("Promise")}} that resolves with a boolean value indicating whether the document has access to third-party cookies. +- {{domxref("Document.hasUnpartitionedCookieAccess()")}} + - : New name for {{domxref("Document.hasStorageAccess()")}}. - {{domxref("Document.requestStorageAccess()")}} - : Allows content loaded in a third-party context (i.e., embedded in an {{htmlelement("iframe")}}) to request access to third-party cookies; returns a {{jsxref("Promise")}} that resolves if the access was granted, and rejects if access was denied. - {{domxref("Document.requestStorageAccessFor()")}} {{experimental_inline}} diff --git a/files/jsondata/GroupData.json b/files/jsondata/GroupData.json index 80e07c9cd1497a2..d976a2d8121f5c3 100644 --- a/files/jsondata/GroupData.json +++ b/files/jsondata/GroupData.json @@ -1425,6 +1425,7 @@ "interfaces": [], "methods": [ "Document.hasStorageAccess()", + "Document.hasUnpartitionedCookieAccess()", "Document.requestStorageAccess()", "Document.requestStorageAccessFor()" ], From 4e63c08a18043a9ba0ac35cd47b922da79abb9a2 Mon Sep 17 00:00:00 2001 From: Ari Chivukula Date: Tue, 30 Apr 2024 11:49:10 +0000 Subject: [PATCH 03/10] new spec --- files/en-us/web/api/storage_access_api/index.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/en-us/web/api/storage_access_api/index.md b/files/en-us/web/api/storage_access_api/index.md index 053faf060d675f1..c49fbb0a1df953b 100644 --- a/files/en-us/web/api/storage_access_api/index.md +++ b/files/en-us/web/api/storage_access_api/index.md @@ -8,7 +8,9 @@ browser-compat: - api.Document.requestStorageAccess - api.Document.requestStorageAccessFor - api.Permissions.permission_storage-access -spec-urls: https://privacycg.github.io/storage-access/ +spec-urls: + - https://privacycg.github.io/storage-access/ + - https://privacycg.github.io/saa-non-cookie-storage/ --- {{DefaultAPISidebar("Storage Access API")}} From 263cfe22b3f00a3b365786a28df6eb119c24e92b Mon Sep 17 00:00:00 2001 From: Ari Chivukula Date: Fri, 3 May 2024 10:44:45 +0000 Subject: [PATCH 04/10] fix --- files/en-us/web/api/storage_access_api/index.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/files/en-us/web/api/storage_access_api/index.md b/files/en-us/web/api/storage_access_api/index.md index 3962014c14d0d5a..e798e06068d0e14 100644 --- a/files/en-us/web/api/storage_access_api/index.md +++ b/files/en-us/web/api/storage_access_api/index.md @@ -8,9 +8,7 @@ browser-compat: - api.Document.requestStorageAccess - api.Document.requestStorageAccessFor - api.Permissions.permission_storage-access -spec-urls: - - https://privacycg.github.io/storage-access/ - - https://privacycg.github.io/saa-non-cookie-storage/ +spec-urls: https://privacycg.github.io/storage-access/ --- {{DefaultAPISidebar("Storage Access API")}} From 452e72c7fa356e7cd5a70435fc910e4cd4c0069d Mon Sep 17 00:00:00 2001 From: Ari Chivukula Date: Fri, 3 May 2024 10:47:51 +0000 Subject: [PATCH 05/10] fix --- files/en-us/web/api/storage_access_api/index.md | 4 +++- yarn.lock | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/files/en-us/web/api/storage_access_api/index.md b/files/en-us/web/api/storage_access_api/index.md index e798e06068d0e14..3962014c14d0d5a 100644 --- a/files/en-us/web/api/storage_access_api/index.md +++ b/files/en-us/web/api/storage_access_api/index.md @@ -8,7 +8,9 @@ browser-compat: - api.Document.requestStorageAccess - api.Document.requestStorageAccessFor - api.Permissions.permission_storage-access -spec-urls: https://privacycg.github.io/storage-access/ +spec-urls: + - https://privacycg.github.io/storage-access/ + - https://privacycg.github.io/saa-non-cookie-storage/ --- {{DefaultAPISidebar("Storage Access API")}} diff --git a/yarn.lock b/yarn.lock index fb17d03d011584b..db5580146ce5d24 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7884,9 +7884,9 @@ web-namespaces@^2.0.0: integrity sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ== web-specs@^3.8.0: - version "3.8.0" - resolved "https://registry.yarnpkg.com/web-specs/-/web-specs-3.8.0.tgz#8ec021ff94abee98db5491a8ed3c595de3f17293" - integrity sha512-tAJgIFOgHHAQiorvKW8gMCzrTDBzT+wThaXduQswmFuiMbKtQZQtBobQ74v4nIUKgPlIHi/e8ypYptcQ4OblKg== + version "3.9.0" + resolved "https://registry.yarnpkg.com/web-specs/-/web-specs-3.9.0.tgz#c6dfe2a15c272613fbc3b978b71510a77d0b4ccf" + integrity sha512-DJG4kyzB96cOQ7VMSGQYOFGBRQ+YlqY6lIm1TWaj07WBZc1OIj9xBcgZnzFaBMaXc281Gspvnnh53Xt9+qWTeA== web-streams-polyfill@4.0.0-beta.3: version "4.0.0-beta.3" From 48a279149dafb1dfdc99f767bd29b8e96138bea2 Mon Sep 17 00:00:00 2001 From: Ari Chivukula Date: Sun, 5 May 2024 17:47:53 +0000 Subject: [PATCH 06/10] fix --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index db5580146ce5d24..18b02550a4288a1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -766,9 +766,9 @@ integrity sha512-IHkkypEjlIkBkx4mJ2//Xbzog9M/Lzne1Sl8db2cIHJ/5pe3NCqSLwSchmqzcUN+/WJr/U+V3tNAbWunk2xZcA== "@mdn/browser-compat-data@^5.5.23": - version "5.5.24" - resolved "https://registry.yarnpkg.com/@mdn/browser-compat-data/-/browser-compat-data-5.5.24.tgz#b66ffc3c114f37a476c1f0c44d0e31a5305070ea" - integrity sha512-8z/7mkez6xKhbUtmwVRrSuZ28wv3VpOWVvA8ykdovbC5kFyxlJ2QWsfRjpe+f50tirdPC7hN7TZO5eZfTvUqhg== + version "5.5.25" + resolved "https://registry.yarnpkg.com/@mdn/browser-compat-data/-/browser-compat-data-5.5.25.tgz#80b86ce0211d16ac6b7de92b1d8bbeb3306d2432" + integrity sha512-0AobSA9fCuAoJnBSIIWWpoAEuyWC3gCG5u2TshSDHzMOAO4/ef2Lv6Qma+u/wMnH3oPP3tOWsNeZMbazgkiuDg== "@mdn/yari@2.50.0": version "2.50.0" From 3d7e9601cc7b5079cfaa731090070c0c83a7f09e Mon Sep 17 00:00:00 2001 From: Ari Chivukula Date: Tue, 21 May 2024 12:42:59 -0400 Subject: [PATCH 07/10] Update index.md --- files/en-us/web/api/document/hasstorageaccess/index.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/en-us/web/api/document/hasstorageaccess/index.md b/files/en-us/web/api/document/hasstorageaccess/index.md index bfe0bf2e1059542..62b0be3f6e7c621 100644 --- a/files/en-us/web/api/document/hasstorageaccess/index.md +++ b/files/en-us/web/api/document/hasstorageaccess/index.md @@ -12,7 +12,9 @@ The **`hasStorageAccess()`** method of the {{domxref("Document")}} interface ret This method is part of the [Storage Access API](/en-US/docs/Web/API/Storage_Access_API). -This method may be available under the new name {{DOMxRef("Document.hasUnpartitionedCookieAccess()")}}. +This method is another name for {{DOMxRef("Document.hasUnpartitionedCookieAccess()")}}. + +There are no current plans to remove this method in favor of {{DOMxRef("Document.hasUnpartitionedCookieAccess()")}}. ## Syntax From 4aac6c8acdff0c6e9943cb004d0dc0314a5cee03 Mon Sep 17 00:00:00 2001 From: Ari Chivukula Date: Tue, 21 May 2024 12:44:04 -0400 Subject: [PATCH 08/10] Update index.md --- files/en-us/web/api/document/hasstorageaccess/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/en-us/web/api/document/hasstorageaccess/index.md b/files/en-us/web/api/document/hasstorageaccess/index.md index 62b0be3f6e7c621..62bae31eccb18c3 100644 --- a/files/en-us/web/api/document/hasstorageaccess/index.md +++ b/files/en-us/web/api/document/hasstorageaccess/index.md @@ -48,9 +48,11 @@ The result returned by this method can be inaccurate in a couple of circumstance document.hasStorageAccess().then((hasAccess) => { if (hasAccess) { // storage access has been granted already. + console.log("cookie access granted"); } else { // storage access hasn't been granted already; // you may want to call requestStorageAccess(). + console.log("cookie access denied"); } }); ``` From f4fca91e924d9c40a4371803e29e2d35a9d72d71 Mon Sep 17 00:00:00 2001 From: Ari Chivukula Date: Tue, 21 May 2024 12:44:32 -0400 Subject: [PATCH 09/10] Update index.md --- .../web/api/document/hasunpartitionedcookieaccess/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/en-us/web/api/document/hasunpartitionedcookieaccess/index.md b/files/en-us/web/api/document/hasunpartitionedcookieaccess/index.md index 102c99aab2c2c6b..bd23ccdbac704bd 100644 --- a/files/en-us/web/api/document/hasunpartitionedcookieaccess/index.md +++ b/files/en-us/web/api/document/hasunpartitionedcookieaccess/index.md @@ -41,9 +41,11 @@ See {{DOMxRef("Document.hasStorageAccess()")}} for more details. document.hasUnpartitionedCookieAccess().then((hasAccess) => { if (hasAccess) { // storage access has been granted already. + console.log("cookie access granted"); } else { // storage access hasn't been granted already; // you may want to call requestStorageAccess(). + console.log("cookie access denied"); } }); ``` From 82e3871b4cab315619be314ccba545d6cfd2f5ed Mon Sep 17 00:00:00 2001 From: Ari Chivukula Date: Tue, 21 May 2024 16:58:02 -0400 Subject: [PATCH 10/10] Update index.md Co-authored-by: Vadim Makeev --- files/en-us/web/api/document/hasstorageaccess/index.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/files/en-us/web/api/document/hasstorageaccess/index.md b/files/en-us/web/api/document/hasstorageaccess/index.md index 62bae31eccb18c3..2d1dfd5d7b946b2 100644 --- a/files/en-us/web/api/document/hasstorageaccess/index.md +++ b/files/en-us/web/api/document/hasstorageaccess/index.md @@ -12,9 +12,7 @@ The **`hasStorageAccess()`** method of the {{domxref("Document")}} interface ret This method is part of the [Storage Access API](/en-US/docs/Web/API/Storage_Access_API). -This method is another name for {{DOMxRef("Document.hasUnpartitionedCookieAccess()")}}. - -There are no current plans to remove this method in favor of {{DOMxRef("Document.hasUnpartitionedCookieAccess()")}}. +> **Note:** This method is another name for {{DOMxRef("Document.hasUnpartitionedCookieAccess()")}}. There are no current plans to remove this method in favor of {{DOMxRef("Document.hasUnpartitionedCookieAccess()")}}. ## Syntax