Window.open only if the window is not open

前端 未结 3 1415
予麋鹿
予麋鹿 2021-01-18 02:14

I have a link on my site that opens a new window to a page that plays a very long audio file. My current script works fine to open the page and not refresh if the link is cl

3条回答
  •  不知归路
    2021-01-18 02:50

    Like you said, after navigating away from original page you're losing track of what windows you may have opened.

    As far as I can tell, there's no way to "regain" reference to that particular window. You may (using cookies, server side session or whatever) know that window was opened already, but you won't ever have a direct access to it from different page (even on the same domain). This kind of communication between already opened windows may be simulated with help of ajax and server side code, that would serve as agent when sharing some information between two windows. It's not an easy nor clean solution however.

提交回复
热议问题