disable "leave page" pop-up in pavlovia #2942
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @isaosenberger, Can you modify the code to the pavlovia plugin? If so, removing the 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 |
Beta Was this translation helpful? Give feedback.
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:
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 tobeforeunload
, so you have to ensure that there are no other functions that are triggered by that event.