-
Notifications
You must be signed in to change notification settings - Fork 22.6k
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
6 changed files
with
224 additions
and
0 deletions.
There are no files selected for viewing
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
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,45 @@ | ||
--- | ||
title: "StorageAccessHandle: caches property" | ||
short-title: caches | ||
slug: Web/API/StorageAccessHandle/caches | ||
page-type: web-api-instance-property | ||
browser-compat: api.StorageAccessHandle.caches | ||
--- | ||
|
||
{{APIRef("Storage Access API")}} | ||
|
||
The **`caches`** property of the {{domxref("StorageAccessHandle")}} interface returns an unpartitioned {{domxref("CacheStorage")}} object if access was granted, and throws a `SecurityError` {{DOMxRef("DOMException")}} otherwise. | ||
|
||
## Value | ||
|
||
A {{domxref("CacheStorage")}} object. | ||
|
||
## Examples | ||
|
||
```js | ||
document.requestStorageAccess({ caches: true }).then( | ||
(handle) => { | ||
console.log("caches access granted"); | ||
const cache = await handle.caches.open("foo"); | ||
await cache.add("/"); | ||
}, | ||
() => { | ||
console.log("caches 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) |
44 changes: 44 additions & 0 deletions
44
files/en-us/web/api/storageaccesshandle/indexeddb/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,44 @@ | ||
--- | ||
title: "StorageAccessHandle: indexedDB property" | ||
short-title: indexedDB | ||
slug: Web/API/StorageAccessHandle/indexedDB | ||
page-type: web-api-instance-property | ||
browser-compat: api.StorageAccessHandle.indexedDB | ||
--- | ||
|
||
{{APIRef("Storage Access API")}} | ||
|
||
The **`indexedDB`** property of the {{domxref("StorageAccessHandle")}} interface returns an unpartitioned {{domxref("IDBFactory")}} object if access was granted, and throws a `SecurityError` {{DOMxRef("DOMException")}} otherwise. | ||
|
||
## Value | ||
|
||
A {{domxref("IDBFactory")}} object. | ||
|
||
## Examples | ||
|
||
```js | ||
document.requestStorageAccess({ indexedDB: true }).then( | ||
(handle) => { | ||
console.log("indexedDB access granted"); | ||
await handle.indexedDB.deleteDatabase("foo"); | ||
}, | ||
() => { | ||
console.log("indexedDB 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) |
44 changes: 44 additions & 0 deletions
44
files/en-us/web/api/storageaccesshandle/localstorage/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,44 @@ | ||
--- | ||
title: "StorageAccessHandle: localStorage property" | ||
short-title: localStorage | ||
slug: Web/API/StorageAccessHandle/localStorage | ||
page-type: web-api-instance-property | ||
browser-compat: api.StorageAccessHandle.localStorage | ||
--- | ||
|
||
{{APIRef("Storage Access API")}} | ||
|
||
The **`localStorage`** property of the {{domxref("StorageAccessHandle")}} interface returns an unpartitioned local {{domxref("Storage")}} object if access was granted, and throws a `SecurityError` {{DOMxRef("DOMException")}} otherwise. | ||
|
||
## Value | ||
|
||
A {{domxref("Storage")}} object. | ||
|
||
## Examples | ||
|
||
```js | ||
document.requestStorageAccess({ localStorage: true }).then( | ||
(handle) => { | ||
console.log("localStorage access granted"); | ||
handle.localStorage.setItem("foo", "bar"); | ||
}, | ||
() => { | ||
console.log("localStorage 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,46 @@ | ||
--- | ||
title: "StorageAccessHandle: locks property" | ||
short-title: locks | ||
slug: Web/API/StorageAccessHandle/locks | ||
page-type: web-api-instance-property | ||
browser-compat: api.StorageAccessHandle.locks | ||
--- | ||
|
||
{{APIRef("Storage Access API")}} | ||
|
||
The **`locks`** property of the {{domxref("StorageAccessHandle")}} interface returns an unpartitioned session {{domxref("LockManager")}} object if access was granted, and throws a `SecurityError` {{DOMxRef("DOMException")}} otherwise. | ||
|
||
## Value | ||
|
||
A {{domxref("LockManager")}} object. | ||
|
||
## Examples | ||
|
||
```js | ||
document.requestStorageAccess({ locks: true }).then( | ||
(handle) => { | ||
console.log("locks access granted"); | ||
await handle.locks.request('foo', async lock => { | ||
return "ok"; | ||
}); | ||
}, | ||
() => { | ||
console.log("locks 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) |
44 changes: 44 additions & 0 deletions
44
files/en-us/web/api/storageaccesshandle/sessionstorage/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,44 @@ | ||
--- | ||
title: "StorageAccessHandle: sessionStorage property" | ||
short-title: sessionStorage | ||
slug: Web/API/StorageAccessHandle/sessionStorage | ||
page-type: web-api-instance-property | ||
browser-compat: api.StorageAccessHandle.sessionStorage | ||
--- | ||
|
||
{{APIRef("Storage Access API")}} | ||
|
||
The **`sessionStorage`** property of the {{domxref("StorageAccessHandle")}} interface returns an unpartitioned session {{domxref("Storage")}} object if access was granted, and throws a `SecurityError` {{DOMxRef("DOMException")}} otherwise. | ||
|
||
## Value | ||
|
||
A {{domxref("Storage")}} object. | ||
|
||
## Examples | ||
|
||
```js | ||
document.requestStorageAccess({ sessionStorage: true }).then( | ||
(handle) => { | ||
console.log("sessionStorage access granted"); | ||
handle.sessionStorage.setItem("foo", "bar"); | ||
}, | ||
() => { | ||
console.log("sessionStorage 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) |