postalworker-es 4.0.3 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/PostalWorker.es.js
CHANGED
|
@@ -86,6 +86,8 @@ static registerDelivery(e){e._on(DELIVERY,s=>{const t=e;t._delivery(s)})}}/**
|
|
|
86
86
|
* @Author: Russ Stratfull
|
|
87
87
|
* @Contributors: Sakshi Dheer, & François Wauquier
|
|
88
88
|
*/
|
|
89
|
+
// todo: Research how to implement this polyfill: https://github.com/okikio/sharedworker
|
|
90
|
+
// import SharedWorkerPolyfill from "./SharedWorkerPolyfill";
|
|
89
91
|
let _config=!1,_stringify,_worker=!1,_parentWindow=!1,_subscriptions=new Set,_events=new Map,_crossEvents=new Map,_openingWindows=new Map,_windows=new Map,_broadcastNetwork=new Set,_channel=new BroadcastChannel(POSTAL_WORKER),_queue=[],_POboxes=new Map,_closures=new Map,_packages=new Map;
|
|
90
92
|
// Define the PostalWorker
|
|
91
93
|
class PostalWorker{/**
|
|
@@ -124,7 +126,7 @@ _getSubscriber(e){let s=e.split("://"),t=s[0];if(void 0!==s[1]){let e=s[1].split
|
|
|
124
126
|
_resolveWorker(){
|
|
125
127
|
// Browser supports SharedWorker
|
|
126
128
|
let e=!!window.SharedWorker;
|
|
127
|
-
//
|
|
129
|
+
// Polyfill on failure
|
|
128
130
|
return e=Boolean(e),e?(_worker=this._startSharedWorker())||(_worker=this._startDedicatedWorker()):_worker=this._startDedicatedWorker(),_worker}/**
|
|
129
131
|
* Attempt to start SharedWorker thread or fail and return false
|
|
130
132
|
* @return {SharedWorker | boolean}
|
package/dist/PostalWorker.min.js
CHANGED
|
@@ -64,7 +64,7 @@ this._resolveWorker()}/**
|
|
|
64
64
|
return s(e,[{key:"_getSubscriber",value:function(e){var t=e.split("://"),r=t[0];if(void 0!==t[1]){var o=t[1].split("/")[0];return r.concat("://").concat(o)}return e}},{key:"_resolveWorker",value:function(){
|
|
65
65
|
// Browser supports SharedWorker
|
|
66
66
|
var e=!!window.SharedWorker;
|
|
67
|
-
//
|
|
67
|
+
// Polyfill on failure
|
|
68
68
|
return e=Boolean(e),e?(p=this._startSharedWorker())||(p=this._startDedicatedWorker()):p=this._startDedicatedWorker(),p}},{key:"_startSharedWorker",value:function(){var e=this,t=void 0,r=this._getPostalRoute();try{t=new SharedWorker(r.concat("PostalSharedWorker").concat(".").concat("js"),{name:"PostalWorker"});/* !!! DEPRECATED messaging route !!! but leaving in place as fallback for older browsers */
|
|
69
69
|
// this stuff is no longer tested and does not work
|
|
70
70
|
// (no more messaging, only the connection is being established here)
|
package/package.json
CHANGED