-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
62 lines (42 loc) · 1.43 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
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
handle.createObjectURL(object)
```
### Parameters
- `object`
- : See {{domxref("URL.createObjectURL_static", "createObjectURL()")}}.
### 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.
See {{domxref("URL.createObjectURL_static", "createObjectURL()")}}
## 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)