0

If multiple tabs are active on browser. Lets say -

Tab-1 : google.com

Tab-2 : youtube.com

Tab-3 : Facebook.com

Now if I open my website in Tab-4 : example.com and switch to Tab-2 and then again come to Tab-4 , then on example.com (application I am building right now), I want to identify I have came there from youtube.com

How can I do it in Javascript or jQuery?

Note :-

To identify active tab I have written code :-

document.addEventListener("visibilitychange", function() {
      document.title = document.hidden ? "I'm away" : "I'm here";
});
Brian Tompsett - 汤莱恩
  • 5,438
  • 68
  • 55
  • 126
C Sharper
  • 7,660
  • 22
  • 83
  • 140

1 Answers1

1

You don't have any way to see what window you came from as this would be a security violation.

blacksun1
  • 106
  • 4