Technology Tales

Adventures & experiences in contemporary technology

Avoid seeing “before you leave” messages in Firefox

20th August 2024

After updating a page in a Textpattern instance that I have, I got a pop-up message asking me to confirm my intention to leave the editor page. While recalling that there was a way to avoid these extra dialogue boxes, I could not remember what it was. In any case, it was hardly as if I needed to add extra mouse clicks to my day, even if there may have been good intentions on the CMS developer’s side.

The solution going into about:config. If doing this for the first time, you will be presented with a confirmation screen with an override tick box for later incursions. Once past the screen in question (assuming that you have not overridden it at a previous encounter), the next step is to search for dom.disable_beforeunload and set its value to true, since the default value is false.

While that did what I needed, I also noted another option called dom.require_user_interaction_beforeunload with a value of true. One has to wonder if setting that to false instead of changing dom.disable_beforeunload would have a similar effect. When I tried this, dom.require_user_interaction_beforeunload did not work as fully as dom.disable_beforeunload. Thus, I suggest sticking with the latter for now.

  • All the views that you find expressed on here in postings and articles are mine alone and not those of any organisation with which I have any association, through work or otherwise. As regards editorial policy, whatever appears here is entirely of my own choice and not that of any other person or organisation.

  • Please note that everything you find here is copyrighted material. The content may be available to read without charge and without advertising but it is not to be reproduced without attribution. As it happens, a number of the images are sourced from stock libraries like iStockPhoto so they certainly are not for abstraction.

  • With regards to any comments left on the site, I expect them to be civil in tone of voice and reserve the right to reject any that are either inappropriate or irrelevant. Comment review is subject to automated processing as well as manual inspection but whatever is said is the sole responsibility of the individual contributor.