0

There's a specific page I want to keep open on firefox no matter what. I'm rather clumsy, so I may sometimes misclick on some link on the page, or press CTRL+R and cause a reload, or even misclick on the close tab button or middle click on the tab, or press CTRL+F4 or something stupid like that.

The page is not static HTML. There's volatile data in the page that needs to remain safe from mishaps. Reloading the page causes this data to be flushed and lost.

I have no way to manipulate the page server-side or to make the people supplying the page add persistence to it. My only remedy is to do something browser-side.

I wish the browser would warn me (with a confirmation dialog, or something like that) whenever anything, event, user interaction, etc, attempted to reload, close tab, window, or browser instance, follow a link to another page, or otherwise end the current view. But not enact such changes to the browser tab without my express consent.

Failing that, something that can automatically save the page instance and all the data therein is also an acceptable compromise.

Process crashes or other high-level events (like the computer shutting down, losing power, or rebooting on its own) are obviously beyond the scope of this question.

Keeping the current page loaded and the data in the page "alive" is paramount.

I am open to tweaking about:config, a greasemonkey script, an addon, anything. The browser can be even made to work only with that page, so long the threat of data loss is eliminated. Even using another browser or version of FF that allows such a thing.

3
  • Did you try saving the page (Ctrl-S)? Does that work?
    – Gantendo
    Commented Jun 20, 2022 at 18:25
  • 1
    ... bookmark the saved file (open it first)... or print (or save) as a PDF?
    – Hannu
    Commented Jun 20, 2022 at 18:29
  • Bookmarking, saving the page is of no use. There's data being manipulated in the page that needs to stay there. It's not static HTML. Commented Jun 22, 2022 at 16:21

1 Answer 1

0

Suggested greasemonkey script :

window.addEventListener('beforeunload', (e) => {e.preventDefault(); e.returnValue = ''})
2
  • Does it need some special permissions? It's not working for me on any website I'm testing.
    – Gruber
    Commented Nov 4, 2022 at 2:14
  • @Gruber: Browser technology changes - see link. You might consider asking a separate question with more details about your setup.
    – harrymc
    Commented Nov 4, 2022 at 8:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .