Does Firefox cache submitted form content anywhere I can recover?

8

2

I just spent a lot of time writing a wiki page with Firefox, submitted it only to have the VPN fail and the submission lost. Going back in the browser I find my edits are lost.

Is there any way to recover those edits? Is there an on disk cache file (I have grepped ~/Library/Caches/Firefox/Profiles/)? Can I trick Firefox into resubmitting?

I have seen this question on ways to prevent this in the future, and I normally use "It's All Text!" which avoids this problem, but I'd like to recover this specific lost edit.

Schwern

Posted 2012-11-30T01:33:47.007

Reputation: 1 978

Answers

4

Don't change anything in that tab. Hit forward to get back to the connection error page, fix the network problem, and hit "Try Again". This will submit the original post.

Schwern

Posted 2012-11-30T01:33:47.007

Reputation: 1 978

Worked for me - site had timed out, so when I submitted the form I got a login prompt. Logged in, then used back button to skip back to the form I found it empty, using the forward button then got me the "attempt to resubmit page". On that page I did as suggested below and opened Web Developer tools on the Network tab, then clicked "resubmit" (or is it "retry"??). I was fortunate enough that the resubmission worked. Worth a try for others no doubt. Core dump was to be my next step.

– pbhj – 2015-04-07T22:22:01.590

I an ideal world, this works. But many sites badly break this. See my answer to come. – Nicolas Barbulesco – 2014-04-16T14:45:42.813

3

For the benefit of whom has had trouble in finding the path in the Firefox UI, in this answer I'll try to detail the operation suggested by user "sh1" step by step, which in my case led to a succesful recovery.

First, stay on the "time out warning / error" page you saw before when you unsuccesfully hit the submit button, without attempting other interactions with the web site. Maybe not strictly necessary, but safer indeed (need more experiments to clarify).

Disclaimer: I'm using the italian localization of Firefox, so I'm not sure about correct translation of some of the commands further detailed. Anyway the steps were:

  • As told by user "sh1", through the "tools" ("strumenti") menu, enter the "network" ("rete") section of the "web development tools" ("strumenti di sviuppo web").
  • Right click in the empty area of the web development tools window and select "start performance analysis" ("inizia analisi prestazioni"); FF will offer you to retransmit the same data actually sent before the problem (for now, sorry, I'm not sure if this is the same course of actions triggered by simply reloading the page from here).
  • Obviously at this point you will still be stuck with the error page, but this time Firefox has kept track of any data it has tried to resend; you will see a list of requests and the page elements pulled from the server.
  • At the top of the list, select the POST request by left-clicking it; the window will split
  • In the right pane, click the "Edit and resend" button ("Modifica e reinvia"); this will show another view, in which...
  • ...In the "request body" ("corpo della richiesta") frame, you will find, interspersed with only a few MIME headers, your precious submission in copyable plain text :)

I was succesful in recovering form data by using those Firefox built in tools alone. Aside this, and for speculation sake only, in my case core dump was not feasible. That's because I haven't altered the appropriate static system defaults (which are to be set beforehand; see http://bencane.com/2011/09/22/kill-creating-a-core-dump/ ; in the distro I'm using this time - latest Xubuntu - the default setting mix seems to be "no core dump").

Cheers

Edgar Grill

Posted 2012-11-30T01:33:47.007

Reputation: 141

In English the steps are: Menu -> Web Developer -> Network. Then resend the data, select the request and click Edit and Resend. Then see the Request Body field and copy the text into some safe place. (The text may be url-encoded or slightly changed in other way. If it's the case, find a decoder online or edit it yourself.) – user31389 – 2018-12-05T11:17:16.937

2

Extending on Schwern's answer, because in my case I'm unable to fix the fault:

Go forward to the failure screen again. In the menus selected Web Developer, Network, and then the 'Headers' tab, and hit the 'resend' button.

This should show you a form (so you can hack around with it) containing your lost content. It may not be in the most convenient format, but at least it's there.

Works for me, at least. I was actually sat here with the dreaded "your post fell down a hole" screen, and when I hit "back" I went back to some javascript which reset the form to blank (thanks Javascript!).

It's important to note that going forward means hitting the button next to the Back button. If you've gone back to the form and found your content lost, don't touch anything on the page which might try to send the newly-emptied content, because then your only choice will be rifling through the core dump but without any guarantee of success.

sh1

Posted 2012-11-30T01:33:47.007

Reputation: 123

Now there's a button called "edit and resend". In the "request body" box I found my comment I wanted to post. I had to paste into a text editor and replace '+' chars with spaces, '\r\n' with newlines and so on. So TL;DR: "Network" -> select the main request -> "Headers" -> "Edit and Resend" -> find and copy your text into a safe place. – user31389 – 2018-12-05T10:56:06.987

I have Network. But I don't have a Headers tab. I don't see the sent headers. – Nicolas Barbulesco – 2014-04-16T14:50:38.867

1

The Web browser definitely has the form data in memory. The difficulty is : How to retrieve this data ?

Here is my idea. I have not tried it. On paper, it works. This answer applies to Firefox and to other Web browsers.

In short : Reload the page, while examining the headers.

  1. Set up the machinery. We need a machinery to examine the HTTP traffic sent from the Web browser.
    • The best choice is the extension LiveHTTPHeaders for Firefox. But I think that installing this extension needs a restart of Firefox. Don't restart Firefox, of course ! It would be nice to be able to install this machinery without restarting Firefox. Otherwise, you just need to have this extension installed beforehand. If need arises, simply use a time machine. ;-)
    • If you cannot have the machinery ready in the Web browser, there is another option. This option is heavier. But its mighty strength is that it works for all Web browsers, and without restarting them. Install a simple Web server, or set up a proxy server (like Squid), on your machine. Make sure that your server logs the inbound traffic, with the full headers. And place a rule in the OS for redirecting all outbound requests towards 127.0.0.1. This can be done with a hosts file.
  2. Test the machinery. Create a new window in your Web browser. Write some text in Wikipedia here, and click Preview. Then verify that in your machinery you see your written text. If your machinery is the server option, you have to toggle off the redirection rule (in the OS) to load the Wikipedia form, and to toggle it on afterwards.
  3. To reload the page, right-click where the form was, and choose Reload. This is important. In some webmails, this will reload only the frame where the form was. Here we want to reload only as little as possible. If you click the button Reload in the address bar or in the button bar, or if you press Apple R, you risk reloading the whole page, and in some webmails this is shooting yourself in the foot.
  4. Normally, the Web browser will ask you : Do you want to send again the form data ? If you get this question, this is a good sign. Choose Send again.
  5. Examine the POST data sent, with the machinery set up in the step 1. Here you shall find your wanted data.
  6. Come tell us here that this solution has worked !

Nicolas Barbulesco

Posted 2012-11-30T01:33:47.007

Reputation: 371