Skip to content
Discussion options

You must be logged in to vote

Hi @isaosenberger,

Can you modify the code to the pavlovia plugin? If so, removing the window.addEventListener(...) might do the trick.

If you can't easily modify the plugin code, then adding this statement might do the trick:

window.addEventListener('beforeunload', function(event) {
    event.stopImmediatePropagation();
}, true);

This will add a new event listener to the beforeunload event, and it will stop the event from propogating so the other event listener for pavlovia will not be called. The downside is this will stop all functions tied to beforeunload, so you have to ensure that there are no other functions that are triggered by that event.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@isaosenberger
Comment options

Answer selected by isaosenberger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants