How to recover form information for a webpage in Firefox

26

9

I filled out a lengthy form on a webpage which rejected my submission due to a server error. I can't seem to recover the form input.

Is there any way in Firefox to look into caches, history, etc. to recover this information?

Jason S

Posted 2010-09-01T17:39:49.387

Reputation: 5 983

Answers

5

I'd recommend you to install Lazarus - it has saved my butt enough number of times.

Sathyajith Bhat

Posted 2010-09-01T17:39:49.387

Reputation: 58 436

Also lazarus somehow conflicts with firebug. – Tomáš Zato - Reinstate Monica – 2015-09-13T00:06:21.230

Granted, it's “dead," and the developer seems to be MIA, but it still works for me. – Animadversor – 2017-01-04T00:07:24.810

@Animadversor It does not work anymore in Firefox v53, due to incompatibility (as reported by Firefox at startup). – David Balažic – 2017-06-07T17:28:52.813

"This add-on is not compatible with your version of Firefox." "Not compatible with Firefox Quantum" – user598527 – 2018-06-14T15:35:29.807

2"Form-saver" tools like Lazarus must be installed prior to losing data, not after. OP is asking about recovering lost data. – user598527 – 2018-06-14T15:38:46.953

3

Lazarus is promising. But, alas, Lazarus is dead (!). Lazarus does not work. The contact form on the site is broken. And the developer does not respond.

– Nicolas Barbulesco – 2014-04-15T11:39:03.257

6

Whew! I figured out a solution -- I was able to hit the "back" and "forward" button with the "Live HTTP Headers" extension capturing incoming/outgoing traffic, and the form information was part of a POST response. (Firefox will resend form input, not sure where that's stored, but doesn't have any obvious built-in way to display it to users)

Jason S

Posted 2010-09-01T17:39:49.387

Reputation: 5 983

2I think it's stored in RAM, since you can hit "Back" to get back to the form with your data filled in, but I've never heard of Firefox restoring those form values after you close and restart the browser. – David Z – 2010-09-01T18:47:01.607

You might want to have Lazarus [ https://addons.mozilla.org/en-US/firefox/addon/6984/ ] installed, if something like this happens again. – Sathyajith Bhat – 2010-09-01T21:15:52.167

@Sathya: consider posting as a separate answer, I'd vote it up. – Jason S – 2010-09-25T16:31:48.487

I've posted the comment as an answer. – Sathyajith Bhat – 2010-09-25T16:49:50.860

"This add-on is not compatible with your version of Firefox." "Not compatible with Firefox Quantum" – user598527 – 2018-06-14T15:39:22.587

@user598527 Use the Developer Tools instead, see the comment by sh1. – user31389 – 2018-12-05T10:58:49.393

1

Maybe this wasn't true three years ago, but Firefox's built-in web developer tools currently have facilities which let you extract the information in a similar way. Just answered here.

– sh1 – 2013-12-07T09:08:54.573

This is an interesting idea. Firefox definitely has the form data in memory. But how to get it ? Pressing Back does not re-send the form data, as far as I know. – Nicolas Barbulesco – 2014-04-15T11:42:18.203

1I have another idea. Reloading the page, with examining the headers... I am going to post it as an answer. – Nicolas Barbulesco – 2014-04-15T12:05:35.007

5

My method was tested in an emergency case (lost Facebook comment). It needs a third party tool – ProcessHacker. It's only for Windows – for a Linux method, check that question. It should work with every browser, not only Firefox.

There are two ways. First is more user friendly, but if PC would crash, you'd lose data. Second is more fail-safe, but needs an additional tool. With second you'd get a file you can give to some expert, if that tutorial would be too difficult. You can do Way II, steps 1&2 to be safe and then Way I to make it easier. I used Way I.

That's the exact list of steps I took:

Way I

  1. The first thing to do is to pause the process. This is critical for success. I opened ProcessHacker (PH), found firefox.exe on the list (you can click on the "Name" column to get rid of the tree view and get a list view) and from the context menu I used "Suspend". Then it would look like Firefox is frozen, so if Windows would ask you about terminating not responding process, don't do it! It's alive, just sleeping.

  2. Double click on the firefox.exe row or choose "Properties" from the context menu of firefox.exe.

  3. Go to the "Memory" tab and click on the "Strings..." button in the top-right corner.

  4. I used default settings ([✓] is checked checkbox, [ ] is unchecked) – Min. len.: 10; [✓] Detect Unicode; Search in [✓] Private / [ ] Image / [ ] Mapped. Click on the "OK" button.

  5. After a while (up to minute, but probably a few seconds) you'd get all strings found. With such settings I've now over 700k strings. Check every one searching for the lost text. Just kidding! Go to the next point :)

  6. Click on the bottom-left "Filter" and choose menu item that fits you the best. I used "Contains (case insensitive)".

  7. Enter some word that was in your lost text. Word because some strings could be saved, e.g., as "foo bar". The longer and more unique word, the fewer results you'd get (so it will be easier). If you don't get results, try another word. I had my comment in two parts of the memory – in one it was full, in other just second half.

  8. Look through the results. Most strings will be visible with null character after every char, e.g., foobar will be f.o.o.b.a.r (hex 66 00 6F 00 6F 00 62 00 61 00 72). Don't worry about it; it's the Unicode thing. If you'd find your text click on the "Save..." button. My comment was looking like part of HTML, i.e., it had <div> and <span> tags around.

  9. Open the saved file in an editor that supports Unicode. I don't know about built-in Notepad, but it should work. I used Notepad++.

  10. Find the text, copy the needed part. Say "hooray". You may now right click on firefox.exe row from the main window and choose "Resume".

