Accessing the content of other tabs in a browser

Solution 1:

Whilst you can easily open a new window using JavaScript, I'm sure that is as far as it goes. From a security point of view you wouldn't want JavaScript in one tab being able to query / access the DOM in another tab. Any site would then be able to gain access to your bank account details, etc. if both sites were opened in separate tabs.

Solution 2:

You can access the new window/tab if it was opened with JavaScript and the page indeed is in the same domain.

You can open the window/tab like so

var win = window.open("/path_to_page");

Then you'll have to wait for the page to load before you can access e.g. the title.

win.onload = function(){ alert(win.document.title); };

Solution 3:

You could use HTML5 cross-window messaging (archive.org link...but that's kind of cutting edge.

Even in that case, you'd probably need to hijack the <a> tag 'click' event with JavaScript and open the window yourself so that you'd have access to the new window object for posting messages.