Skip to content

Commit

Permalink
Merge branch 'manifestv2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Eliastik committed Mar 9, 2025
2 parents dbba938 + b8ead33 commit 43a4dfc
Show file tree
Hide file tree
Showing 63 changed files with 6,289 additions and 4,313 deletions.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

## Changelog:

### Version 2.11.1 (3/9/2025):

* Automatic detection of dark themes: Page Shadow can now identify websites using a dark theme. With this feature, you can configure the extension to:
* Automatically disable itself on websites or webpages with a dark theme;
* Automatically enable a specific preset if a dark theme is detected.
* Bug fixes and technical improvements:
* Fixed a bug where the dark image detection algorithm failed due to CORS restrictions;
* Fixed a bug where some images were invisible when enabling the Invert colors > Entire page feature on some websites;
* Fixed a bug where some SVG images were not detected as dark by the image analysis algorithm;
* Fixed a bug where some colored elements were not detected as such, as their color was defined on a specific color space (OKLCH, OKLAB, etc.);
* Fixed a bug with transparent backgrounds detection when background color was defined on a specific color space;
* Fixed a bug with selective inversion when the parent had a bright colored background;
* Fixed a bug with selective inversion and SVG icons;
* Fixed a very rare bug where, when opening extension settings, the custom theme editor would malfunction;
* Code refactoring: most methods have been organized in separate classes and files, each with a unique responsibility;
* Dependencies updated.

### Version 2.11 (12/22/2024) :

* Added the ability to enable the inversion or attenuation of colored elements. This allows users to disable the inversion of colored elements while enabling entire page inversion, providing an alternative dark mode to the Increase contrast function;
Expand Down Expand Up @@ -420,6 +437,23 @@

## Journal des changements :

### Version 2.11.1 (09/03/2025) :

* Détection automatique des thèmes sombres : Page Shadow peut désormais identifier les sites web utilisant un thème sombre. Grâce à cette fonctionnalité, vous pouvez configurer l'extension pour :
* Se désactiver automatiquement sur les sites ou pages avec un thème sombre ;
* Activer automatiquement un pré-réglage spécifique si un thème sombre est détecté.
* Correction de bugs et améliorations techniques :
* Correction d’un bug où l’algorithme de détection des images sombres échouait à cause des restrictions CORS ;
* Correction d'un bug où certaines images étaient invisibles en activant la fonctionnalité Inverser les couleurs > Page entières sur certains sites web ;
* Correction d'un bug où certaines images SVG n'étaient pas détectées comme étant sombres par l'algorithme d'analyse des images ;
* Correction d'un bug où certains éléments colorés n'étaient pas détectés comme tels, car leur couleur était définie sur un espace de couleur spécifique (OKLCH, OKLAB, etc.) ;
* Correction d'un bug concernant la détection des arrière-plans transparent lorsque la couleur d'arrière-plan était définie dans un espace de couleur spécifique ;
* Correction d'un bug avec l'inversion sélective lorsque le parent avait un fond avec couleurs vives ;
* Correction d'un bug avec l'inversion sélective et les icônes SVG ;
* Correction d'un bug très rare où, lors de l'ouverture des paramètres de l'extension, l'éditeur de thèmes personnalisés dysfonctionnait ;
* Refactorisation du code : la plupart des méthodes ont été organisées dans des classes et fichiers distincts, chacun avec une responsabilité unique ;
* Mise à jour des dépendances.

### Version 2.11 (22/12/2024) :

* Ajout de la possibilité d'activer l'inversion ou l'atténuation des éléments colorés. Il est possible ainsi de désactiver l'inversion des éléments colorés en activant l'inversion de la page entière, pour un mode sombre alternatif à la fonction Augmenter le contraste ;
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<img src="https://raw.githubusercontent.com/Eliastik/page-shadow/master/screen.png" width="300" alt="Page Shadow" /> <img src="https://raw.githubusercontent.com/Eliastik/page-shadow/master/screen_2.png" width="300" alt="Page Shadow" />

An extension by Eliastik (eliastiksofts.com) - Contact : http://www.eliastiksofts.com/contact/
* Latest version: 2.11 (12/22/2024)
* Latest version: 2.11.1 (3/9/2025)
* Official website: http://eliastiksofts.com/page-shadow
* Github repository: https://github.com/Eliastik/page-shadow

Expand Down Expand Up @@ -85,7 +85,7 @@ Page Shadow is distributed under GPL-3.0 license (see LICENCE.txt file)

#### License notice