Way II

  1. Repeat step 1 from Way I.
  2. Find firefox.exe row, right click on it and choose "Create dump file..." from the context menu.
  3. Use some editor which supports loading big files. Notepad++ should handle it, but you need to turn off syntax coloring and spell checking. Examples: HxD (freeware, IMO better), wxHexEditor (FLOSS).
  4. Go to step 10 from Way I.

Krzysiu

Posted 2010-09-01T17:39:49.387

Reputation: 206

Smart approach! Didn't work for me today (never make long edits in Gitlab on-line tool ...) but I will keep the technique (and the nice ProcessHacker tool) under the pillow. – None – 2017-02-13T00:08:58.257

You can create a dump file from Task Manager, see this answer. So no need for 3rd party tool like ProcessHacker.

– David Balažic – 2017-06-07T17:35:25.713

Thanks, David. I still think one should suspend process ASAP and answer you linked doesn't say anything about it. In case of mistake suspending would help a lot. Also there's string search function in PH. As chars are often padded with 00h (null), you still need some editor to find text (Notepad won't do the trick), so not entirely "without 3rd party". Meanwhile I lost YouTube and Disqus comment (i.e. heavy JavaScripted and dynamic pages) - it worked again, but it's not 100% sure method, as Tibo shows. – Krzysiu – 2017-06-13T16:20:42.427

if there are several chrome process running, is there a way to know which one we should work with? – JinSnow – 2017-07-11T11:57:28.727

@JinSnow https://unix.stackexchange.com/a/209699/167757 - maybe that would help. Also checking start time of process might help in some cases.

– Krzysiu – 2017-09-07T19:34:35.710

1What a great answer. Thank you for introducing me to ProcessHacker. I failed to find what I was looking for with the default filter settings but succeeded by marking all checkboxes. Of course, search results increased by a lot but applying multiple filters in succession narrowed it down. Ah, saved me from rewriting some lost e-mails. (+1) – Linear Christmas – 2019-02-09T17:29:38.743

3

Modern versions of Firefox have Developer Tools on board that can be used for this. Press Ctrl+Shift+Q to bring up the Network tool, press F5 to reload the page (confirm the warning that the content will be resubmitted, we want exactly this to happen) and select the (probably) topmost line in the Network tool. It should show POST as method.

On the right-hand side a set of tabs appears. The one we are interested in, "Headers", should already be open. Click Edit and Resend to get the full request contents. The Request Body field contains the full request data in url-encoded form. Run it through a decoder like this one to get your data back.

Roland W

Posted 2010-09-01T17:39:49.387

Reputation: 261

1Exactly this. Note: some websites encode the contents differently, in my case it replaced spaces with + and newlines with \r\n. – user31389 – 2018-12-05T11:02:02.913

2

Another possible solution to recover your data is to make a core dump of Firefox (assuming you are using it under Linux or similar). See this answer for more details: https://superuser.com/a/236400/180675

erik

Posted 2010-09-01T17:39:49.387

Reputation: 1 519

2

I found a new addon that can be used to recover lost postdata: Form History Control

The author claims:

This plugin also stores text from editor fields as you type, so you never have to loose your work when disaster strikes. Recover your lost work after session timeouts, network failures, browser crashes, power failures and all other things that will destroy the hard work you just put into writing that important email, essay or blog post.

EDIT: Oh, it indeed saved this post. :)

Calmarius

Posted 2010-09-01T17:39:49.387

Reputation: 778

This extension is a (very) nice idea. But it is too complicated. This extension proudly says that it "auto-saved text entered in any form". Does it save "contenteditable" user-entered data ? For instance, Disqus comments and Wikipedia WYSIWYG edits. – Nicolas Barbulesco – 2014-08-19T09:19:59.277

@NicolasBarbulesco I don't know, try it, then tell the developer if it doesn't work. I suppose it works for input and textarea fields only, and form postdata. The primary reason I downloaded it because many stupid forums simply log you out if you are writing a post for too long, eating your whole writing... – Calmarius – 2014-08-19T10:47:11.747

1

*** Correction: although the below does work in Firefox and Chrome, the snapshot in Firefox produces a (gzip'd) binary file. So for now this approach works only in Chrome : (

For both Firefox and Chrome, I think a much easier way compared to an actual core dump of a system process is to use Developer Tools.

Go to the Memory tab (used to be named "Profiles" in Chrome), then take a Snapshot and save it to a file (it's just text). Then search the file for some word that you know you had written in your form – that's probably the fastest way to find the entire content.

Screenshot of Firefox Developer Tools – Memory tab

I just tested it on Chrome in a page where a dynamic form (JavaScript) messed up by itself and lost all the text I had written. It was still in memory and I could recover it even if I hadn't submitted it yet!

See https://developer.mozilla.org/en-US/docs/Tools/Memory and https://developers.google.com/web/tools/chrome-devtools/memory-problems/heap-snapshots for more details.

Kamal

Posted 2010-09-01T17:39:49.387

Reputation: 156

in Firefox, the file is just compressed with gzip, so a simple zcat xxx.fxsnapshot allows you to get the contents. – vaab – 2018-04-07T08:29:25.280

1Thanks @vaab it is indeed gzip'd, but after uncompressing it's still a binary file. gunzip -c (equivalent to zcat on Mac) returned mainly question marks... I ran strings on it and I could get some info, but I don't know if a full form content could be recovered that way. – Kamal – 2018-04-07T15:07:14.750

1

I'm afraid form contents aren't cached... Regular input fields (single line) may be saved with auto fill, yet text area's (multiple lines, the one that you probably typed in) aren't.

BloodPhilia

Posted 2010-09-01T17:39:49.387

Reputation: 27 374

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 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 2010-09-01T17:39:49.387

Reputation: 371

This needs updating, now use Developer Tools instead of installing extensions. – user31389 – 2018-12-05T11:05:05.703