Unfortunately this is not possible if you did not open the tab.
The way to update the page would be through a window.location.reload()
in Javascript. However, the control of tabs is completely in the hands of the browser if the user opened these tabs on his own.
Now, the simplest way to maintain control over one of the tabs is by opening through the Javascript itself inside the page by clicking on the link:
const janela = window.open('url', '_blank')
janela.location.reload()
See that you now have control of the tab through the variable janela
, but this is not guaranteed to open a tab, since the full control of tabs and windows is done by the browser and each implements the _blank
differently.
Still, be careful because you will only be able to control the other pages from one original page, which opened the others.
See also:
You can update a tab even if you haven’t opened it, as long as that tab is from the same domain. You can put an Event Listener on
window
to respond to changes inlocalStorage
. If a tab modifies thelocalStorage
, the other tabs capture the event, and can perform a function according to the received event.– Andre
But then you are assuming that it will modify the Torage locale. In case you are creating an event in something that does not belong to the window so that when the event happens, you have a
e
that points to the window that created the event so that you can manipulate it. I personally think this is a bit of a scam...– KhaosDoctor