Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sysend

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sysend - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

bower.json

4

package.json
{
"name": "sysend",
"version": "1.0.1",
"version": "1.1.0",
"description": "Send messages to other tabs/windows in the same origin and browser",

@@ -16,2 +16,4 @@ "main": "sysend.js",

"events",
"callback",
"notifications",
"browser"

@@ -18,0 +20,0 @@ ],

@@ -21,2 +21,9 @@ ## sysend.js

or bower
```
bower install sysend
```
## Usage

@@ -23,0 +30,0 @@

@@ -10,3 +10,11 @@ /**@license

*/
var sysend = (function() {
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['sysend'], factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root.sysend = factory();
}
})(typeof window !== "undefined" ? window : this, function() {
// we use prefix so `foo' event don't collide with `foo' locaStorage value

@@ -41,3 +49,5 @@ var uniq_prefix = '___sysend___';

function to_json(input) {
var obj = [id++];
// save random_value in storage to fix issue in IE that storage event
// is fired on same page where setItem was called
var obj = [id++, random_value];
// undefined in array get stringified as null

@@ -55,4 +65,3 @@ if (typeof input != 'undefined') {

window.addEventListener('storage', function(e) {
// Fix issue in IE that storage event is fired on same page where setItem was called
if (e.key.match(re) && e.url != location.href) {
if (e.key.match(re)) {
var key = e.key.replace(re, '');

@@ -63,6 +72,6 @@ if (callbacks[key]) {

var obj = JSON.parse(value);
if (obj) {
if (obj && obj[1] != random_value) {
// don't call on remove
callbacks[key].forEach(function(fn) {
fn(obj[1], key);
fn(obj[2], key);
});

@@ -73,2 +82,3 @@ }

}
origin_page = false;
}, false);

@@ -103,2 +113,2 @@ return {

};
})();
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc