We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

browser/tab close event (onbeforeunload) is not working

  • 1 resposta
  • 3 have this problem
  • 2 views
  • Last reply by cor-el

more options

window.onbeforeunload = function (e) { // Your logic to prepare for 'Stay on this Page' goes here

   return "Please click 'Stay on this Page' and we will give you candy";

};

i have used above query.

window.onbeforeunload = function (e) { // Your logic to prepare for 'Stay on this Page' goes here return "Please click 'Stay on this Page' and we will give you candy"; }; i have used above query.

All Replies (1)

more options