disengaged
disengaged copied to clipboard
Flash of addictive content on page load
(I christen thee FOAC)
There's a FOAC on every page load before the content scripts kick in. It's mostly instant on inert sites like Hacker News but more noticeable on chunky single-page apps like the new Reddit.
Why is this happening? Content scripts documentation says css should be applied before the page load. Is this compromised by registering the scripts via background js instead of directly in the manifest file?
One untested theory is that this is due to each css and js file getting injected individually. It's possible that using a bundler to combine all the files into only 1 per site may remove the FOAC.
There is work in #10 which adds package.json to the project, so pulling in a bundler such as Webpack would be simple.
Another idea: load the css/js on document_start
. It's possible now that we're using browser.tabs.exeuteScript()
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/Tabs/executeScript