From 70603c5d0298ddfaa22d0d195cfbdc4be6513309 Mon Sep 17 00:00:00 2001 From: Ari Chivukula Date: Fri, 3 May 2024 13:44:05 +0000 Subject: [PATCH] fix --- .../createobjecturl/index.md | 61 +++++++++++++++++++ .../api/storageaccesshandle/estimate/index.md | 59 ++++++++++++++++++ .../storageaccesshandle/getdirectory/index.md | 59 ++++++++++++++++++ .../revokeobjecturl/index.md | 60 ++++++++++++++++++ 4 files changed, 239 insertions(+) create mode 100644 files/en-us/web/api/storageaccesshandle/createobjecturl/index.md create mode 100644 files/en-us/web/api/storageaccesshandle/estimate/index.md create mode 100644 files/en-us/web/api/storageaccesshandle/getdirectory/index.md create mode 100644 files/en-us/web/api/storageaccesshandle/revokeobjecturl/index.md diff --git a/files/en-us/web/api/storageaccesshandle/createobjecturl/index.md b/files/en-us/web/api/storageaccesshandle/createobjecturl/index.md new file mode 100644 index 000000000000000..9a007a8bf819645 --- /dev/null +++ b/files/en-us/web/api/storageaccesshandle/createobjecturl/index.md @@ -0,0 +1,61 @@ +--- +title: "StorageAccessHandle: createObjectURL() property" +short-title: createObjectURL() +slug: Web/API/StorageAccessHandle/createObjectURL +page-type: web-api-instance-method +browser-compat: api.StorageAccessHandle.createObjectURL +--- + +{{APIRef("Storage Access API")}} + +> **Note:** See {{domxref("URL.createObjectURL_static", "createObjectURL()")}} to understand usage. + +## Syntax + +```js-nolint +createObjectURL(object) +``` + +### Parameters + +- `object` + - : A {{domxref("File")}}, {{domxref("Blob")}}, or {{domxref("MediaSource")}} object to + create an object URL for. + +### Return value + +A string containing an unpartitioned object URL that can be used to reference the contents of the specified source `object`. + +### Exceptions + +- `SecurityError` {{domxref("DomException")}} + - : Thrown if access was not granted. + +## Examples + +```js +document.requestStorageAccess({ createObjectURL: true }).then( + (handle) => { + console.log("createObjectURL access granted"); + handle.createObjectURL(new Blob(["foo"])); + }, + () => { + console.log("createObjectURL access denied"); + }, +); +``` + +> **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.requestStorageAccess()")}} +- [Using the Storage Access API](/en-US/docs/Web/API/Storage_Access_API/Using) diff --git a/files/en-us/web/api/storageaccesshandle/estimate/index.md b/files/en-us/web/api/storageaccesshandle/estimate/index.md new file mode 100644 index 000000000000000..fbcb35bd0f4203e --- /dev/null +++ b/files/en-us/web/api/storageaccesshandle/estimate/index.md @@ -0,0 +1,59 @@ +--- +title: "StorageAccessHandle: estimate() property" +short-title: estimate() +slug: Web/API/StorageAccessHandle/estimate +page-type: web-api-instance-method +browser-compat: api.StorageAccessHandle.estimate +--- + +{{APIRef("Storage Access API")}} + +> **Note:** See {{domxref("StorageManager.estimate()")}} to understand usage. + +## Syntax + +```js-nolint +estimate() +``` + +### Parameters + +None. + +### Return value + +A {{jsxref("Promise")}} that fufills with an unpartitioned {{domxref("StorageEstimate")}} object. + +### Exceptions + +- `SecurityError` {{domxref("DomException")}} + - : Thrown if access was not granted. + +## Examples + +```js +document.requestStorageAccess({ estimate: true }).then( + (handle) => { + console.log("estimate access granted"); + await handle.estimate(); + }, + () => { + console.log("estimate access denied"); + }, +); +``` + +> **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.requestStorageAccess()")}} +- [Using the Storage Access API](/en-US/docs/Web/API/Storage_Access_API/Using) diff --git a/files/en-us/web/api/storageaccesshandle/getdirectory/index.md b/files/en-us/web/api/storageaccesshandle/getdirectory/index.md new file mode 100644 index 000000000000000..fcfdad7d945bb73 --- /dev/null +++ b/files/en-us/web/api/storageaccesshandle/getdirectory/index.md @@ -0,0 +1,59 @@ +--- +title: "StorageAccessHandle: getDirectory() property" +short-title: getDirectory() +slug: Web/API/StorageAccessHandle/getDirectory +page-type: web-api-instance-method +browser-compat: api.StorageAccessHandle.getDirectory +--- + +{{APIRef("Storage Access API")}} + +> **Note:** See {{domxref("StorageManager.getDirectory()")}} to understand usage. + +## Syntax + +```js-nolint +getDirectory() +``` + +### Parameters + +None. + +### Return value + +A {{jsxref("Promise")}} that fufills with an unpartitioned {{domxref("FileSystemDirectoryHandle")}} object. + +### Exceptions + +- `SecurityError` {{domxref("DomException")}} + - : Thrown if access was not granted. + +## Examples + +```js +document.requestStorageAccess({ getDirectory: true }).then( + (handle) => { + console.log("getDirectory access granted"); + await handle.getDirectory(); + }, + () => { + console.log("getDirectory access denied"); + }, +); +``` + +> **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.requestStorageAccess()")}} +- [Using the Storage Access API](/en-US/docs/Web/API/Storage_Access_API/Using) diff --git a/files/en-us/web/api/storageaccesshandle/revokeobjecturl/index.md b/files/en-us/web/api/storageaccesshandle/revokeobjecturl/index.md new file mode 100644 index 000000000000000..2bff19cdcf5c2be --- /dev/null +++ b/files/en-us/web/api/storageaccesshandle/revokeobjecturl/index.md @@ -0,0 +1,60 @@ +--- +title: "StorageAccessHandle: revokeObjectURL() property" +short-title: revokeObjectURL() +slug: Web/API/StorageAccessHandle/revokeObjectURL +page-type: web-api-instance-method +browser-compat: api.StorageAccessHandle.revokeObjectURL +--- + +{{APIRef("Storage Access API")}} + +> **Note:** See {{domxref("URL.revokeObjectURL_static", "revokeObjectURL()")}} to understand usage. + +## Syntax + +```js-nolint +revokeObjectURL(objectURL) +``` + +### Parameters + +- `objectURL` + - : A string representing an object URL that was previously created by calling {{domxref("StorageAccessHandle.createObjectURL()")}}. + +### Return value + +None ({{jsxref("undefined")}}). + +### Exceptions + +- `SecurityError` {{domxref("DomException")}} + - : Thrown if access was not granted. + +## Examples + +```js +document.requestStorageAccess({ revokeObjectURL: true }).then( + (handle) => { + console.log("revokeObjectURL access granted"); + handle.revokeObjectURL(blob_url); + }, + () => { + console.log("revokeObjectURL access denied"); + }, +); +``` + +> **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.requestStorageAccess()")}} +- [Using the Storage Access API](/en-US/docs/Web/API/Storage_Access_API/Using)