FYI, when a website erases your text that you just spent an hour writing, you can use this little trick to recover it 99% of the time:

1. find the firefox pid

$ pgrep -l firefox

2. attach gdb to firefox and dump its core

$ sudo gdb <pid>
gcore firefox.dump
<this takes awhile>
quit
<firefox dies>

3. find your lost text in the coredump

$ strings firefox.dump | grep "a unique word/sentence from ur text"

i just did this today to recover a long post i wrote, and figured i'd show others!! 

@j3s the power of core dumping
@j3s this is delightfully scary
@ellenor2000 if u think this is scary u should see the weird wooden creature i encountered by lake michigan
@j3s oh, wow. What I just saw
@j3s if you're on firefox, there's a Textarea Cache extension.

@oreolek @j3s

for ages I've wanted to make an extension for exactly this problem, except my plan was to save the attributes and contents of every input on the page so it could be helpful with long complex multi-stage forms with heaps of tiny input elements, too (imo that's the bigger problem needing automation, because users can easily copy from huge text inputs). thanks for the reference!

@jonk @oreolek @j3s Have you tried Form History Control? I've been using it for a while and it saved my ass a few times.
@j3s for Windows users, you can do the same thing but with x64dbg. attach to the process, use the string search function, then resume all threads and detach.

@j3s @zkat Firefox UX keeps getting better 😅

more seriously that’s a very cool trick, I’m sure I’ll get to use it.

@j3s There's something very wrong with the world needing to do that.
@j3s @gsuberland Sudo gdb?
@adamshostack an oversight - if you own the firefox proc you should be able to leave sudo out.
@j3s @adamshostack You might need to adjust process attach permissions for the kernel though, depending on your distribution - "/proc/sys/kernel/yama/ptrace_scope":
https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace
SecurityTeam/Roadmap/KernelHardening - Ubuntu Wiki

@digitalfox @j3s Thanks! I had missed that change to how processes within a uid interact.
@j3s This is incredible. It feels like the web version of “if someone forgets what you told them: stop time, lay out the last 5 minutes of the timeline into a tesseract, destroy the current timeline, find when you told them the thing inside the tesseract and record what you said, then restart a new timeline at the point where you’re about to tell them a thing, at which point you can play them the recording”

@while1malloc0 @j3s Reminds me of https://www.youtube.com/watch?v=CXhnPLMIET0

Funnily enough just today I watched the episode of Rick and Morty that may have been inspired by that premise

One-Minute Time Machine - The Short Film that (probably) helped Rick & Morty win an Emmy

YouTube
@while1malloc0 @j3s Correct. That's what it does, except no timelines are damaged in the process. As you won't be needing that tesseract, you may leave it by the door.
@j3s segmentation fault. core dumped.

@j3s

Easier tip to make sure the website never erases your text (works on almost all browsers!):

1. Type your long text.

2. Type CONTROL-A to select all, then

3. Type almost anything *EXCEPT* CONTROL-C ...

Congratulations! You just erased your text before the website could! Maybe a core dump would help, but maybe not.

For extra fun in step 3 type CONTROL-V.

Hope this helps someone! 🤪

