Check effectively if popup was blocked by browser

This commit is contained in:
Vincent CARPENTIER
2022-03-23 11:55:07 +01:00
committed by GitHub
parent 5472cfd1c2
commit aae2dd85e5

View File

@@ -59,7 +59,7 @@ const openCenteredPopup = function(url, width, height) {
const newwindow = window.open(url, 'Login', features);
if (typeof newwindow === 'undefined') {
if (newwindow || newwindow.closed) {
// blocked by a popup blocker maybe?
const err = new Error("The login popup was blocked by the browser");
err.attemptedUrl = url;
@@ -70,4 +70,4 @@ const openCenteredPopup = function(url, width, height) {
newwindow.focus();
return newwindow;
};
};