const childWindow = window.open('/training');
const onChangeTxtContent = (txt) => {
if (childWindow.closed) {
//train window closed
return;
}
const event = new CustomEvent('txt-content', {detail: {txt}});
childWindow.dispatchEvent(event);
}
window.addEventListener('txt-content', ({detail})=>{
console.log(detail?.txt) // here is txt from parent (start) page
})