ThomazPom / Moz-Ext-UltimaDark

Web Extension that uses agressive technique to get dark mode everywhere
37 stars 3 forks source link

ON / OFF #3

Closed EstherMoellman closed 4 years ago

EstherMoellman commented 4 years ago

Hi @ThomazPom , how are you?

I know you're working on improvements, and I really hope to see soon the next new version of your UltimaDark. I have great expectations about this add-on!

As a dark-theme veteran-user of add-ons, css and JS' scripts, I confirm you that in my tests your UltimaDark is the best in webpage loading speed VS final quality. But as I said in my other opened-issues here in your GitHub, UltimaDark needs a little work, for example:

I believe you have more ideas and stuff you want to add or to develop in the future. But in order to be usable, IMHO the 3 first items above are the top priorities for UltimaDark.

It will be impossible to build the perfect dark-theme add-on. Some webpages are just horrible and very bad written, and I never found a global complete dark-theme solution, capable of dealing with the endless variety of bad programmed webpages. So @ThomazPom , UltimaDark doesn't need to be perfect, and doesn't need to work for all webpages. But at least the on/off, the white-listening, and the low RAM... this already will make UltimaDark one of the best add-ons out there. Of course, after that and with time, slowly and step by step, if you want you can improve your add-on, you can add more features, adjustments etc.

As I said, count on me! I have no JS' knowledge. But I can help you by testing your stuff, or by contacting other Devs that may help you with JS.

Thank you once again, and have a nice week! : )

ThomazPom commented 4 years ago

I'm very glad to read this/ In some tests i got youtube and cnn working in a way that eat anourmous amount of cpu power. but as a proof of concept it was great. Lets start small with he on off switch and the whitelist :)

ThomazPom commented 4 years ago

You may want to try the very last beta :) i just published it

https://addons.mozilla.org/fr/firefox/addon/ultimadark/versions/

ThomazPom commented 4 years ago

The result on github.com is spectacular

EstherMoellman commented 4 years ago

Bon progrès mon ami!

I confess you that my focus is browser performance (RAM, CPU, webpage loading speed etc), but I do recognize that UltimaDark has nice aesthetic results. Personally, I'm willing to pay any aesthetic price in favor of better browser performance. But again, IMHO, UltimaDark is near to achieve the best relation between: "Webpage Loading Speed" VS "Nice Aesthetics".

And one of the reasons I have great expectations on UltimaDark is precisely because its aesthetic results are better than my own CSS' scripts. IMHO UltimaDark is not just better than other add-ons, but also it is better than my own CSS' scripts (in terms of aesthetic results + webpage loading speed).

In the past, the best dark-theme add-on for me was: https://addons.mozilla.org/en-US/firefox/addon/dark-background-light-text/ It has Firefox' recommendation, great browser performance, lightweight, very customizable, and reasonable aesthetic results. But unfortunately it destroys webpages in the first seconds of loading (so it is a "no-go" for me). And with regards to the other add-ons, most of them may have nice aesthetic results, but they are browser performance killers (unusable), or they have white-flashing on webpage loading, or other problems etc. So time ago I decided to quit add-ons, and to use only CSS' scripts for darkening webpages.

My current CSS has reasonable aesthetic results and good browser performance. But as I said, UltimaDark has better aesthetic results than my CSS, and also its webpage loading speed is almost the same. It is the first time I can see an add-on having good results when compared to my CSS. Congratulations! Good job @ThomazPom !

Back to your new version:

Please, keep working... next step: White-listing. And again... count on me!

Merci beaucoup pour votre temps et votre attention! Big hug! : )

ThomazPom commented 4 years ago

1.1.0 / Whitelist - Blacklist Please note that blacklist overrides whitelist https://addons.mozilla.org/fr/firefox/addon/ultimadark/versions/ Could you tell me if disabling the cache system improve ram usage ? (added the setting)

EstherMoellman commented 4 years ago

Hi @ThomazPom , thank you for 1.1.0! Here is my test report:

