Skip to content

Commit

Permalink
fix tracking #38
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Mar 25, 2022
1 parent 54add49 commit dde0217
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
4 changes: 2 additions & 2 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.11.0-blue.svg)](https://www.npmjs.com/package/sysend)
![bower](https://img.shields.io/badge/bower-1.11.0-yellow.svg)
[![npm](https://img.shields.io/badge/npm-1.11.1-blue.svg)](https://www.npmjs.com/package/sysend)
![bower](https://img.shields.io/badge/bower-1.11.1-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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sysend",
"version": "1.11.0",
"version": "1.11.1",
"description": "Web application synchronization between different tabs",
"main": "sysend.js",
"typings": "sysend.d.ts",
Expand Down
14 changes: 4 additions & 10 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.11.0
* sysend.js - send messages between browser windows/tabs version 1.11.1
*
* Copyright (C) 2014-2022 Jakub T. Jankiewicz <https://jcubic.pl/me>
* Released under the MIT license
Expand Down Expand Up @@ -251,12 +251,6 @@
}
}
// -------------------------------------------------------------------------
function on_load() {
return new Promise(function(resolve) {
window.addEventListener('load', resolve, true);
}).then(iframe_loaded);
}
// -------------------------------------------------------------------------
function iframe_loaded() {
var iframes = Array.from(document.querySelectorAll('iframe'));
return Promise.all(iframes.filter(function(iframe) {
Expand All @@ -269,8 +263,8 @@
iframe.addEventListener('error', reject, true);
});
})).then(delay(sysend.timeout));
// delay is required, something with browser is not intitled properly
// the number was pick by experimentation
// delay is required, something with browser, it's not intialized
// properly. The number was picked by experimentation
}
// -------------------------------------------------------------------------
// :: valid sysend message
Expand Down Expand Up @@ -594,7 +588,7 @@
sysend.emit('__close__', { id: target_id, wasPrimary: primary });
}, { capture: true });

on_load().then(function() {
iframe_loaded().then(function() {
sysend.list().then(function(list) {
target_count = list.length;
primary = list.length === 0;
Expand Down

0 comments on commit dde0217

Please sign in to comment.