Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add StorageAccessHandle #33391

Merged
merged 29 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
56ab95e
Add StorageAccessHandle
arichiv May 3, 2024
f05dabc
fix
arichiv May 3, 2024
34a2b75
fix
arichiv May 3, 2024
3dae799
fix
arichiv May 3, 2024
dfdcfa0
Update files/en-us/web/api/document/requeststorageaccess/index.md
arichiv May 3, 2024
47a01a7
Update files/en-us/web/api/storage_access_api/using/index.md
arichiv May 3, 2024
5e3fa9b
Update files/en-us/web/api/storage_access_api/using/index.md
arichiv May 3, 2024
cd7cad4
Update files/en-us/web/api/storage_access_api/using/index.md
arichiv May 3, 2024
ca39133
Update files/en-us/web/api/storageaccesshandle/index.md
arichiv May 3, 2024
bf60b5d
fix
arichiv May 3, 2024
f6e4023
fix
arichiv May 3, 2024
70603c5
fix
arichiv May 3, 2024
cb6d39c
fix
arichiv May 3, 2024
6d374cf
fix
arichiv May 5, 2024
c4f3492
Merge branch 'main' into patch-3
arichiv May 5, 2024
641eacc
fix
arichiv May 5, 2024
3a9456f
Merge branch 'main' into patch-3
arichiv May 6, 2024
2d43dc9
Merge branch 'main' into patch-3
arichiv May 7, 2024
275de8c
Merge branch 'main' into patch-3
arichiv May 13, 2024
05d72c4
Merge branch 'main' into patch-3
arichiv May 14, 2024
3bfe6b4
Merge branch 'main' into patch-3
arichiv May 15, 2024
5c3ef39
Merge branch 'main' into patch-3
arichiv May 16, 2024
359d1eb
Merge branch 'main' into patch-3
arichiv May 17, 2024
19c8cf6
Merge branch 'main' into patch-3
arichiv May 20, 2024
5cb0515
Merge branch 'main' into patch-3
arichiv May 21, 2024
c08b7ab
Update index.md
arichiv May 21, 2024
fc27bed
Merge branch 'main' into patch-3
arichiv May 21, 2024
d302bed
Merge branch 'main' into patch-3
arichiv May 21, 2024
934cb4a
Merge branch 'main' into patch-3
arichiv May 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
arichiv committed May 3, 2024
commit cb6d39c11d80e859618fe1a1edd903fbfad9398c
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: "StorageAccessHandle: BroadcastChannel() property"
short-title: BroadcastChannel()
slug: Web/API/StorageAccessHandle/BroadcastChannel
page-type: web-api-instance-method
browser-compat: api.StorageAccessHandle.BroadcastChannel
---

{{APIRef("Storage Access API")}}

> **Note:** See {{domxref("BroadcastChannel.BroadcastChannel", "BroadcastChannel()")}} to understand usage.

## Syntax

```js-nolint
handle.BroadcastChannel(channelName)
```

### Parameters

- `channelName`
- : See {{domxref("BroadcastChannel.BroadcastChannel", "BroadcastChannel()")}}.

### Return value

An unpartitioned {{domxref("BroadcastChannel")}} object.

### Exceptions

- `SecurityError` {{domxref("DomException")}}
- : Thrown if access was not granted.
- See {{domxref("BroadcastChannel.BroadcastChannel", "BroadcastChannel()")}}

## Examples

