m-khvoinitsky / dark-background-light-text-extension

Firefox addon that turns every page colors into "light text on dark background"
Mozilla Public License 2.0
359 stars 27 forks source link

whitelist/blacklist with regex support #19

Closed Jan02 closed 7 years ago

Jan02 commented 8 years ago

whitelist/blacklist with regex support

m-khvoinitsky commented 8 years ago

I was thinking about it but considered it's demand as very low.

Can you describe your usecases?

taye commented 7 years ago

It's currently not possible to add configurations for things like the Devtools, Notifications, UIs for other addons, Firefox UI in HTML which doesn't display the URL (saved passwords for example), etc.

screen

screen

With custom regular expression matching against the URL, we could match against the protocol to enable the addon for only http(s) pages:

/^http(s)?:/

It could also allow different configurations for different subdomains and sub directories:

/^http(s)?:(www.)?google.com/
/^http(s)?:mail.google.com/
/^http(s)?:*google.com[/]maps/
m-khvoinitsky commented 7 years ago

It's currently not possible to add configurations for things like the Devtools, Notifications, UIs for other addons, Firefox UI in HTML which doesn't display the URL (saved passwords for example), etc.

How are regexps related to this problem? What you are talking about is #10

With custom regular expression matching against the URL, we could match against the protocol to enable the addon for only http(s) pages:

Is there someone who will ever need this?

It could also allow different configurations for different subdomains and sub directories:

This is possible right now.

taye commented 7 years ago

How are regexps related to this problem? What you are talking about is #10

With regular expressions, we could easily configure multiple pages including, those that we haven't yet visited, with a single rule. It would also allow white/blacklisting of specific file extensions. A different solution to #10 would be helpful but I can imagine several cases where it would be desirable to blacklist some chrome pages but not others (although one could blacklist all chrome and change chrome styles with userChrome.css instead).

Is there someone who will ever need this?

There's at least two of us in this thread. Regex rules are common in extensions that interfere with page content like ad blockers, style changers and privacy utilities so the feature would almost certainly be used by advanced users of those addons.

m-khvoinitsky commented 7 years ago

A different solution to #10 would be helpful but I can imagine several cases where it would be desirable to blacklist some chrome pages but not others (although one could blacklist all chrome and change chrome styles with userChrome.css instead).

It's possible right now. Well, it's not exposed in UI (that's what #10 is about). For example, to disable add-on for Privacy Badger you can open any of it's internal pages in a tab, for example, settings: resource://jid1-mnnxcxisbpnsxq-at-jetpack/data/options.html and disable it as for any other website. Same for NoSquint Plus: chrome://zoomlevel/content/lib/siteSettings.xhtml So, what additional abilities regexps can bring? How are regexps significantly better than the current solution? Is there some real cases when the current approach doesn't solve your issues?

With custom regular expression matching against the URL, we could match against the protocol to enable the addon for only http(s) pages:

Is there someone who will ever need this?

There's at least two of us in this thread. Regex rules are common in extensions that interfere with page content like ad blockers, style changers and privacy utilities so the feature would almost certainly be used by advanced users of those addons.

I wasn't talking about the regexps but only about protocol matching. Same question for "white/blacklisting of specific file extensions".

Don't get me wrong. I'm really appreciate advanced users. But all your suggested use cases are whether possible with current implementation or barely useful.

taye commented 7 years ago

So, what additional abilities regexps can bring? How are regexps significantly better than the current solution? Is there some real cases when the current approach doesn't solve your issues?

I guess the biggest advantage would be making rules for pages without having to visit them, but adding an input in the settings page to enter pages without regexps would also work.

m-khvoinitsky commented 7 years ago

@taye, how do you know if you need a special rule for the site without visiting it? Well, if you do (assume you've visited it before), is it simpler to go to preferences, type a website into the list of exceptions rather than just opening a website and configuring it via pop-up?

taye commented 7 years ago

It probably wouldn't be easier but it would spare my eyse from the initial brightness of the page :).

m-khvoinitsky commented 7 years ago

Don't you use dark mode by default on all websites?

taye commented 7 years ago

I usually prefer to use the invert mode but that turns dark pages bright instead.

m-khvoinitsky commented 7 years ago

Well, the last point I want to emphasize. If you have several rules that matches current page, which one to use? Obviously, the most specific one. With current "simple" rules I have pretty simple algorithm which can calculate which one is more specific. But what to do with regexps? It turns out to be not trivial if not impossible at all. And then try to imagine how to expose it to UI. Well, the only way I see here is to assume that regexp rules is always more specific than "simple" ones. But how to compare two regexp rules? So, due to low demand, controversial use cases and hard implementation I'm closing this issue for now.

taye commented 7 years ago

All right. Thanks for looking into it and thanks for making this extension!

Il 11 dic 2016 9:21 AM, "Mikhail Khvoinitsky" notifications@github.com ha scritto:

Closed #19 https://github.com/m-khvoinitsky/dark-background-light-text-extension/issues/19 .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/m-khvoinitsky/dark-background-light-text-extension/issues/19#event-889526463, or mute the thread https://github.com/notifications/unsubscribe-auth/ABmhgvEKl4vYmslRj8RcaVynndhNhRUnks5rG8CqgaJpZM4IlnR6 .