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

Darkening only specific domains #12

Open ALTanir opened 5 years ago

ALTanir commented 5 years ago

I want web page to darker only specific domain, not for all as default. So it needs a list to dark color for the linked page- which is listed. And others all are non-darken. For example(the system will be-) Huge number of domains can visit by users. Yes, users who wants it always switching on/off for any site with their white list. And but some request is nearly same-that is, which users never need to use this darker software. But only for (suppose-) facebook, instagram, twitter, gmail, example.com1 ,2, and 3 (this 7 domains). He/she needs the list up.

So two mode/group for list:

1)white list-not to darken & 2) Off mode- to perform darkening(for listed up) when switched off. And here, can disable option also be set.

Then users can disable extension or delete list as needs. I am all right? Thank you

rugk commented 5 years ago

Thanks for the idea.

I think the approach with a white & blacklist sounds fine. Though the UX could be harder, but I guess when you can right-click on the icon and choose "never darken this page" or "always darken this page", that would be okay, would not it? (and it saves this per page)

Also needs an "use default darkening options" menu entry – could be a radio button even.

ALTanir commented 5 years ago

Yes, and when addon is active, many many new sites will be launched unlimited. Then every sites have to list-up(you quoted) and if its not to visit anymore-it again needs to list out(not limited). So case to make users language by phrase and idioms for as it is like an aeroplane-driving. For example- I need a glass of water and you suggest to bathing with hundreds of water and glass. Main case was to launch an url, but driving will dismiss to case. I have found a new idea by an other functional extension. That is an option called "invert white list". This always disabled self on every site. Here, if users need to enable- just right-button or toolbar icon click. Also ### this make the list once a huge mass within few months. Thus an user suppose needs not to keep this extension(because unlimited clicks); yet requesting if possible. Thank you

mnaef commented 2 years ago

First: Thanks for the Add on!

I use it (mostly) for everyday browsing. My System is always in dark mode but there are increasingly more website which offer a not too well implemented dark appearance. So I'd be very glad if the plugin would offer the option to store the preferred mode on a domain/website basis.

Best regards, Michael

rugk commented 2 years ago

First of all thanks for your comment and appreciation. It's always good to hear if people like the project.

However, unfortunately, since the switch to Firefox' new API with v2.0 this issue just got harder to solve, because that setting is a global one and can only be toggled globally (i.e. the same for the whole browser).

The only workaround there would be to somehow monitor the active/used tab(s) and toggle the setting interactive accordingly, however, that is of course nearly impossible when you want to consider multiple windows or so. So this easily gets way too complex/impossible to solve.

So this is basically blocked by a missing feature/feature request to Firefox respectively an enhanced API of them. This comment asks for that basically and there was no response yet. I also could not quickly find a separate Bugzilla bug for this – if you or someone else wants to have that feature, feel free to create one and ask for that. I can thus only mark this as blocked.

mnaef commented 2 years ago

Hi rugk

Thanks for your elaborate reply. Too bad, maybe the browsers itself will se the necessity of such a feature and implement it themselfs. Thanks anyway. Still al lot better with you plugin that without.

vamega commented 1 year ago

I looked at doing this with the developer tools, and whatever API is being used by the developer tools, only toggles the light/dark preference for the current tab.

Am I correct in my understanding that that API is unavailable to Addons?

rugk commented 1 year ago

Am I correct in my understanding that that API is unavailable to Addons?

From what I know, yes. It's this API.

Opened https://bugzilla.mozilla.org/show_bug.cgi?id=1849786 now to clarify the request and maybe something will be done about that, otherwise it is still blocked.

gaveitatry2 commented 1 year ago

Am I correct in my understanding that that API is unavailable to Addons?

From what I know, yes. It's this API.

Opened https://bugzilla.mozilla.org/show_bug.cgi?id=1849786 now to clarify the request and maybe something will be done about that, otherwise it is still blocked.

Could you please reopen this Issue and not close it until it is resolved?

I found an extension called NightEye (https://nighteye.app) that unfortunately automatically applies dark mode globally to every website, but NightEye also allows you to toggle light/dark mode on each individual website by domain. So it IS possible to "darken only specific domains", if you can just figure out how they did it.

I do not recommend NightEye at all because their extension requires a paid subscription after a three month trial. And another reason I don't like NightEye is because it does the opposite of what I want. I want ALL websites to use light mode by default and I only want one or two websites to use dark mode. But to accomplish that in NightEye, I would have to change billions of websites to use light mode while keeping that one website that I want in dark mode. Too much work.

If you can figure out how NightEye lets users toggle light/dark mode per website by domain, you could give me and ALTanir the option to have all websites use light mode by default and just add certain websites to a "dark mode" list.

gaveitatry2 commented 1 year ago

@ALTanir

I think that I finally figured out how to accomplish what I (and you) want.

1.) Install the Dark Reader extension (https://darkreader.org/). It's available on Firefox, Chrome, Edge, and Safari.

2.) Go to the website that you want to be in dark mode. Click on the Dark Reader toolbar button. Click on the 'Site List' tab. Click on 'Inverted Listed Only.' Press Alt + Shift + A to add the website that you are currently on.

By following the above steps, all of your websites will continue using the light theme (if that is what your browser is set to use) and Dark Reader will only work on and apply dark mode to the websites that you added to the 'Inverted Listed Only' section.

rugk commented 1 year ago

Indeed some.more replies to be added: This issue is not closed, it is open and blocked by API adjustments as said before.

Both NightyEye and DarkReader seem to work differently through in a very basic way: they do somehow change websites with custom CSS/design changes. This add-on also used to do something similar by injecting code from the website itself…

This add-on has a specific aim and that us to only force a light or dark mode based on the website theme itself. So to would never have broken websites, because they offer this design themselves.

One could emulate that manually by not using the browser API intended for that. However I did (aka had to do) that in the past, as said, and it turned or to be hard and not a good idea due to the complexity involved. See https://github.com/rugk/website-dark-mode-switcher/issues/22#issuecomment-988387763 for details and for a way to still use the old version though.

As said before in https://github.com/rugk/website-dark-mode-switcher/issues/55#issuecomment-1570302200 one could adjust that old version to add some blocklist or allowlists for specific domains, but well … it's old code and I am not in the position top maintain that.


What you can do is explain upstream aka Firefox in the opened Bugzilla ticket that you need that feature or just upvote it (you can do so there in the top part, it's somewhat hidden and cumbersome).

gaveitatry2 commented 1 year ago

Oh, okay. So to summarize, this is only impossible by injecting CSS. But you prefer using the web browser API because it is less complicated. And we are hoping that a feature request will go through where the light/dark mode can be change on per website basis instead of globally. ?

I've since just created my own custom CSS for the site that I wanted in dark mode, so now I'm not using any extension. But for those people who want dark mode on individual websites, I would use Dark Reader. But it's too bad that no one is going to see my post on how to use Dark Reader because it has been marked and hidden as "off topic".

Anyway, thanks. I hope the feature request goes through. If it ever does, I might give it another try.