```js
document.requestStorageAccess({ BroadcastChannel: true }).then(
(handle) => {
console.log("BroadcastChannel access granted");
handle.BroadcastChannel(channel_name);
},
() => {
console.log("BroadcastChannel 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)
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ browser-compat: api.StorageAccessHandle.createObjectURL
## Syntax

```js-nolint
createObjectURL(object)
handle.createObjectURL(object)
```

### Parameters

- `object`
- : A {{domxref("File")}}, {{domxref("Blob")}}, or {{domxref("MediaSource")}} object to
create an object URL for.
- : See {{domxref("URL.createObjectURL_static", "createObjectURL()")}}.

### Return value

Expand All @@ -30,6 +29,7 @@ A string containing an unpartitioned object URL that can be used to reference th

- `SecurityError` {{domxref("DomException")}}
- : Thrown if access was not granted.
- See {{domxref("URL.createObjectURL_static", "createObjectURL()")}}

## Examples

Expand Down
3 changes: 2 additions & 1 deletion files/en-us/web/api/storageaccesshandle/estimate/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ browser-compat: api.StorageAccessHandle.estimate
## Syntax

```js-nolint
estimate()
handle.estimate()
```

### Parameters
Expand All @@ -28,6 +28,7 @@ A {{jsxref("Promise")}} that fufills with an unpartitioned {{domxref("StorageEst

- `SecurityError` {{domxref("DomException")}}
- : Thrown if access was not granted.
- See {{domxref("StorageManager.estimate()")}}

## Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ browser-compat: api.StorageAccessHandle.getDirectory
## Syntax

```js-nolint
getDirectory()
handle.getDirectory()
```

### Parameters
Expand All @@ -28,6 +28,7 @@ A {{jsxref("Promise")}} that fufills with an unpartitioned {{domxref("FileSystem

- `SecurityError` {{domxref("DomException")}}
- : Thrown if access was not granted.
- See {{domxref("StorageManager.getDirectory()")}}

## Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ browser-compat: api.StorageAccessHandle.revokeObjectURL
## Syntax

```js-nolint
revokeObjectURL(objectURL)
handle.revokeObjectURL(objectURL)
```

### Parameters

- `objectURL`
- : A string representing an object URL that was previously created by calling {{domxref("StorageAccessHandle.createObjectURL()")}}.
- : See {{domxref("URL.revokeObjectURL_static", "revokeObjectURL()")}}.

### Return value

Expand All @@ -29,6 +29,7 @@ None ({{jsxref("undefined")}}).

- `SecurityError` {{domxref("DomException")}}
- : Thrown if access was not granted.
- See {{domxref("URL.revokeObjectURL_static", "revokeObjectURL()")}}

## Examples

Expand Down
69 changes: 69 additions & 0 deletions files/en-us/web/api/storageaccesshandle/sharedworker/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
title: "StorageAccessHandle: SharedWorker() property"
short-title: SharedWorker()
slug: Web/API/StorageAccessHandle/SharedWorker
page-type: web-api-instance-method
browser-compat: api.StorageAccessHandle.SharedWorker
---

{{APIRef("Storage Access API")}}

> **Note:** See {{domxref("SharedWorker.SharedWorker", "SharedWorker()")}} to understand usage.

## Syntax

```js-nolint
handle.SharedWorker(aURL)
handle.SharedWorker(aURL, name)
handle.SharedWorker(aURL, options)
```

### Parameters

- `aURL`
- : See {{domxref("SharedWorker.SharedWorker", "SharedWorker()")}}.
- `name` {{optional_inline}}
- : See {{domxref("SharedWorker.SharedWorker", "SharedWorker()")}}.
- `options` {{optional_inline}}
- : See {{domxref("SharedWorker.SharedWorker", "SharedWorker()")}}.

> **Note:** `options.sameSiteCookies` only supports the value "none", which is the default.

### Return value

An unpartitioned {{domxref("SharedWorker")}} object.

### Exceptions

- `SecurityError` {{domxref("DomException")}}
- : Thrown if access was not granted.
- See {{domxref("SharedWorker.SharedWorker", "SharedWorker()")}}

## Examples

```js
document.requestStorageAccess({ SharedWorker: true }).then(
(handle) => {
console.log("SharedWorker access granted");
handle.SharedWorker(shared_worker_url);
},
() => {
console.log("SharedWorker 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)