RAM: Cache enabled: 450kb (0 webpages), ±1.5MB (20 webpages fully loaded), ±10MB (+20 webpages loading). Cache disabled: RAM consumption is doubled, never lower than ±3.5MB (I tested several times, having same results).

PS1: IMHO, RAM is starting to behave in a very acceptable way.

PS2: How the cache enabled will affect privacy? Trackers, cookies, ETags etc can read UltimaDark' cache? Or this cache is protected?

WHITELIST: Sorry, I couldn't make it work. You said: "blacklist overrides whitelist". But and :///*" are blacklisted. Therefore, all webpages are blacklisted and always are going to be darkening. Therefore, whitelist can't work because is overwritten by current blacklist always darkening all pages. If you allow me a suggestion, it'll be better to remove the blacklist option. UltimaDark already has an ON/OFF button that totally replaces the blacklist list function. It's redundant to have a blacklist. Please, only is needed a whitelist option. If the add-on is OFF, all webpages automatically are whitelisted. If the add-on is ON, all webpages are blacklisted except those whitelisted.

WEBPAGES WORKING - BUT NO DARKENING: https://edition.cnn.com/style/article/yulia-tsvetkova-pornography-gay-propaganda-law-lgbtq-activism-russia/index.html or https://edition.cnn.com/travel/article/first-flight-largest-electric-aircraft-scli-intl/index.html https://userstyles.org/ https://www.youtube.com/

WEBPAGES - BROKEN: https://www.nationalgeographic.com or https://www.nationalgeographic.com/magazine/2018/06/plastic-planet-waste-pollution-trash-crisis/ https://www.speedtest.net/ https://veja.abril.com.br/ https://www.infomoney.com.br https://br.investing.com

FONTS: Few websites with fonts using "~" or "ç" (Portuguese, Spanish etc) have broken texts.

SATURATED COLORS: Some webpages with images have saturated colors: https://edition.cnn.com/2019/07/07/africa/stella-nyanzi-as-equals-intl/index.html https://www.pages-osm.org/

I still believe that 3 are the top priorities: 1) ON/OFF (done!) 2) RAM (almost done!) 3) Whitelist. This 3 priorities will make the add-on usable. The rest above ("webpages working but no darkening", "webpages broken", "fonts" and "saturated colors")... are second priority that you may try to fix later, with time, slowly etc. You don't need to fix 100% all webpages. But if 85% of the webpages are working, then UltimaDark will end its experimental stage, becoming a "stable version". The third priority (IMHO) will be new features (for example the customization of colors, backgrounds, links etc, or the option of using "invert", "css" etc).

The most important thing UltimaDark already has: Good browser performance + nice aesthetic results. All the rest is small work you can do slowly and with time. Please, keep count on me!

Big hug : )

ThomazPom commented 4 years ago

Here is the default config i expected you to have right after install

Whitelist:

<all_urls>
*://*/*
https://*.w3schools.com/*

Blacklist: about:

ThomazPom commented 4 years ago

There is a problem with the default value, about: on the black list . I'll check. While this, you can just use *://example.com/*

ThomazPom commented 4 years ago

I think having a whitelist and a blacklist is better: it allows to have any website in dark mode if possible and if a website is buggy or unreadable, you may only have to click on the "exclude button" to get it working

ThomazPom commented 4 years ago

I fixed the black list bug in the 1.1.1 version

ThomazPom commented 4 years ago

The cache is protected and only uses RAM to store color transformations like .. red= rgba(255,0,0,1) the calc from the word red to rgba(255,0,0,1) is heavy, so i have a mapping between asked values and result to do the calc only once.

ThomazPom commented 4 years ago

Saturated colors is a work in progress to darken white in backgrounds when they are too white : https://uptobox.com/

EstherMoellman commented 4 years ago

Yeap, I confirm, now whitelisting is working. Well done! Thank you : )

