-2

Detecting Tab Change using javascript can be done easily using page visibility API as it is mentioned in this answer

Is there some way to get the information about the changed tab like the title of the tab/URL etc using javascript, jquery, or any other method?

  • Hi, please add your HTML and javascript so we can help. – BRABO Aug 25 '21 at 11:51
  • 3
    You want to get the title of the tab that the browser has changed *to*? So if I'm on your page and open a new tab to my bank you want to know what bank I belong to? And you don't see that as a *massive* security risk? – freedomn-m Aug 25 '21 at 11:52

2 Answers2

0

For (obvious) security and privacy reasons this is not possible on any modern browser I am aware of.

But since you asked for any other methods, you could achieve this pretty easily with a browser addon and the tabs api.

Xintaur
  • 121
  • 1
  • 6
0

Nope, Javascript interacts with web APIs that the browser has installed on it.

So in order to do this, there would have to be a way within one of the installed APIs to do this. Which I highly doubt there is. Also, Most browsers effectively run the DOM in a contained sandbox meaning that javascript and the web APIs can only access things from within its sandbox aka tab.

That said, it doesn't mean it's impossible. There may be an exploit in one of the API's allowing you to get other browsers info not usually available to you.

Feel free to crawl through all the web api docs to find an exploit and also try to engineer a way to break out of chromes tab sandboxing architecture via javascript.

I won't say it's impossible but it's highly unlikely unless someone makes a big mistake on a future release of chrome and one of the direct to browsers api's has an exploit. Sounds like a lottery win scenario to me just to read a tab.