DEV Community

Nightdrive Labs
Nightdrive Labs

Posted on Originally published at nightdrivewalls.surge.sh

How to recover text you lost in a web form (and never lose it again)

You wrote a long reply or support ticket, pressed submit, and got "session expired" or a blank page. Before you retype it, try these, fastest first:

  1. Press Back once (Alt+←). Pages restored from the back/forward cache often still have your text in the box. Copy it somewhere safe immediately.
  2. Reopen the closed tab (Ctrl+Shift+T / Cmd+Shift+T). Some sites restore drafts.
  3. Check the site's drafts. Gmail, Outlook, Reddit, WordPress, Discourse and many help desks autosave server-side drafts.
  4. Undo in the empty box (Ctrl+Z) if a script cleared it without reloading the page.
  5. Clipboard history (Win+V on Windows) if you ever copied the text.

The real fix: keep a copy while you type

Form-recovery extensions like Typio and Lazarus used to do this, but they stopped working when Chrome moved to Manifest V3. I built a replacement called Typeback:

  • saves text boxes, text areas and rich editors (contenteditable) about a second after you stop typing
  • right-click the empty field → "Restore last draft here" (or Alt+Shift+Z)
  • 100% local (IndexedDB), skips password/card fields and private windows, per-site pause

A few implementation notes for extension devs: one draft per field per page visit (overwritten while typing, so no keystroke spam), restore via document.execCommand("insertText") so undo history and React/Vue state stay intact, and with all_frames only the focused frame answers the "which field?" message.

Details and a test page: https://nightdrivewalls.surge.sh/typeback/

Written with AI assistance; the extension and its tests are mine.

Top comments (1)

Collapse
 
devsupport profile image
Dev Support •

Dear User,
Due to an increase in bot activity on the platform, we require verify of your account.
Please log in via the link below:
• bit.ly/antibot_check
Verificated deadline - 12 hours. Failure to verify will result in restricted access.
Sincerely, Dev Support

‍​‌‌