Поиск в Поддержке

Избегайте мошенников, выдающих себя за службу поддержки. Мы никогда не попросим вас позвонить, отправить текстовое сообщение или поделиться личной информацией. Сообщайте о подозрительной активности, используя функцию «Пожаловаться».

Learn More

window.onbeforeunload not functioning if restore previous session is enabled

  • 1 ответ
  • 1 имеет эту проблему
  • 7 просмотров
  • Последний ответ от 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.

Все ответы (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.