-
Notifications
You must be signed in to change notification settings - Fork 22.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
239 additions
and
0 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
files/en-us/web/api/storageaccesshandle/createobjecturl/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
59
files/en-us/web/api/storageaccesshandle/getdirectory/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
60
files/en-us/web/api/storageaccesshandle/revokeobjecturl/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |