Wow. I've been wishing for this for so long, especially for use in Electron (and things like https://github.com/nativefier/nativefier specifically).
Mr. Gorhill, if you read this: Thank you. You've made browsing the web more enjoyable (/bearable) on a daily basis for me for many years.