CptFoobar / Owl

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

Owl per site setting in the url bar disappears when the site is blacklisted #30

Closed mdevlamynck closed 6 years ago

mdevlamynck commented 6 years ago

I frequently disable Owl for just a few moments on a certain sites (not globally) and it can cause the owl setting panel in the url bar to disappear. It's a bit annoying to have to go to the Owl settings page to remove the domain from the blacklist.

To reproduce:

  1. Go to some site.
  2. Disable Owl for this particular site using the panel setting in the url bar.
  3. Go to any other page on the same site.
  4. The button in the url bar disappears.

I'd love to help solve this if I can (I'm not used to FF plugins at all but maybe with a few pointers I can get it done). In any case thanks for this awesome plugin!

mdevlamynck commented 6 years ago

Oh I didn't see there already was issue #28 for this, my bad.

CptFoobar commented 6 years ago

It would be great if you could contribute to Owl. To get a quick start, you can go through the 'Get Started' section in the WebExtension docs (https://developer.mozilla.org/en-US/Add-ons/WebExtensions). This should be enough for starters. As for fixing the bug, I see that the PageAction (URL Bar icon) is displayed if the condition at background.js#L120 evaluates true. But the getStyleFileForUrl method at background.js#L101 returns NO_STYLE for sites that are in the alwaysDisableSites, causing the subsequent if condition to fail and thus continue without getting to background.js#L120. Moving the background.js#L120 before the background.js#L101 condition should fix this.

mdevlamynck commented 6 years ago

Thanks for your help!