Why the window.onbeforeunload function is being blocked in my application

  • "I have deployed a Shiny app that uses shinyjs to set an onbeforeunload handler with the js$toggleExitWarning() function."
  • "Locally, the navigation block works correctly, and I cannot close the tab."
  • "However, in my app deployed on ShinyApps.io, the onbeforeunload does not trigger, and I can navigate away from the page without a problem."
  • "I need to know if there is a server security setting that is blocking this JavaScript event."