I'm writing a Firefox extension. When a new page is loaded, I need to modify the main HTML AFTER it has been downloaded, but BEFORE it's parsed by the browser.
If it's not clear what I'm saying, look at the accepted answer for this question; After step 1, before step 2.
What JavaScript WebExtension API Event can I use to accomplish this?
Please note that this question does NOT answer my question as gBrowser is depreciated.