Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flash of addictive content on page load #5

Open
a13o opened this issue Apr 21, 2019 · 2 comments
Open

Flash of addictive content on page load #5

a13o opened this issue Apr 21, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@a13o
Copy link
Owner

a13o commented Apr 21, 2019

(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?

@a13o
Copy link
Owner Author

a13o commented Feb 18, 2020

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.

@a13o
Copy link
Owner Author

a13o commented Feb 24, 2020

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

@a13o a13o added the enhancement New feature or request label Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant