Handle exceptions thrown when requesting storage-access
permission (#21325)
This commit is contained in:
parent
e2ac9487f7
commit
c0b0a25f71
1 changed files with 9 additions and 3 deletions
|
@ -29,9 +29,15 @@
|
|||
}
|
||||
|
||||
// Otherwise, check whether unpartitioned cookie access has been granted to another same-site embed.
|
||||
const permission = await navigator.permissions.query({
|
||||
name: "storage-access",
|
||||
});
|
||||
let permission;
|
||||
|
||||
try {
|
||||
permission = await navigator.permissions.query({
|
||||
name: "storage-access",
|
||||
});
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If not, signal that there is no support.
|
||||
if (permission.state !== "granted") {
|
||||
|
|
Loading…
Reference in a new issue