From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22515 invoked from network); 18 Sep 2021 22:25:34 -0000 Received: from hurricane.the-brannons.com (2602:ff06:725:1:20::25) by inbox.vuxu.org with ESMTPUTF8; 18 Sep 2021 22:25:34 -0000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hurricane.the-brannons.com (OpenSMTPD) with ESMTP id 4699318b for ; Sat, 18 Sep 2021 15:25:30 -0700 (PDT) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by hurricane.the-brannons.com (OpenSMTPD) with ESMTPS id 99d1943e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Sat, 18 Sep 2021 15:25:24 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 04008320047A for ; Sat, 18 Sep 2021 18:25:22 -0400 (EDT) Received: from imap44 ([10.202.2.94]) by compute4.internal (MEProxy); Sat, 18 Sep 2021 18:25:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= mime-version:message-id:date:from:to:subject:content-type; s= fm1; bh=B1hywymMd7RUpebEzNnMTaPu5Er72CgRZ+481oyPUMk=; b=KYJI8lj6 mNRkxTJ6hUDRTDbANdSg9Aa7NatbdLGX44E5/h5GSxuOunYwCPbvfG7FPz4MzjPS Bw7PcOLFRQlxgNhHN1kNxkf3iHmSZyJWwNEPHMclD6iwPdlEMaidA/3liWCfq1wZ jX7oVOyFIJg1siz/mnn8mMuvYvur90YVYl5tvlX37M6LERc9c0bEpr190rRDkAW+ O8IwHFuUjJpkyjSyA3knIeyQvs0K8wNfEZ43t1q5LMyryP/BEUCQpGHQFbn3IdDO AfpSXGI7TZr6LiQWQNGiBje0EZeKGzdU1UZXKV5ZD5cTMilYEg+Q63dw1Pa74dtj 54JxL8SfMDBH0g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=B1hywymMd7RUpebEzNnMTaPu5Er72 CgRZ+481oyPUMk=; b=PmYcmiXLU7lowuH7KXLfgW8BK8UswtMWtjeJdFqiYGgPc pCkHmFKP3SljQbTUGXTYZYUOmJEk9Sazub312QI5HAeFhN3r1MGX/5FCU1CTyEtg 8x9225E5IxE1RNM6XLOuTTDtZEpUTGx5YzDVKfuwCGWbqHmUsNwSW92g2SMRSHUl cpmV0RrlDTi8uYlyk5VXFqB3oHWe7aSBK44cQUP2E7n6KtFM20qoYkEF/cOw8imh MFbXse0BM8wj+SSoGPPPmwNpDX64bA4eLRhWoiKfcEt/ydYKbBrbPoYQUkEV5Vnf TnmevEVZ+u/nSrDNDz3AgGwiHwt68OhhOJP3HdoVw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehledgtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtsehttdertd erredtnecuhfhrohhmpedfmfgvvhhinhcuvegrrhhhrghrthdfuceokhgvvhhinhgptggr rhhhrghrthesfhgrshhtmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhepgeeftedvle fglefhieefvdeltdeifeffgedvffffuedvfedtgeefgeeuffefjeffnecuffhomhgrihhn pehmohiiihhllhgrrdhorhhgpdhgihhthhhusgdrtghomhenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehkvghvihhnpggtrghrhhgrrhhtsehf rghsthhmrghilhdrfhhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 0D7F0FA0AA5; Sat, 18 Sep 2021 18:25:21 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-1291-gc66fc0a3a2-fm-20210913.001-gc66fc0a3 X-BeenThere: edbrowse-dev@edbrowse.org List-Id: Edbrowse Development List Mime-Version: 1.0 Message-Id: Date: Sat, 18 Sep 2021 15:23:33 -0700 From: "Kevin Carhart" To: edbrowse-dev@edbrowse.org Subject: proposed polyfill for MessageChannel Content-Type: text/plain Could we add the following as a polyfill for MessageChannel? https://developer.mozilla.org/en-US/docs/Web/API/MessageChannel I wish everyone good health Kevin ---------- // polyfill MessagePort and MessageChannel var MessagePortPolyfill = /** @class */ (function () { function MessagePortPolyfill() { this.onmessage = null; this.onmessageerror = null; this.otherPort = null; this.onmessageListeners = []; } MessagePortPolyfill.prototype.dispatchEvent = function (event) { if (this.onmessage) { this.onmessage(event); } this.onmessageListeners.forEach(function (listener) { return listener(event); }); return true; }; MessagePortPolyfill.prototype.postMessage = function (message) { if (!this.otherPort) { return; } this.otherPort.dispatchEvent({ data: message }); }; MessagePortPolyfill.prototype.addEventListener = function (type, listener) { if (type !== 'message') { return; } if (typeof listener !== 'function' || this.onmessageListeners.indexOf(listener) !== -1) { return; } this.onmessageListeners.push(listener); }; MessagePortPolyfill.prototype.removeEventListener = function (type, listener) { if (type !== 'message') { return; } var index = this.onmessageListeners.indexOf(listener); if (index === -1) { return; } this.onmessageListeners.splice(index, 1); }; MessagePortPolyfill.prototype.start = function () { // do nothing at this moment }; MessagePortPolyfill.prototype.close = function () { // do nothing at this moment }; return MessagePortPolyfill; }()); var MessageChannelPolyfill = /** @class */ (function () { function MessageChannelPolyfill() { this.port1 = new MessagePortPolyfill(); this.port2 = new MessagePortPolyfill(); this.port1.otherPort = this.port2; this.port2.otherPort = this.port1; } return MessageChannelPolyfill; }()); /** * https://github.com/zloirock/core-js/blob/master/packages/core-js/internals/global.js */ var globalObj = typeof window !== 'undefined' && window.Math === Math ? window : typeof self !== 'undefined' && self.Math === Math ? self : Function('return this')(); function applyPolyfill() { globalObj.MessagePort = MessagePortPolyfill; globalObj.MessageChannel = MessageChannelPolyfill; } if (!globalObj.MessagePort || !globalObj.MessageChannel) { applyPolyfill(); }