Find window previously opened by window.open

后端 未结 5 1695
攒了一身酷
攒了一身酷 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条回答
  •  萌比男神i
    2020-12-05 05:51

    Actually what you did is destroy the parent (page A) of the created window (Popup), so it has no more reference to the original parent therefore you can't get a direct reference.

    The only solution I can think of is using a browser that offers you added javascript capability to cycle through active windows (tabs) and find one that has a special property (ie: your reloaded page A) that gets recognized by the popup.

    Unfortunately I guess only firefox has some added capability or extension that gives you this flexibility. (it is also a security risk though)

提交回复
热议问题