Copyright (C) 2015-2024 Eliastik (eliastiksofts.com)
Copyright (C) 2015-2025 Eliastik (eliastiksofts.com)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -113,7 +113,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<img src="https://raw.githubusercontent.com/Eliastik/page-shadow/master/screen_fr.png" width="300" alt="Page Shadow" /> <img src="https://raw.githubusercontent.com/Eliastik/page-shadow/master/screen_fr_2.png" width="300" alt="Page Shadow" />

Une extension by Eliastik (eliastiksofts.com) - Contact : http://www.eliastiksofts.com/contact/
* Version actuelle : 2.11 (22/12/2024)
* Version actuelle : 2.11.1 (09/03/2025)
* Site officiel : http://eliastiksofts.com/page-shadow
* Dépôt Github : https://github.com/Eliastik/page-shadow

Expand Down Expand Up @@ -194,7 +194,7 @@ Page Shadow est distribué sous licence GNU GPL-3.0 (voir le fichier LICENCE.txt

#### Avis de licence

Copyright (C) 2015-2024 Eliastik (eliastiksofts.com)
Copyright (C) 2015-2025 Eliastik (eliastiksofts.com)

Ce programme est un logiciel libre ; vous pouvez le redistribuer ou le
modifier suivant les termes de la GNU General Public License telle que
Expand Down
33 changes: 25 additions & 8 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ This is a roadmap/to-do list of things that are planned to be fixed or developed
* [x] (Minor) On local opened page, the right click actions doesn't work (Chrome only) -> seems OK, nothing fixed
* [x] (Medium) HTML class used by Page Shadow to invert entire page is reseted on some websites. Exemple: https://spring.io/tools
* [x] (Minor) Issues with Shadow DOM: Google Earth broken with "Increase page contrast" mode -> fixed by disabling auto override with filter rules ; to definitely fix: detection of transparent backgrounds in Shadow Roots
* [x] (Very minor) Sometimes when opening custom themes settings, the link color of the custom theme 1 is copied to the text color randomly + edit icon displayed
* [x] (Minor) Shadow DOM is not always detected => example comments on Franceinfo website
* [x] (Medium) Dark image detection not working on image from cross-origin domain (cf Wikipedia articles)
* [x] (Major) Still some errors with QUOTA_BYTES_PER_ITEM in cloud archive. The chunk method need to be fixed
Expand All @@ -169,15 +168,34 @@ This is a roadmap/to-do list of things that are planned to be fixed or developed
* [x] Add possibility to not invert bright color for the Invert colors features?
* [x] Increase the number of presets/custom themes?

### Release - future
### Release - 2.11.1

* [ ] Publish Manifestv3 for Firefox - check Cloud backup working on Firefox
* [x] Auto detect website already having a dark mode to auto disable Increase contrast and Invert entire page
* [x] Improve detection algorithm
* [x] Detection only enabled if Invert colors, Increase contrast or Attenuate colors is enabled: fix? -> No
* [x] Update filter guide for new special filters
* [x] Youtube dark not detected? => Due to performance mode
* Disable performance mode on release
* [x] Add advanced option to disable fetching CORS images from background script/worker?
* [ ] Tests + release (when releasing: update version date, update changelog (last bugfixes), compare code between MV2 and MV3 versions)

#### Known issues/bugs

* [ ] (Medium) Some images are ignored by the dark image detection due to CORS restriction
* [ ] (Minor) Logo not detected as dark image when increase contrast is enabled (still detect with invert entire page) on: https://www.fastmail.com/blog/why-we-use-our-own-hardware/
* [x] (Medium) Some images are ignored by the dark image detection due to CORS restriction
* [x] (Medium) Images fail to load when Invert entire page is enabled on this website: https://actu.fr
* [x] (Minor) Logo not detected as dark image when increase contrast is enabled (still detect with invert entire page) on: https://www.fastmail.com/blog/why-we-use-our-own-hardware/
* Due to the path sub-element with fill = "currentcolor" and a style stating fill = "inherit"
* [x] (Minor) OKLCH css colors are not taken into account
* [x] Take into account other color formats
* [x] Color format not recognized -> fix? https://developer.mozilla.org/fr/docs/Web/CSS/color_value/color
* [x] (Minor) Bug when selective invert of an element which have a parent with bright color, and increase contrast enabled
* [x] (Minor) Still CORS error due to URL redirects. Example: https://web.dev/blog/color-spaces-and-functions?hl=fr - fix?
* [x] (Very minor) Sometimes when opening custom themes settings, the link color of the custom theme 1 is copied to the text color randomly + edit icon displayed => Colpick bug
* [x] (Medium) Still some bugs with selective invert SVG - example francetvinfo website/tutorial teacher

### Release - future

* [ ] Publish Manifestv3 for Firefox - check Cloud backup working on Firefox

#### Common

Expand All @@ -186,17 +204,16 @@ This is a roadmap/to-do list of things that are planned to be fixed or developed
#### Ideas

* Improving codebase
* [ ] Comment the code: doc for methods/functions
* [x] Comment the code: doc for methods/functions
* [x] Simplify code applying Shadow Roots styles?
* [x] Separate code treating mutations of page elements to a separate class?
* [x] Separate method applying mutation observers to another class?
* [x] Modularize content.js classes with less dependencies between classes?
* [ ] Separate each filter (increase contrast, reduce brightness etc.) into a class?
* [x] Separate each filter (increase contrast, reduce brightness etc.) into a class?
* Filters module improving
* [x] Filters: UI to report a website problem
* Others :
* [ ] Ignore get parameters (after ? character) in URL for preset list and whitelist/blacklist list?
* [ ] Auto detect website already having a dark mode to auto disable Increase contrast and Invert entire page?

#### Abandoned ideas

Expand Down
38 changes: 36 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default [...compat.extends("eslint:recommended"), {

rules: {
indent: ["error", 4],
"linebreak-style": ["error", "unix"],
"linebreak-style": ["off", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
"no-var": ["error"],
Expand All @@ -55,6 +55,40 @@ export default [...compat.extends("eslint:recommended"), {
"no-implied-eval": ["error"],
"no-lonely-if": ["warn"],
"no-return-assign": ["error"],
"no-sequences": ["error"]
"no-sequences": ["error"],
"no-implicit-coercion": ["error"],
"curly": ["error", "all"],
"arrow-body-style": ["error", "as-needed"],
"no-duplicate-imports": ["error"],
"radix": ["error"],
"no-use-before-define": ["error", { "functions": false, "classes": true }],
"no-new-func": ["error"],
"no-buffer-constructor": ["error"],
"no-shadow": ["warn"],
"prefer-destructuring": ["warn", { "object": true, "array": false }],
"object-shorthand": ["error", "always"],
"no-unused-expressions": ["error"],
"no-else-return": ["error", { "allowElseIf": false }],
"no-undef": ["error"],
"no-undef-init": ["error"],
"consistent-this": ["error", "self"],
"no-new-object": ["error"],
"no-dupe-keys": ["error"],
"no-useless-constructor": ["error"],
"prefer-numeric-literals": ["error"],
"no-new-wrappers": ["error"],
"no-useless-return": "warn",
"arrow-parens": ["warn", "as-needed"],
"no-extra-bind": "warn",
"no-floating-decimal": "warn",
"no-self-compare": "error",
"no-useless-concat": "warn",
"prefer-rest-params": "warn",
"prefer-spread": "warn",
"no-unneeded-ternary": "warn",
"no-promise-executor-return": "error",
"no-mixed-operators": ["warn", { "groups": [["&&", "||"]] }],
"array-bracket-spacing": ["error", "never"],
"no-prototype-builtins": "error"
},
}];
2 changes: 1 addition & 1 deletion gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ gulp.task("build", () => {
});

gulp.task("watch", () => {
gulp.watch(["src/js/*.js", "src/js/classes/*.js", "src/js/utils/*.js", "src/css/*.css", "src/css/*.less", "src/locales/**/*.json", "src/*.html", "src/*.txt", "manifests/**/*.json"], gulp.series("build-directory-dev"));
gulp.watch(["src/js/*.js", "src/js/classes/*.js", "src/js/utils/*.js", "src/js/libs/*.js", "src/js/classes/features/*.js", "src/css/*.css", "src/css/*.less", "src/locales/**/*.json", "src/*.html", "src/*.txt", "manifests/**/*.json"], gulp.series("build-directory-dev"));
});

gulp.task("build-directory-dev", gulp.series("clean", "copy-global", "compile-less", "compile-js", "copyChrome", "copyFirefox", "copyFirefoxContentCSS"));
Expand Down
2 changes: 1 addition & 1 deletion manifests/chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Page Shadow",
"version": "2.11",
"version": "2.11.1",
"default_locale": "en",
"manifest_version": 2,
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion manifests/firefox/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Page Shadow",
"version": "2.11",
"version": "2.11.1",
"default_locale": "en",
"manifest_version": 2,
"icons": {
Expand Down
Loading

0 comments on commit 43a4dfc

Please sign in to comment.