Find window previously opened by window.open

后端 未结 5 1681
攒了一身酷
攒了一身酷 2020-12-05 04:52

We\'ve got the following situation, running from a single domain:

Page A uses window.open() to open a named window (a popup player). window.open()

5条回答
  •  粉色の甜心
    2020-12-05 05:44

    If all the windows share a common Url origin you can register a ServiceWorker and then access all windows from the ServiceWorker: https://developer.mozilla.org/en-US/docs/Web/API/Clients

    AFAIK You won't be able to pass a reference to other windows from WorkerService to your window but you can establish communications with the ServiceWorker via

    • https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage
    • https://developer.mozilla.org/en-US/docs/Web/API/Client/postMessage

提交回复
热议问题