I have 2 applications that need to work together.
the parent has a list of jobs and the user may open them in the second (child) application as many jobs as he wants.
The code to open a child is:
window.open(finalUrl, 'W' + event.data.ProjJob, "alwaysRaised=yes,titlebar=no,left=0,top=0,width=800,height=800");
if (!inboxPopUpJobs.some(j => j.job === event.data.ProjJob)) {
setInboxPopUpJobs(PopUpJobs => [...PopUpJobs, event.data.ProjJob]);
}
When the child windows needs to refresh the parent and close, it sends a message using the ‘broadcast-channel’ library
The message is received OK by the parent with the job number so the window is intercepted by using:
const w = window.open("", 'W' + job);
then to close it I use:
await w.close();
but now the parent window hangs, there is nothing showing in the console as error and there is no way to even refresh the browser (EDGE and Chrome)
I tried: w.opener.focus();
and window.focus();
but it is still hanging.
Does any one have a suggestion how to prevent the parent from hanging?
Thank you