Skip to content

Commit 98378d0

Browse files
committed
Update readme
1 parent 7a91119 commit 98378d0

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ Cross domain local storage, with permissions. Features an API using ES6 promises
88

99
The library is a convenient alternative to sharing a root domain cookie.
1010
Unlike cookies, your client-side data isn't limited to a few kilobytes - you
11-
get a guaranteed 2.49Mb. This is all thanks to LocalStorage, which is available
12-
in IE 8+, FF 3.5+, Chrome 4+, as well as a majority of mobile browsers. For a
13-
list of compatible browsers, refer to
11+
get a guaranteed 2.49Mb. For a client-heavy application, you can potentially
12+
shave a few KB off your request headers by avoiding cookies. This is all thanks
13+
to LocalStorage, which is available in IE 8+, FF 3.5+, Chrome 4+, as well as a
14+
majority of mobile browsers. For a list of compatible browsers, refer to
1415
[caniuse](http://caniuse.com/#feat=namevalue-storage).
1516

1617
How does it work? The library is divided into two types of components: hubs
@@ -60,12 +61,30 @@ storage.onConnect().then(function() {
6061

6162
## Installation
6263

63-
Once made public, the module will be available via bower:
64+
The application can be installed via bower:
6465

6566
``` bash
6667
bower install cross-storage
6768
```
6869

70+
When serving the hub, you'll want to set the CORS and CSP headers for your
71+
server appropriately. For example:
72+
73+
``` javascript
74+
{
75+
'Access-Control-Allow-Origin': '*',
76+
'Access-Control-Allow-Methods': 'GET,PUT,POST,DELETE',
77+
'Access-Control-Allow-Headers': 'X-Requested-With',
78+
'Content-Security-Policy': "default-src 'unsafe-inline' *",
79+
'X-Content-Security-Policy': "default-src 'unsafe-inline' *",
80+
'X-WebKit-CSP': "default-src 'unsafe-inline' *",
81+
}
82+
```
83+
84+
If using inline JS to create the hub, you'll need to specify `unsafe-inline`
85+
for the CSP headers. Otherwise, it can be left out if simply included the
86+
init code via another resource.
87+
6988
## API
7089

7190
#### CrossStorageHub.init(permissions)

0 commit comments

Comments
 (0)