如果浏览器上有多个选项卡处于活动状态。比方说-
选项卡-1: google.com
选项卡-2: youtube.com
选项卡-3: Facebook.com
现在,如果我在Tab-4 : example.com中打开我的网站,然后切换到Tab-2,然后再次转到Tab-4,那么在example.com (我现在正在构建的应用程序)上,我想要确定我是从youtube.com来到那里的
我如何在Javascript或jQuery中实现它?
注:-
为了识别活动标签,我编写了以下代码:
document.addEventListener("visibilitychange", function() {
document.title = document.hidden ? "I'm away" : "I'm here";
});发布于 2020-09-08 14:47:47
你没有办法看到你来自哪个窗口,因为这会违反安全规定。
https://stackoverflow.com/questions/63787896
复制相似问题