broadcast-channel

How can I use the BroadcastChannel API or something similar in Safari 10+?

陌路散爱 提交于 2020-01-23 17:47:06
问题 Problem: I need a client-side Javascript solution (jQuery is fine) where an event in one browser window/tab can be broadcast to other windows/tabs on the same domain. For example, if a cart is updated in tab A, tabs B and C get notified so we can update some info on the page, or notify the user that page is stale, or something like that. What I've tried: The BroadcastChannel API fits my needs perfectly, but does not work in IE 11 or Safari. So I tried this polyfill so I could use the

Angular: Binding to a observable property of service -> value doesn't update

断了今生、忘了曾经 提交于 2019-12-23 16:06:57
问题 I'm trying to communicate between two browser tabs/windows using BroadcastChannel API. The communication seems to work between two instances of angular service, but changes to the values of the observable are not shown. I'm trying to achieve this using mainly the async pipe. I have a demo of my problem at StackBlitz I have two component that are showed using the router. ( control and display ) I have a service ( MessagingService ) where I have a BehaviorSubject and BroadcastChannel API

Communication between tabs or windows

梦想的初衷 提交于 2019-11-25 22:20:35
问题 I was searching for a way how to communicate between multiple tabs or windows in a browser (on the same domain, not CORS) without leaving traces. There were several solutions: using window object postMessage cookies localStorage The first is probably the worst solution - you need to open a window from your current window and then you can communicate only as long as you keep the windows open. If you reload the page in any of the windows, you most likely lost the communication. Second approach,