T
T
triggerfinger2018-01-26 22:55:27
JavaScript
triggerfinger, 2018-01-26 22:55:27

A page is opened in a tab: how to open a link in this tab when following a link from another site?

Tab #1 is open, say http://coolsite.com/one
Tab in the background.
Active tab #2 is open at http://anothersite.com/article
On this page there is a tag aleading to the domain as in tab #1, for example http://coolsite.com/two
IMPORTANT: the site from which the link does NOT belong to me anothersite.com
This is just a link to the mail. I don't want the user to have a bunch of windows open.
How, when clicking on this link, to make the window open not in a new, third tab, but in tab No. 1, where this domain is already open? Those. when you go, make tab No. 1 active and go to the address you need.
I believe this is possible, I have seen the implementation, and it seems that applications on the same domain can communicate between tabs at all. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aleksei Podgaev, 2018-02-01
@alexiusp

On the same domain - can communicate through localStorage. In your example - not one domain.
Sites on different domains cannot have any influence on each other for security reasons.
Something like this might be possible if the target site gives the user not a regular page, but a pwa. Google progressive web apps - there you can implement a bunch of cool stuff if you get confused.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question