With regards to the "cache enabled", if I well understood you, this cache is not for webpages nor for browsing data, but is for internal functions (and seems to be a great feature). However, my measures are counter-intuitive because I expect higher consume of RAM when "cache is enabled" (and in my tests "cache disabled" consumes double amount of RAM). What am I missing here? Also is not clear to me, if "cache enabled" is so good, and if consumes less RAM, why the "cache disabled" option is needed?

EstherMoellman commented 4 years ago

Here is the default config i expected you to have right after install

Whitelist:

<all_urls>
*://*/*
https://*.w3schools.com/*

Blacklist: about:

FYI, the v1.1.1 still presents: Blacklist: "" ":///" "https://.w3schools.com/" Whitelist: "://example.com/*"

ThomazPom commented 4 years ago

The option was needed to offer you the ability to test. The cache will be emptied when disabling option from 1.1.2 (hope it not affected your test) I assume storing function results consume less ram than re running it fully

This is strange, your black list and whitelist seems inverted Try to set a blank value in each of them to reset them

image

EstherMoellman commented 4 years ago

I uninstalled and reinstalled again, and now whitelist and blacklist are fine, they appear as in your image. Thank you again : )

However, I'm having some issues with the blacklist. When the domain is clean and full like "something.com", the blacklist works fine. But when the domain is "something.com.something", I can't blacklist. For example: https://www1.folha.uol.com.br/opiniao/2017/11/1936382-regulamento-pode-desvirtuar-nova-lei-de-migracao.shtml At "exclude" you will see "com.br" (which is totally wrong). And if I manually add: "https://*.folha.uol.com.br/" or "://.folha.uol.com.br/", it doesn't work. It seems the blacklist might have problems with "something.com.something". By the way, in this same webpage you can see the problem with fonts, I mentioned in my previous message.

ThomazPom commented 4 years ago

Please check the 1.1.3, i disabled the experimental edit on background images, and added a precision setting for the blacklist to fit your needs. As its was done the blacklist is more than able to handle this case

*://example.com/*
*://com.br/*
*://*.com.br/*
*://static.folha.uol.com.br/*
*://*.static.folha.uol.com.br/*
*://f1-na.readspeaker.com/*
*://*.f1-na.readspeaker.com/*
*://github.com/*
*://*.github.com/*
*://github.githubassets.com/*
*://*.github.githubassets.com/*

com.br is a special case, because it is hosting many other things : https://veja.abril.com.br/ ... https://www1.folha.uol.com.br/ Many websites side loads css from other hostnames. orange.fr blacklist for instance looks like this

*://orange.fr/* -> hostname
*://*.orange.fr/* -> in case of www.
*://.woopic.com/* -> woopic domain for CSS (has many subdomain for many css files : c.woopic.com .. cdn.woopic.com ..)

As you can see, the right way to handle the regular case is to blacklist the hostname itself, wildcard hostname and wildcard the hostnames of its stylesheets/CDN

You can now make it more or very precise, the code is able to detect the exact domain from the CDN but you may change page, then be on another similar hostname, lets say for a precision of 5 or more https://veja.abril.com.br/ -> https://www1.folha.uol.com.br/ and have to reclick on "blacklist"

EstherMoellman commented 4 years ago

Wowww... holy cow... amazing... works like a charm... very nice indeed. This will solve exclusions of domains for any "something.com.something", regardless the country (.com.something), or for not ".com" urls. Excellent job indeed. Kudos!

I just suggest you to add into UltimaDark AMO' page a short description of the new added features (ON/OFF, Whitelist, Blacklist), also explaining in a short paragraph how to exclude domains + the use of "precision" + link to match pattern reference... otherwise most of the average users are going to be lost. Personally, I also think that is important to mention at AMO' page the added-values of UltimaDark, specially with regards to good browser performance with nice aesthetic results. But this is your add-on, your AMO' page, and the last word was, is and always will be yours.

Changing subject, if you allow me, tomorrow I will organize my issues in your GitHub, I'll close my solved issues, and I will keep open only issues with pending stuff.

Thanks again and big hug : )