How to get the URL of currently open tabs in all browsers using php or javascript?

If anyone can recommend a little or have little knowledge on how to do this, let me know.

thanks

+2
source share
3 answers

You cannot, this information is simply not available through any standard interface (except for the window to which you already have a link). You can understand why. You would not want the site owner on one of your tabs to be able to find out what all your other tabs showed, this will be a massive invasion of your privacy.

For windows that you already have a link to, you can get the URL of what this window shows ( window.location.href ), and possibly its parent window ( window.parent.location.href ) ( window.top.location.href ), and sub-frames ( window.frames[n].location.href - I think). But this will not give you the tabs that you requested.

This information is most likely available through the extension mechanism of various browsers (Firefox add-ons, Chrome extensions, etc.), but it will only be a browser extension that requires explicit installation by the user, and (currently) requires recording one for of every browser provider where not all providers offer an extension mechanism.

Separately: this information, of course, is not sent to the server (you noted your php question).

+9
source

if you expect to do this from a web page, then you cannot get it through any language running on the server or on the client side.

If you asked in the context of Firefox Addons, this might help:

 var tabs = require("tabs"); for each (var tab in tabs) console.log(tab.url); 

But this only works for Firefox Addons, and not for regular javascript.

Link https://addons.mozilla.org/en-US/developers/docs/sdk/1.0/packages/addon-kit/docs/tabs.html

Hope this helps.

+4
source

There is actually a way, just mark all the tabs, and then drag the bookmark somewhere, for example into an html form, and then you can use, for example, javascript to read it from there. I don’t know about other browsers yet, but in firefox you get the name of the bookmark followed by all the URLs, all separated by newlines, with no ending newline at the end.

0
source

Source: https://habr.com/ru/post/1202918/


All Articles