The Story
I am developing a Safari Extension with a popover. No-matter how many tabs or windows I have open, only the first one that was loaded dispatches messages to Global.html
I have tried window.onfocus, document.addEventListener("visibilitychange"), safari.self.addEventListener("activate") on the Injected.js.
Windows/Tabs are responding to the above listeners, but only the first-loaded-tab will dispatch a message.
Goal
- User changes tab or window
- Target Page's Injected.js listens it is activated,
- Target Page's Injected.js dispatches message to Global.html
- Global.html receives message
- Global.html re-renders the Popover.html
Thanks everybody in advance.
Any idea is more than welcome.