The Local Storage Bridge
1K library for exchanging messages between tabs in a same browser. It uses the local storage as a communication channel.
The story behind the library is available here.
Usage
Add lsbridge.min.js to your page:
There is a global object lsbridge
available.
Send messages:
lsbridge;
Listen for messages:
lsbridge;
Find out if localStorage
is available:
console; // prints "true" or "false"
Cancel listeners for specific namespace:
lsbridge;
Compilation
- Run
npm install
to get UglifyJS installed. - Run
npm run-script compile
to producebuild/jsbridge.min.js
Example
Try it yourself by opening example/index.html
in a browser.