Auto Save Forms No Cookie

By private_lock Last update Apr 21, 2008 — Installed 1,251 times.

Script Summary: Saves form data every few seconds and gives option of repopulating form later.



Version: 2008-04-21

Description:
Did you ever type in a long eMail into the webform of Yahoo, GMail or any other freemail-account? What about forum posts? You like to write long stories and you cannot restrict yourself to one-line-answeres?

*BANG!*

Firefox crashed! The window is frozen, it might even be possible to read, whats on the screen, but you cannot copy it! Or the window is gone completely alltogether with your hard work of the last hour?

How about an autosave function, the way you know and love it from your Office text processor (OpenOffice Writer, M$ Word)? This is exactly what this script is supposed to do: It will remember the latest version of your work right before the crash occured. You don't need to copy the text manually back and forth.

And you can easily press "submit" or "preview" without fear the server logged you off or crashes while processing your request. Just check, that the server really did not accept your post (to not duplicate your order), go back to the form, where you typed for hours and klick a link in the new red box in the upper right corner.

As long as the current form has not been changed, the sript will offer you any previous dataset, it can match to this site and form (NOTE: The script will never offer information dedicated to another site!). First you see the number of available datasets (often only 1) and the redo link. A click on redo will bring back the youngest and hopefully the last words you typed before the crash. If there was only one matching form, the box will hide, to not confuse you. Even though it's not visible, behind the scenes the script will update this entry to reflect all your changes while you go on working on it. It's like the crash never happend. You are right back and prepared for the next!

Sometimes you choose not to restore an old form and directly type ahead. The script will change the box to allow you to browse between these alternatives. Click on '<' or '>' to navigate. This browse cycle is always sorted for time of last modification. So if you change a dataset, it will jump to entry 1 of the list, shifting the others back. This even works between multiple tabs/windows. (Please allow up to a minute for all forms to synchronize their browse cycle order.)

WARNING: The undo-buffer cannot be restored. Therefore Ctrl+Z will partly undo your last browse action and immediately overwrite the backup, leaving you with two copies of the same content for this textbox.

The current entry number in the browse cycle is followed by an exclamation mark! This is a link to delete this dataset from memory. If you click it, the form will not change. Only the internal copy is removed. If you change or submit the form, a fresh internal copy is newly created. Otherwise you can choose to redo another entry by browsing through the remaining.

WARNING: It is by design prohibited to delete the last entry. This is a required feature, to rectify it being an autosafe. If you enter confident information, it will reside unencrypted within the configuration data of your browser, until it expires (7 days by default). To overcome this, you should either:

1. Add that website to the excludes of this script, to never save a form from there.
2. Temporarily deactivate this script or greasemonkey itself BEFORE you load the form.
3. Workaround:
- Come back to the form after transmission.
- Click on redo and browse until you see the confident data.
- Manually delete it from the textbox.
- The script will synchronize the form with the saved entry and also delete those contents!
4. Workaround:
- Type "about:config" into the location bar and press Enter.
- Start type "Auto Save Forms No Cookie" into the search filter.
- Select any offending entries from the list.
- Rightclick and reset the value.

The methods 1 and 2 are strongly recommended. The workarounds 3 and 4 only repair the damage, after it has been done. You could easily forget about it. In addition information written to a harddrive is not neccassarily gone by simply marking that space as "free".

Inspired by "Auto Save Forms" from Dave Child available at http://userscripts.org/scripts/show/1525

Features of the old script:
- Save content of all textareas and all text-input elements on a website for reuse
- Never save passwords (currently all other input elements are left alone)
- Each entry expires and is strictly associated to a website
- Save entry automatically while typing

Problems of the old script:
- Only a single record for a whole domain
- Potentially large amounts of data by unlimited number of extra-cookies
- Interferes with Cookieculler -> data lost

Additional features of my rewritten script:
- Keep the values in a pool of greasemonkey variables
-> Safer (the server cannot see the data until you post it)
-> More persistent (you can empty your cookies on a regular basis without loosing your saved forms)
-> Better control (just use about:config, and filter for "Auto Save Forms No Cookie")
- The time till expiry is userdefinable -> about:config (default 7 days)
- The pool will automatically adjust its size (grow and shrink as needed)
- Browse through any matching forms ("browse cycle")
-> Independent forms (on other website or of differing number of textboxes) have independent browse cycles
-> Matching forms from the same website share a "browse cycle"
- Periodically scan the pool for new matching entries (once a minute)
-> This way you can easily copy forms from other tabs/windows
- Sort "browse cycle" for age
-> The youngest item will jump to position one
-> If two or more forms of the same browse cycle are modified, they will compete to be the number one
-> If you don't change an item (don't type on keyboard), it will keep its date of expiry
- Manually delete old data (until only a single entry is left for this form as you see and edit it)
- Intelligent collision detection -> switch to another entry
- Recognize if a website already contains the contents of an entry
-> Facilitates previews of forum posts
-> Reduces the number of similar entries
- Fixed placement relative to window, to easily browse datasets in long scrolled forms

History
2008-04-20 Initial version
2008-04-21 Textual description, recognize previous, fixed placement

Ideas for future changes:
- Keyboard navigation - Tab focusable
- Minimal length of text to enter before save
- Monitor DOMaddNode and DOMremoveNode to trigger a rescan
- Option to exclude single word search boxes (found too often, to be useful)
- Config and help screen
- Size, position & style
- Writeprotected permanent entries
- Exclude content of disabled and readonly textboxes??? Licence data junk?
- really browse the pool contents and show each entry in full text.