Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

207
Views
How do I disable the "Leave page" confirmation dialog in Firefox?

I have the following code in my Vue application for detecting when the user closes the tab:

onBeforeUnload() {
  window.onbeforeunload = null;
  return undefined;
}

Disabling the "Leave page" confirmation dialog works in Chrome, but not on Firefox. Why is that? How do I disable the confirmation dialog on Firefox?

Edit 1: Adding and removing beforeunload listeners

created() {
    window.addEventListener('beforeunload', this.onBeforeUnload);
},
beforeDestroy() {
    window.removeEventListener('beforeunload', this.onBeforeUnload);
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Changing my onBeforeUnload method to this fixed the problem:

onBeforeUnload(e) {
  window.onbeforeunload = () => {};
  delete e.returnValue;
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!