DmitriK / darkContrast

Firefox addon that fixes low contrast text when using dark desktop theme
MIT License
63 stars 3 forks source link

Please offer whitelist instead of blacklist #30

Closed wolftune closed 6 years ago

wolftune commented 6 years ago

With my plugins and themes, everything almost always works. This plugin usually then breaks things. But sometimes, it's wrong and this plugin fixes it. I really want a mode where this is off by default and turns on only for whitelisted pages/sites.

DmitriK commented 6 years ago

The request sounds reasonable. I'm in the middle of doing a re-write of the basic functionality, so it may take a bit for me to get to. In the meantime, you can try using the delay feature. It was specifically added to try and avoid conflict with other extensions. Go to the override list page, and you'll see a 'Delay (Beta)' entry where you can add a time. This controls how long the extension waits before analyzing the page and adding fixes. You can try starting with an extreme value, like 1000ms, and if it works, reduce it until the delay is acceptable.

wolftune commented 6 years ago

Thanks, and the delay before analyzing will itself mean it will see the effects of the other plugins and only fix if it still is evaluated as needed?

DmitriK commented 6 years ago

Yes, that's the idea. I use a delay of 32ms myself to let my custom CSS extension a chance to inject what it needs to, then this extension fixes what's left.

wolftune commented 6 years ago

That's not solving it. I see the delay, but with "Dark Background and Light Text" plugin on, everything looks fine here on GitHub, and then your plugin kicks in eventually and turns it to black on black. (The dialog while typing this is fine, and the headers over each comment are fine, but the content of each comment is black on black)

DmitriK commented 6 years ago

Whitelist has been added in the latest 2.0.x series. Please check to see if it works for your needs.

wolftune commented 6 years ago

Great! I'll try it!

I must say that it seems odd to have one list that can flip from whitelist to blacklist. Although it makes no sense to use both a whitelist and blacklist, it certainly makes no sense to switch the same list between those two states. If someone wants to try each approach, it makes more sense to keep the lists as two separate lists.

xnick commented 6 years ago

The whitelist works great for me. But I keep having to copy the url, open the options menu and paste it in the list. Could you add a button in the icon menu to add the current page or domain to the whitelist?

mlissner commented 6 years ago

I actually have a use case for a whitelist and a blacklist.

Maybe have one list, and allow items to be pre-pended with a + or - sign?

DmitriK commented 6 years ago

There's a few separate other issues that have been brought up, so I'm going to open some new issues for them, and close this one as it solves the original request for a whitelist.

@mlissner The two kinds of lists really should be mutually exclusive. If you are in whitelist mode, only sites on the whitelist are touched, so sites you do web-dev for won't be affected so long as they don't end up in the list. Alternatively, in blacklist mode add your web-dev urls to the list and let the extension try to fix everything else.