CptFoobar / Owl

A Mozilla Firefox add-on to make online reading comfortable.
http://owl.sidhant.io
Other
63 stars 8 forks source link

Dark background for currently-loading pages #2

Closed davidebaldini closed 8 years ago

davidebaldini commented 8 years ago

The add-on darkens the page only after it has fully loaded, leaving the default white background for a few seconds during loading. This results in a "white flash" whenever the user open a new page.

My suggestion is to apply a temporary dark background to the page while it loads or, if performances don't slow down, activate the content-script as soon as the page starts loading.

CptFoobar commented 8 years ago

Thanks for reporting this. It seems that the issue is with way stylesheets are attached when using the attach method of content/mod. Apparently, the attach method applies styles only after the page has been loaded, thus causing the white flashes when navigating. One way to solve this could be if the stylesheet is injected into the of the page from the content-script. I'll try this out and also ask around on the IRCs if this functionality is intentional and if it can be controlled.

CptFoobar commented 8 years ago

Fixed in d710662

davidebaldini commented 8 years ago

Great.

Just a hint: I checked d710662 and found long inline quotes. For my add-on, I had troubles getting such quotes approved by AMO. In my case the quoted text was just static html.

CptFoobar commented 8 years ago

Thanks for the heads up. I too wasn't sure if AMO would approve them, but I didn't want to use any file ops nor minify the css into one line (because they'll definitely point out that one), so went with this. Plus, it's just basic CSS so I guess it won't be a trouble to anyone.

PiQuer commented 8 years ago

Hi, I am using version 1.3.1 which should contain d710662, but I still see the white flashes when loading pages, i.e. exactly the symptoms @davidebaldini reported originally. What could be the cause?

CptFoobar commented 8 years ago

Hi, changes in d701662 try to minimize the white flashes (by injecting styles as soon as they can be injected) but have not yet been completely removed. So, white flashes will still remain on some websites, especially the ones that require longer time to parse.

PiQuer commented 8 years ago

Thanks for the explanation.

davidebaldini commented 7 years ago

I noticed that an add-on similar to Owl named Dark Background and Light Text does darken the pages without any initial white flash during loading. Perhaps it configures some FF color setting before injecting a CSS?