I'm using the Office Dialog API in JavaScript in an add-in that runs on Word, Excel and PowerPoint. They 3 use the same code and manifest, but in Excel the popup won't show up. Looks like it doesn't even execute the callback function, since my logs are not showing up in console.
The strange thing is that it works on Word and PowerPoint, but doesn't on Excel.
The code I'm using to open that dialog is this one:
function showLoginPopup() {
//PÁGINA HTML CON EL SCRIPT DE MSAL PARA EL LOGIN
var fullUrl = "https://contoso.com/fallbackauthdialog.html";
//ABRIMOS LA VENTANA EMERGENTE PARA EL LOGIN
Office.context.ui.displayDialogAsync(fullUrl, { height: 60, width: 30, promptBeforeOpen: false}, function (result) {
console.log("Dialog has initialized. Wiring up events");
console.log(result);
loginDialog = result.value; //RESULT.VALUE REPRESENTA LA VENTANA EMERGENTE
//CUANDO LA PÁGINA PRINCIPAL RECIBA UN MENSAJE DE LA VENTANA EMERGENTE, SE LLAMARÁ A LA FUNCIÓN PARA
//PROCESAR ESE MENSAJE
loginDialog.addEventHandler(Office.EventType.DialogMessageReceived, processMessage);
loginDialog.addEventHandler(Office.EventType.DialogEventReceived, () => {
libreriaLoading.showToast({
text: 'No se ha podido iniciar sesión',
type: 'warning',
});
tokenAuth = null;
localStorage.clear();
document.getElementById("botonlogin").disabled = false;
libreriaLoading.hideLoading();
});
});
}