Code Monkey home page Code Monkey logo

Comments (2)

maxmilton avatar maxmilton commented on June 11, 2024

While I'm not against the idea of user customisable background images, it's not necessarily in line with the project's design goals (fast, high security, and unobtrusive).

In the past when I first developed the extension, I started off with something more like other new tab style extensions — a background image, daily reminder/s, quotes, tasks, timers, etc. — but found it all far too distracting. For my own productivity, those experiments taught me keeping things simple and unobtrusive yields the best results.

Somewhat recently the theme system had a big refactor which allows arbitrary CSS to be injected into the page on load. The current themes take advantage of this a little however more powerful theme customisation is possible. For example, users could write their own styles instead of using a built-in theme. That would allow fully custom backgrounds (albeit not random but perhaps with some CSS trickery a pseudo-random background could be chosen from a predefined set).

The theme/s would need to be refactored to still look OK with a background image. Since the background could be any colour the theme would have to adapt. If we knew ahead of time what the background is it's possible to adjust the theme to have decent contrast for readability. If we don't know the background colours it's challenging and might need extra JavaScript to sample the image and calculate the average colours. That's potentially a lot of extra compute required and could slow down initial page load (on top of the extra compute required to load a large image, which can be significant on lower-spec machines!).

From a security perspective, right now there is zero remote data and a very tight CSP. If we had remote background images, not only would it drastically slow down the first initial load but the CSP would need to be adjusted too (especially if we allow users to use custom CSS). Another option is to have background images included in the extension's distributable assets but that would drastically increase the download size. Another way could be to allow users to select a file/s from their file system, but that's tricky to do in a secure way and the APIs are in a state of flux at the moment. Perhaps another way would be to do something fancy like download images in the background script (that would get around the pitfalls of other techniques but has potential for bugs e.g., what happens if the user is offline or the remote file is unavailable?). The Chrome Web Store changed its policies to disallow all remote code... but do images apply to that policy?

These are some of my ideas around such a feature. All that said, it would be nice to put the user in a position where they can choose to customise the experience how they wish... but to do so in a performant way that still provides a clear UI is a challenge.

I'll keep the issue open as this ties in to my intention to overhaul the theme customisation and deserves more thought.

If it's something you absolutely need to have, feel free to fork the repo. I'm happy to provide help with forks :)

from new-tab.

CypherpunkSamurai avatar CypherpunkSamurai commented on June 11, 2024

you can make it optional tho. I would also like it to be minimal

from new-tab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.