Skip to content

Commit

Permalink
detect Secure Storage Access #54
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Apr 20, 2024
1 parent 112b7d4 commit 1e2b5b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<img src="https://github.com/jcubic/sysend.js/blob/master/assets/logo.svg?raw=true" alt="Sysend.js logo"/>
</p>

[![npm](https://img.shields.io/badge/npm-1.17.3-blue.svg)](https://www.npmjs.com/package/sysend)
![bower](https://img.shields.io/badge/bower-1.17.3-yellow.svg)
[![npm](https://img.shields.io/badge/npm-1.17.4-blue.svg)](https://www.npmjs.com/package/sysend)
![bower](https://img.shields.io/badge/bower-1.17.4-yellow.svg)
![downloads](https://img.shields.io/npm/dt/sysend.svg)
[![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/sysend)](https://www.jsdelivr.com/package/npm/sysend)

Expand Down Expand Up @@ -56,7 +56,7 @@ You can also use the HTTP header:
Origin-Trial: <TOKEN>
```

Right now the API only works with localStorage fallback (when inside iframes).
Right now, the API only works with localStorage fallback (when inside iframes).

## Installation

Expand Down
5 changes: 3 additions & 2 deletions sysend.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**@license
* sysend.js - send messages between browser windows/tabs version 1.17.3
* sysend.js - send messages between browser windows/tabs version 1.17.4
*
* Copyright (C) 2014 Jakub T. Jankiewicz <https://jcubic.pl/me>
* Released under the MIT license
Expand Down Expand Up @@ -865,7 +865,8 @@
// -------------------------------------------------------------------------
function init() {
if (is_function(window.BroadcastChannel)) {
if (is_secured_iframe() && document.requestStorageAccess) {
const ssa = document.requestStorageAccess && 'hasUnpartitionedCookieAccess' in document;
if (is_secured_iframe() && ssa) {
document.requestStorageAccess({
all: true
}).then(function(handle) {
Expand Down

0 comments on commit 1e2b5b3

Please sign in to comment.