Mac apps with text widgets get emacs-like keybindings for free, so Firefox stands out (in a bad way) for not having them. A blog posting supplied a clean-looking alternate version of the default XML file, with keybindings duplicated across sections ("modes".) Duplication means "opportunity for automation", and something this simple and text-oriented means Python.
platformHTMLBindings.xmlfile and writes out a new one with additional bindings.
A variety of things are missing; a few I have in mind are:
I keep a huge number of Safari windows open at any given time (the
"window" menu usually has the little arrow at the bottom
indicating "more windows below" :-) Thus if Safari crashes, the
Mac crashes, I accidentally hit
%Q instead of
%W, I let the
batteries run to far down, or any of a number of things that
cause me to lose that state, I end up having lost a lot of
state. This is unacceptable, and not what computers are for.
Galeon had a reasonable implementation of this built-in; firefox
has a SessionSaver that should do this but doesn't actually
Safari supports enough AppleScript (as long as you don't use tabs) to let an external process "scrape" the window urls and keep track of what is open. I don't keep track of order (though I do somewhat keep track of age, which turns out to be close enough) but basically, I keep a list of when urls appear and disappear, which can then be scraped later to provide a list of urls to reopen (possibly with hand editing first.)
gensuitemodulecommand needed to build the matching AppleScript Dictionary.
safari_logand spits out a list of urls; you can feed them to a while loop that calls open, or something more clever as needed. I'll eventually put
uncrash_safarihere but it's much more specific to my working environment than the rest of this is.