In Chrome sometimes opened window is sharing event loop with the original window, in cases like the same origin or the same parent domain. If one tries to debug one of such windows then others are hanging.
I was wondering whether it is better to rewrite like that:
export function windowOpenNoOpenerWithSuccess(url: string): boolean {
const newTab = window.open();
// pop-up allowed
const success = !!newTab;
// close immediately to avoid rendering
newTab?.close();
if (success) {
// open safely with own event loop
windowOpenNoOpener(url);
}
return success;
}
Updated: i tried with above and it does not help, Chrome blocks new windows besides first by default.