You can also have this happen automatically when you scroll, and then get the headers back when you scroll up. https://iwalton.com/wiki/#NoFixed
Ever thought of packaging this as a Firefox/Chrome (WebExtensions) addon? Want to collaborate on one? Or if you don't care, are you okay for me to start one from your userscript?