shared-worker

Firefox Quantum SharedWorker not work

╄→гoц情女王★ 提交于 2019-12-29 07:17:11
问题 In Chrome and Firefox <57 it works, but in Firefox Quantum doesn't work. The goal is to send a message to another tab in the browser. When filling in the text input and clicking the send button, the other tab in the browser should write the message in the browser console. html file: <script type="text/javascript"> const myWorker = new SharedWorker( "sharedWorkerChat.js" ); const port = myWorker.port; port.addEventListener( "message", function( e ) { console.log( e.data ); }, false ); port

Are Shared WebWorkers supported in IE 11?

纵饮孤独 提交于 2019-12-24 00:58:05
问题 I tried to implement this code, here is the link. It works in Chrome, whereas in IE 11 it gives an error 'SharedWorker' is undefined . But according to caniuse, WebWorkers are supported in IE 11. Does anyone know who is right? 回答1: Web workers are indeed supported in IE 11, but shared workers not. From MDN: 来源: https://stackoverflow.com/questions/44708277/are-shared-webworkers-supported-in-ie-11

window.opener does not work in Excel for Windows

旧巷老猫 提交于 2019-12-12 16:41:01
问题 I have built an Excel add-in, it opens a popup by window.open , then the add-in communicates with the popup site. I just realised that it does NOT work in Excel for Windows, the reason is that the popup can NOT get the host by $window.opener . To illustrate this and avoid cross-domain, I have made a xml, which refers to the add-in and the test page. It works well in Excel Online in Chrome and in IE. However, while running it in Excel for Windows, $window.opener returns undefined . Could

How to run EventSource inside Shared Worker?

懵懂的女人 提交于 2019-12-12 02:57:40
问题 I implemented server-sent events to receive messages from the server. I describe how I implemented it on another question Now I am trying to run it inside a shared worker to prevent the user from opening multiple connections to the servers via multiple browser tabs. Here is what I have done to run the code inside a Shared Worker created a file calles worker.js and I put this code inside of it self.addEventListener('getMessagingQueue', function (event) { console.log('Listener is Available');

How to call shared worker from the web worker?

点点圈 提交于 2019-12-05 02:34:43
问题 Is it possible to call a Shared Worker from the Web Worker? Could you please give me an example. In my case I have a few web workers and I need to share a singleton service between them. 回答1: The SharedWorker constructor is not currently available within the WorkerGlobalScope , so you will not be able to construct an instance like you would in an iframe or window. What you can do is, create a MessageChannel for each of your workers, and use it to communicate between the worker and

How to call shared worker from the web worker?

走远了吗. 提交于 2019-12-03 17:07:47
Is it possible to call a Shared Worker from the Web Worker? Could you please give me an example. In my case I have a few web workers and I need to share a singleton service between them. The SharedWorker constructor is not currently available within the WorkerGlobalScope , so you will not be able to construct an instance like you would in an iframe or window. What you can do is, create a MessageChannel for each of your workers, and use it to communicate between the worker and sharedWorker. Though doing this would negate the need for an actual SharedWorker , since you could just as well use a

Firefox Quantum SharedWorker not work

假装没事ソ 提交于 2019-11-29 08:07:14
In Chrome and Firefox <57 it works, but in Firefox Quantum doesn't work. The goal is to send a message to another tab in the browser. When filling in the text input and clicking the send button, the other tab in the browser should write the message in the browser console. html file: <script type="text/javascript"> const myWorker = new SharedWorker( "sharedWorkerChat.js" ); const port = myWorker.port; port.addEventListener( "message", function( e ) { console.log( e.data ); }, false ); port.start(); function postMessage() { const value = document.getElementById( "input" ).value; console.log(