I actually prefer short userscripts like this over addons, because I can immediately see it's not doing anything nefarious and I only need to trust the addon that I install the user script with.
I wonder why this is even necessary. User scripting should be a standard feature of browsers. We should have direct access to a complete Javascript environment every time we launch a browser. Just like Emacs gives users a Lisp environment.
But you can have user styles, user chrome (styling of the FF frame itself), and user scripts per profile, as files wherever all your profile stuff is stored, e.g. $XDG_CONFIG_HOME/mozilla/firefox/profiles/blah.
It's also not available on mobile.