@wikicliff 😭😭😭 omg same
@wikicliff Ctrl-Z works most of the time
@Anafabula
Drat! Those meddling kids and their new undo technology! 😃 (To me Ctrl-Z is the Unix suspend process. Heck, I'm old enough to remember Ctrl-S flow control. 😜 )
@j3s this is a pretty great trick. I have always grieved, then started over.
@j3s
Cool. Sounds like something I'd have done 20 years ago. 8^)

@j3s though I don't fully understand what this does or the tools used... I can *feel* the cursed vibes radiating off of it >:3

when have you had a website erase text without it being related to a crash/page reload/etc, which I assume this trick does not work on?

@flbr this should work on a page crash/reload situation as well! firefox has a bunch of memory and your string of words is probably still in that abyss somewhere, waiting to be written over.

but for example when i type a big long answer and hit submit, and the website says my session has timed out, and hitting back only gets me to a "login" page instead of the page w/ my text on it ;..;

@j3s ohhhhhh, yeah that's definitely happened to me within the past week, that's super cool!
@j3s thank you for sharing this! I'd rather do this even if it took twice as long as rewriting whatever I lost 😆

@j3s

I cannot tell if this will recover my writing or delete my hard drive.

@j3s firefox supposed to hold user inputs whenever user refreshes page, restart their browser.
react ruined it..
I miss good old days
@jarm good old days had their problems too
@j3s I've trained myself to <cmd>-<a>,<cmd>-<c> before hitting any buttons on a web site - clipboard managers will then have a copy of your text. Sad I've had to train myself to do this though…
@j3s I've been trying to get into the habit of writing in an external app, and then copying / pasting into the browser.
@j3s @lispi314 Or just use the lowtech way of writing in a text editor first & copy-paste your long posting to the flaky website. Any post that’s taking over a minute to type -> text editor.
@j3s nice!
I once did a similar thing, but with my entire hard-drive, after accidentally deleting a project I was working on
@j3s well fuck me… here I’ve been using the command-hulk-smash keystroke(both fists) whenever something like that happened. All this time, goddamn coredump could’ve saved me like 2 or 7 laptops over the years.
@j3s Your debug fu is strong, but I think, instead of “next time, I’ll use gdb”, I’d go “next time, I’ll use a proper editor first”.
@j3s next time, the website will use madvise(MADV_DONTDUMP), just to be difficult.
@j3s lol I literally just could have used this (but I was lazy and retyped some version of the comment, it wasn't really that long)
Form History Control – Get this Extension for 🦊 Firefox (en-US)

Download Form History Control for Firefox. Manage form history entries (search, edit, cleanup, export/import) and easy text formfiller. Auto-save text entered in any form while typing to allow fast recovery when disaster strikes.

@sebsauvage @j3s Or this one: https://addons.mozilla.org/en-US/firefox/addon/textarea-cache/

There’s a Chrome version, too. I’m certain there are others, depending on your preferences and browser - unless you’re running Safari, in which case you kinda deserve to dig through a core dump to recover that input.

Textarea Cache – Get this Extension for 🦊 Firefox (en-US)

Download Textarea Cache for Firefox. Allows to save automatically the content in a text input field.

@j3s I'm saving it to my #orgmode #roam notes.

Yes, this was an advert in disguise. 🤷

@j3s https://fosstodon.org/@slink/110955590053429544 🎶 just now strings gcore saved my life 🎶

it was actually `gcore $(pgrep emacs)` and `strings core.*`, but that doesn't match the rhythm of the song.

This was one of the super rare occasions when #emacs would hang with some unsaved code in the undo buffer which I wanted back.
I am so happy to be on a #FOSS Operating Systems which lets me do things (tm).
#c #opensource

Nils Goroll (@[email protected])

🎶 just now strings gcore saved my life 🎶 it was actually `gcore $(pgrep emacs)` and `strings core.*`, but that doesn't match the rhythm of the song. This was one of the super rare occasions when #emacs would hang with some unsaved code in the undo buffer which I wanted back. I am so happy to be on a #FOSS Operating Systems which lets me do things (tm). #c #opensource

Fosstodon
@j3s I love this because someone will read it and go down a rabbit hole, eventually leading to then discovering a whole new level of how computers work 💾
@j3s I can also very much recommend the textern extension (https://github.com/jlebon/textern), which allows you to open any text box with an external editor.
GitHub - jlebon/textern: A Firefox add-on for editing text in your favourite external editor!

A Firefox add-on for editing text in your favourite external editor! - GitHub - jlebon/textern: A Firefox add-on for editing text in your favourite external editor!

GitHub
@towo @j3s Oh gosh, thanks for the reminder that I used to use this kind of thing! "It's All Text!", mentioned under Related Projects, was the thing in those days.
@j3s I just started precomposing my longer-form writings on notepad++ off to the side then I copypasta in lol
@dragonarchitect @j3s That's been my approach (though in Geany or really any text editor) for anything longer than a few sentences. It's really annoying how often losing long posts is a thing on the modern web.