H5P can't display alerts

Hi,

I just created a new H5P project for Moodle. This project displays a console.log message and an alert message (both lines of code are one after the other). Those lines are supposed to work as soon as the page loads. The console.log works but the alert doesn't.

When I upload this code to Moodle, the console.log message shows, but there is no pop-up screen showing my alert message.

Can't Moodle show alert messages? Should I do something special? Is it my fault or is it that Moodle doesn't display alert messages??

otacke's picture

Hi Alejandro!

Are you in a cross-origin situation? In that case, your browser might block alert() for security reasons (same for prompt(), dialog(), ...). Not sure what the current state of how this is handled looks like.

Best,

Oliver 

 

Best,

Oliver