Estoy abriendo una nueva ventana con la URL https://twitter.com/i/oauth2/authorize?scope=tweet.read%20users.read%20follows.read%20follows.write&state=state&client_id=clientID&response_type=code&code_challenge=789089&code_challenge_method=plain&redirect_uri =http://localhost:4200/aplicación/devolución de llamada
Pero, cuando la URL se carga en una nueva ventana, la propiedad popupWindow.closed se establece en verdadero. Por lo tanto, se abren múltiples ventanas al hacer clic en el botón. Esto no pasa con la url oauth de linkedin
if (this.popupWindow == null || this.popupWindow.closed) { this.popupWindow = window.open( `${authUrl}?${params}`, 'twitter', `menubar=no,location=no,resizable=no,scrollbars=no,status=no,toolbar=no, width=${width},height=${height},top=${top},left=${left}` ); } else { this.popupWindow.focus(); }¿Cómo evito que se abran varias ventanas?