Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
/ ChamelTone Public archive

Customize any website colors. Apply "smart dark mode" or change styles manually and with CSS. Easy. Fast. Pretty.

Notifications You must be signed in to change notification settings

garvae/ChamelTone

Repository files navigation

DEPRECATED


⛔ This package is outdated and has not been supported for several years. The browser API has changed a lot since the development of this package and can no longer be used. This package was developed without sufficient knowledge and the code in this package is, frankly, just terrible. The solutions used in this package do not meet quality standards and are not efficient enough to implement such tasks.



ChamelTone 💙



Logo_banner

Version Documentation License: MIT Twitter: garvae



A browser extension that allows you to apply automatic "dark mode" and manually change the color styles of any pages. The extension analyzes the current domain and applies the saved user settings for the current domain, if any. The user can use CSS filters, 6 ways to change the color of text and background elements, and the extension allows you to enter CSS code.



🌐 Demo



A few words about the project

This is my first project and I am happy to share it with people. I hope this extension helps you understand how to develop browser extensions. Browser extensions differ slightly in their logic from the behavior of websites or mobile applications.

Although the essence is similar, because we have:

  • interface that the user can interact with (similar to UI / frontend)
  • request-processing background page (like backend)
  • result of user interaction and background processing (resulting application state)

The interaction scheme is approximately as follows:


app_process_scheme



Description

ChamelTone is an browser extension built for Mozilla Firefox and Google Chrome, built with React, Redux and SASS.

  • This extension allows you to apply automatic “Smart Dark Mode” and manually change the color styles of any web-pages.
  • It analyzes the current domain and applies the saved user settings automatically for the current domain, if any settings exists.
  • You can use 6 ways to change the color of text and background elements of web page.
  • Also you can use filters to modify page colors.
  • In addition, the extension allows you to use CSS code to modify web page.


Install

The extension is currently under consideration in the Chrome Web Store and in Firefox Browser Add-ons. Therefore, you can’t install this extension directly from the stores yet. But you can test it in the “playground” section of site via link above. You can also build it via command above and install manually.


For Firefox

  1. Build the extension
npm run build_firefox
  1. Open debugging page: about:debugging#/runtime/this-firefox
  2. Click "Load Temporary Add-on" and select file "manifes.json" from "build" directory

Short tutorial from YouTube: https://www.youtube.com/watch?v=J7el77F1ckg

In Firefox temporary extension works until the end of the current session.


For Chrome

  1. Build the extension
npm run build_chrome
  1. Open extensions page: chrome://extensions/
  2. Ensure that the "Developer mode" checkbox in the top right-hand corner is checked.
  3. Click "Load Unpacked" and select "build" directory

Short tutorial from YouTube: https://www.youtube.com/watch?v=oswjtLwCUqg

In Chrome the temporary extension remains even after closing the browser



Structure

Here's a general structure for understanding the key points of the project

  • config (webpack config)
  • manifest (separate file "manifest.json" for each of the browsers)
  • public
  • src
    • app_background_page (scripts for "background page")
      • scripts
        • darkMode_presets (note # 1 below)
    • app_content_page
      • app_popup (main "UI" scripts)
      • assets
        • img
        • locales (note # 2 below)
      • store (redux configuration)
      • styles

Note #1: "darkMode_presets" contains special "manually configured" presets for some websites with a very complex structure. For such sites, the ChamelTone built-in logic of "Smart Dark Mode" puts too much load on the processor. Therefore, for some sites (we can expand the base of such sites), pre-generated presets are automatically applied. This optimizes performance.

Note #2: "locales" contains the language pack files. In my case, I decided to use JavaScript configuration instead of JSON. We can expand the base of language packs in this folder. New language packs will automatically appear in the list of available application languages.



P.S


Logo_banner

This extension built with love, but I am aware of the need to refactor this application. But I started to do it at the beginning of 2020 with minimal programming skills and at the start of my "programming way" had no idea how to do this better 😅. I am planning further refactorings and optimizations. I would like to refactor:

  • redux logic. it turned out to be too heavy and contains errors
  • in sass styles it is necessary to replace most of the "@import" rules with "@use" to avoid unwanted double use
  • the logic of the background page. There is extra code that can be shortened and logic enhanced
  • the application has a very heavy "csstree-validator" library. It doubles the weight of the entire application. This library uses MDN libraries to validate user-submitted CSS code. The library is too old and needs to be replaced

I would love to hear your suggestions for improvements. Contact me on social networks.



Special thanks



Author

🙋‍♂️ Vova_Garvae



🤝 Contributions

🤝 Contributions, issues and feature requests are welcome!
Feel free to check issues page and pull request page.

❤️ Give aif you like this project!


📞 Contact me

🔳 QR code

contact me

🔗 Links


🚀 Mentoring

If you want to grow 🚀 fast in front-end development - contact me! 🙋‍♂


📄 License

See license in the "LICENCE" file

About

Customize any website colors. Apply "smart dark mode" or change styles manually and with CSS. Easy. Fast. Pretty.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages