Sök i support

Akta dig för supportbedrägerier: Vi kommer aldrig att be dig att ringa eller skicka ett sms till ett telefonnummer eller dela personlig information. Rapportera misstänkt aktivitet med alternativet "Rapportera missbruk".

Learn More

window.onbeforeunload not functioning if restore previous session is enabled

  • 1 svar
  • 1 har detta problem
  • 7 visningar
  • Senaste svar av cor-el

more options

I have application script that uses window.onbeforeunload to perform a certain function when the window or tab is closed. This works fine in firefox (and other browsers), but won't work if the restore previous session browser setting is enabled. Any help is appreciated.

I have application script that uses window.onbeforeunload to perform a certain function when the window or tab is closed. This works fine in firefox (and other browsers), but won't work if the restore previous session browser setting is enabled. Any help is appreciated.

Alla svar (1)

more options

If you use Restore Previous Session then you aren't leaving the page if you close Firefox because you can resume the next time you open Firefox and you aren't suffering data loss unless the page uses complicated JavaScript that might not make it possible to restore the page. So that might be causing window.onbeforeunload not functioning as expected by you. I don't know whether this is intentionally.