rugk / website-dark-mode-switcher

This is a (Firefox) add-on (WebExtension) that lets you invert the website's color scheme by inverting/changing the prefers-color-scheme media feature of CSS.
https://addons.mozilla.org/firefox/addon/dark-mode-website-switcher/?src=external-github-top
Other
58 stars 4 forks source link

Race condition leads to dark mode not being applied #9

Closed rugk closed 4 years ago

rugk commented 5 years ago

Bug description

@lionirdeadman reported a bug with a specific website that triggered

Steps to reproduce

Dark mode only used in pure CSS. Same CSS on each site.

But on sites with much HTML content,

I currently guess this is a timing issue, because the add-on tries to get the CSS from the website too fast, so it has not already loaded (because it's still parsing HTML).

Actual behavior

Sometimes fails to apply dark mode.

Expected behavior

Always work.

System

Browser and version: Firefox 68

Possible solution

trigger later?