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

后端 未结 7 1922
梦谈多话
梦谈多话 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:16

    It is client behaviour, so I think you could do something with javascript, like check for browser history, but it is ambiguous between a new tab and a new windows.

    Beside that, not all browsers has tabs and not all browsers has the same meaning for what a tab is (in some are different process, in some others they aren't).

    But, why would you want to check that? It really matter if your application is executing in a new tab or not? I don't think so...

提交回复
热议问题