I have a JS that opens a new tab. And I want to refresh the original window but only once the opened tab is closed. How would you do it?
Here’s the code I have now (which obviously doesn’t work – it does the refresh immediately after opening the new window):
window.open( SOME_WINDOW );
window.location.reload();
You can do it with something like this. Store the window handle, and use a polling timer to check the closed property of the window.
Another solution (even nicer) can be found here