Is it possible to detect if a user has opened a link in a new tab?

后端 未结 7 1906
梦谈多话
梦谈多话 2020-11-27 15:33

If a user is on your website and opens another link (also to your website) in a new tab, is it possible to differentiate this from the user just clicking on the link normall

7条回答
  •  醉梦人生
    2020-11-27 16:22

    The window.opener property in JavaScript will point to the window that opened the new window. However it doesn't distinguish between a new window and a new tab. Tabs are not part of the official W3C spec so there's no direct support for them.

提交回复
热议问题