How to set focus to already opened tab in firefox?

后端 未结 5 1001
不思量自难忘°
不思量自难忘° 2021-02-19 05:59

I have a link which opens a page in a new tab in firefox.


    Go to Portal

Howe

5条回答
  •  难免孤独
    2021-02-19 06:20

    I had a similar problem in my project. Luckily, whenever I needed to set focus on already opened tab, it also needed to be refreshed. So I did it with the following trick, which first opened again tab with same href and target, got reference of that window back, closed it, and opened again with same parameters.

    popup = window.open('/popup.html', '_popup')
    popup.close()
    popup = window.open('/popup.html', '_popup')
    

提交回复
热议问题