Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arichiv committed May 3, 2024
1 parent f6e4023 commit 70603c5
Show file tree
Hide file tree
Showing 4 changed files with 239 additions and 0 deletions.
61 changes: 61 additions & 0 deletions files/en-us/web/api/storageaccesshandle/createobjecturl/index.md
Original file line number Diff line number Diff line change
@@ -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)
59 changes: 59 additions & 0 deletions files/en-us/web/api/storageaccesshandle/estimate/index.md
Original file line number Diff line number Diff line change
@@ -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)
59 changes: 59 additions & 0 deletions files/en-us/web/api/storageaccesshandle/getdirectory/index.md
Original file line number Diff line number Diff line change
@@ -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)
60 changes: 60 additions & 0 deletions files/en-us/web/api/storageaccesshandle/revokeobjecturl/index.md
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 70603c5

Please sign in to comment.