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,753
  • 72
  • 57
  • 129
C Sharper
  • 8,284
  • 26
  • 88
  • 151

1 Answers1

1

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

blacksun1
  • 116
  • 4