Giter VIP home page Giter VIP logo

adaptive-tab-bar-colour's Introduction

Icon
Mozilla Add-on Users Mozilla Add-on Rating Mozilla Add-on Sponsors

Adaptive Tab Bar Colour

Changes the colour of Firefox tab bar to match the website theme.

What Does The Add-on Do

Every time you open, close, or switch tabs, this add-on changes the theme of your Firefox browser to match the theme colour of the website you are viewing – just like how macOS Safari tints its tab bar.

Works Well With

This add-on is programmed particularly to be responsive to some prominent web page styling add-ons.

  1. Dark Reader
  2. Stylish

Incompatible With

This add-on takes control of browser’s UI colour and colour scheme settings. Any add-on that makes changes to them is incompatible.

  1. Firefox under Version 112.0 (released on April, 2023)
  2. Chameleon Dynamic Theme
  3. VivaldiFox
  4. Dark Mode Website Switcher
  5. automaticDark
  6. Envify
  7. Midnight Lizard

For CSS Theme Enjoyers

A CSS theme can work with ATBC, when system colour variables are being used. This is an example of an ATBC-compatible CSS theme.

Safety Warning

Beware of malicious web UI: Please distinguish between the browser’s UI and the web UI, see The Line of Death. (Credit to u/KazaHesto)

Known Issue(s)

  1. “about:devtools-toolbox” might not have the correct colour scheme

adaptive-tab-bar-colour's People

Contributors

arecsu avatar bensaine avatar cloone8 avatar easonwong-de avatar l0drex avatar neikon avatar omarcinkonis avatar xxnuo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

adaptive-tab-bar-colour's Issues

Automatic light/dark mode switching

Hello!

I may be remembering wrong, but I recall at one point this extension would not affect the actual browser light/dark mode setting, but it seems that the extension now overrides this, and I have to choose between light mode or dark mode. If this was a feature, will it be returning soon, or if I'm remembering wrong, could you consider adding this feature in please?

For reference I'm running v. 1.3.3 of this addon on Firefox 99.0.1 on macOS 12.3.1; I have Dark Reader installed, but none of the conflicting addons listed on this addon's page, and as far as I can tell no other addons that affect browser theme.

Thanks!

Detect new Theme Color

Sometimes the meta tag "theme-color" is dynamically changed via JavaScript.
Would be cool if the addon would notice that and adjust the color.

Favicon’s Dark/Light Variation Should Follow the Browser Instead of the System

My OS is Windows 11.
In OS theme is light. I open GitHub and status bar colored into dark. But the favicons are still used as a light theme. As a result, we have dark icons on a dark background.

Here is a picture. Three tabs from left to right: inactive, active and :hover
зображення

As you can see github favicons is beraly visible.

But if I switch OS theme to dark favicons also swith to dark theme
зображення

Color fade over time...

or somewhere to apply an active css style to a tab and control the style change over time once that is no longer the active tab....

like after 2-5mins the color/style state will go back to match all the other tabs... stuff like that.. don't really care about tabs looking like the website most websites look like shit anyway. especially the guardian what garbage news site that is

Color changes only happen when the page loads

Color changes only happen when the page loads, going to a different tab that's already loaded doesn't change the color.

Would it be possible to prioritize this addon so Firefox loads it as soon as the browser opens? There's seems to be some sort of delay

Another thing I noticed was that the place you actually type stays the same
image

New tab issue

When opening a new tab, it is in light mode, instead of dark. Sometimes it even changes rapidly back and forth between them for a few seconds, before either changing to dark, or, in most cases, light mode.

Firefox Beta Edition
Version: 101.0b8
Build ID: 20220517185920
Add-on options: Dark mode, allow light tab bar.

Steps:

  1. Open new tab
  2. Observe
  3. Retry (if it doesn't happen, I have observed it to happen quite randomly)

Change Mode Based on Time

Since the automatically change mode based on system theme doesn't work,maybe we can automatically change mode based on sunrise/sunset times, may require location. Or just manually set times to change mode. Just like 'automatic-dark' Extension.

Store cache about domain's color

Perhaps storing a very small cache {"domain.com": "r,g,b"} about the prior calculations of each domain might be a way to apply the theme even prior to page loading & calculation?

I think this might also resolve the issue where there is a delay in color application when switching between tab's? I guess ideally there should only be a delay when visiting a domain that hasn't been visited by the user previously.

URL Bar is always dark when selected

I'm not sure if it's a bug or it's by design, but I'll post this anyway.
When light theme is enabled, selecting URL bar will make it all dark, which looks weird with the light theme enabled.
firefox_GM8R8cuDHZ
It looks alright when the theme is dark of course.
firefox_cnj4gIlFdH
I tried choosing 'Follow System' and 'Allow dark tab bar' but this makes no difference.
firefox_ZnezXV3knU

(Firefox 100 Stable, Windows 11, extension's version is 1.4.7)

Support for Chrome, Edge, Opera, etc.

I like the effect provided by this extension very much, I don’t know if Microsoft has an interface that provides similar functional support for the Edge browser.

Feature Request: prevent URL bar from turning black

This is just a feature request that i believe might improve the add-on slightly. The current behaviour of the URL bar is to match the colour theme but turn black when selected - this doesn't appear to be too distracting when the website has a dark theme; however, when the website is a lighter theme then the URL bar looks rather strange when its black. IE google maps. I added two images to show you.

image

image

I would suggest, if possible, prevent firefox from changing the URL bar to black and keep it as whatever colour the add-on came up with

Flashing theme after opening new window and resizing

Here some more info and a video of the flashing theme issue after my review on the store.

Firefox Developer Edition
Version: 101.0b3
Build ID: 20220505190214
Addon options: Light mode, allow dark tab bar.

Steps:

  1. Open new tab with different theme (by drag or open in new tab)
  2. Resize the newly opened window
  3. Go back to tab with opposite theme

It stops instantly when I drag the new window back to the other window.
I can reproduce this every time on my build, sometimes it stops for a second, I think because of the lagg.

Please let me know if any more info is needed, thanks!

Video:

Popular shots on Dribbble — Firefox Developer Edition - 6 May 2022 - Watch Video



Custom domain colors not applying.

Description

Firefox 107.0.1
When using the default presets I am able to change them to "Specify a color" however if I change anything in the domain name text box they stop working. This also applies when adding new rules (making new rules completely useless).

Behaviour

After changing/inputting anything into the domain field of the custom color configuration it stops matching any domains.

Expected Behaviour

After inputting a domain it's colors should be applied to any sites matching that domain.

Steps to reproduce

  1. Navigate to the configuration page for the plugin.
  2. Add a new rule.
  3. Set domain name to youtube.com for example.
  4. Set the rule to "Specify a Color" and choose any color.
  5. Navigate to https://youtube.com and observe the tab bar is not changing.

Modifiable Light/Dark Threshold

Currently brightness thresold is calculated by brightness = 0.299 × r + 0.587 × g + 0.114 × b; if brightness > 128, then color is bright; otherwise is it dark.
grafik
But it seems, the threshold of dark/light color does not work out for everyone. For me, the contrast here isn't enough, for others it might be. So a better option could be to make a setting to set the brightness threshold of currently 128 in the settings

Too fast?

I really like the addon, but it's kinda too flashy for my taste :)

I'm not sure the dynamics behind, but consider this scenario:

  1. When in dark mode, opening the website the has white background makes it burn my eyes. Maybe an option to not use the theme if HS(L) is over, let's say, 70%?
  2. When clicking on a link with a redirect, eg. t.co ... it goes from dark to light to dark, so flashing. maybe some delay or something
  3. It seems that there is no transition between colors. Maybe I'm wrong. But it would be great if it could be slower. For example 400-800ms for the transition to happen and with delay of 300ms.

Not sure if technically possible.

Overwriting Specific Firefox CSS Variables as Advance Settings

Hi,

thanks a lot for this useful Add-On.

I have one problem - the URL field gets the same color, that I set for a specific URL. That color or - with the slider "URL field color" an even darker color. I would prefer a simple white (Tab and Toolbar color is enough, a colored URL field is too much) and tried it with an additional chrome/userChrome.css:

#urlbar-background {
    background: white !important;
}

But that doesn't overwrite the colors set by your Add-On.

How can I achieve this?

Any help will be highly appreciated.

Thanks a lot in advance!

Not working properly

With the new update, the extension stopped working as well as the previous version.
For example, with Light theme chosen will not adapt to almost any site, and with the dark theme in some sites with a light theme, like Twitter or youtube, the tabs are remaining dark

"pick from" options in settings don't work

image
image
image

Trying to use "pick from id" as an option, but the tab is still red instead of black, even though the id color is rgba(0,0,0,.6). Am I using this correctly? Trying to "pick from class" or "pick from tag" doesn't work either.

Too little contrast between foreground and background colour

On some sites, the foreground colour of the theme applied by the add-on depends on the Prefer Light Mode or Prefer Dark Mode setting, instead of being based on the background colour of the theme. This occasionally results in a browser toolbar that is difficult to read because there is too little contrast between the foreground and background colours.

Prefer Light Mode example

Screenshot 2022-07-27 at 17 57 38

Prefer Dark Mode example

Screenshot 2022-07-27 at 17 58 27

Would it be possible for the foreground colour of the theme to be determined independently from whether the add-on is set to prefer light mode or dark mode, so that there is always sufficient contrast between the foreground and background colours?

New tab extension’s colors don’t match the extension’s colors

Problem: The tab bar color scheme does not match the background of some extensions that provide custom newtabs for Firefox

How to replicate the problem:

  1. Install a new tab extension for Firefox such as Nitab or Tabliss
  2. Try to change the background color of the new tab
  3. The extension won't update the tab bar's color

I will attach some pictures of the problem below for more details:

image
Nitab with its custom black background

image
Tabliss with its custom blue background

Active tab color in light mode should not be darker

I would prefer if the active tab in light mode was either

  • lighter than the toolbar (as it is in dark mode)
  • or, even better, color-matched with the toolbar

Right now, it is darker:
Screen Shot 2023-04-18 at 10 12 38 AM

I don't think there is such an option in the settings right now.

Not working!!

Not working in my system, url becomes invisible and rest everything remains the same even after refreshing the site.

Wrong color after detaching tab

The following actions result in a wrong color.

  • Have two tabs open.
  • Detach the foreground tab to a new window by either dragging, or right clicking the tab and "move to new window"
  • The remaining background tab now keeps the color from the detached foreground tab.

Tried the following in the remaining background tab (so that is now 1 tab in its own window)

  • Reloading the tab doesn't fix it.
  • Using the home button to go to the "Firefox Home" page, retains the same color from the detached foreground tab.
  • Other websites do get a proper color.
  • Going back to the website the tab started out on, sometimes reverts to the color to the detached foreground tab.

I am using Firefox beta 101.0b4.

Color changes only on page load, and flashes on a website

Great extension! I LOVE IT.

One thing I've noticed though: in my website I have a dark mode switch. I'm gonna use it to describe the behavior I'm experiencing.

A little background: my system, Firefox and the extension are working on dark mode right now (it's night time here at the moment of testing the extension). I have the Dark Reader extension installed, but I disabled it completely from Firefox extensions to track down the problem properly.

I got 2 problems:

  • When I'm in dark mode in the website, everything works fine. However, if switch to the light theme, it doesn't change the tab colors right away. I need to refresh or get into a link to make it change.
  • If I leave it in light mode, it flashes in dark and then goes to the proper color again (light).

I can tell you that the meta theme-color in my website is set via javascript at the very beginning of loading the website. The flashing problem does not happen in Chrome or similar browsers in Android where the tabs color changes according to the current webpage theme, and they switch dynamically as well.

I could say that the flashing problem might be because the theme-color tag is being processed a few milliseconds late, but still the javascript code is running even before the DOM is processed I guess. The problem does not happen in Android browsers because they process the theme-color tag a bit late and, in the meantime they retain the previous color, I guess?

EDIT: the flash issue seems to happen, at least to me, in the homepage, here, and any product page. It does not happen, however, here, or at least not so frequently, which may hint a race condition problem as I mentioned.

And an optional issue, which I don't really know if that's part of the scope of what the extension is able to do:

  • The SVG favicon in my webpage is able to switch between dark and light mode depending on the system color scheme (I'm guessing more precisely Firefox color scheme). So, it won't change according to the current theme chosen in the website, which is desirable given that it has to go along the color scheme of the whole browser. Thing is, the extension does change the whole look of the borders and tabs.

Does it have the ability to switch the SVG colors in the favicons? To give more information, SVG uses the media query (prefers-color-scheme: dark) to change the fill color within the icon. It is embedded in the SVG file.

Thank you!

Add option to set an opacity of sidebar border

First of all, I would like to state that I am not a user of this extension myself.
I am the developer of an extension called Sidebar Tabs, and one of your user asked me to make Sidebar Tabs compatible with this extension.
Ref Can you pls add support for the "Adaptive tab bar color" extension · Issue #207 · asamuzaK/sidebarTabs

The following feature request is what I noticed while testing with this extension.

This extension allows the user to set the opacity of the toolbar_bottom_separator.
I think it would be better if the user could also set the opacity of sidebar_border.

Regards.

PDF Viewer uses color of last visited website

As the title, says, when I open a PDF in Firefox the header color doesn't change and instead keeps the one from the last website. The console says "No connection to content script." The correct theme should be the same as used in debugging windows.

I would suggest either checking if the title ends on .pdf, or using a default theme whenever an error occurs.

Home Tab Colour Resets to default after some time.

I use a custom home page colour so I changed the about:home tab colour accordingly however after some time (usually after sleep or restart) the tab colour resets to default.

I am using Firefox 106.0.5 on Windows 11 22H2.

cant load preferences

image

image

There are no posiiblity to load prefernces after any changes in settings and restarted browser.

image

Compatibility with whitesur theme

Hello there! I wanna know, is this extension is also available with the whitesur theme?
Already give it a go with another themes and it works amazing! Very nice job indeed

Should look at root element style.

One reason why this doesn't work on more websites is that:

https://github.com/YS-Wong/Adaptive-Tab-Bar-Color/blob/ccfd80d747b9bc9f468de44f7d996a9472a5fc00/content_script.js#L23

Only looks at document.body. It should try document.documentElement too. The order is a bit tricky, I guess if both are specified body-first might be a more reasonable thing.

Another thing you could consider is doing something like (untested):

for (let el = document.elementFromPoint(window.innerWidth / 2, 1); el; el = el.parentElement) {
  let background = getComputedStyle(el).backgroundColor;
  if (background != "rgba(0, 0, 0, 0)")
    return background;
}

That would allow you to catch headers and so on.

Request: Dynamic Updates

It seems that this extension sets the color when the page loads, but it would be nice if there were an option to have it dynamically update as the view updates. A good example of this is how macOS Safari 15 handles content changes.

To demonstrate, here is an example of Safari updating colors as a page changes compared to how this extension handles them using the website ippsec.rocks. On the initial page load, the page is a blue color which Adaptive-Tab-Bar-Color matches:
Screen Shot 2022-05-03 at 12 38 21 AM

On this particular website, when you start typing in the main input, the page colors will change. Safari will dynamically change the tab bar color along with these changes, whereas Adaptive-Tab-Bar-Color keeps the original blue color from page load.

Safari:
Screen Shot 2022-05-03 at 12 38 05 AM
Firefox:
Screen Shot 2022-05-03 at 12 38 25 AM

Would it be possible to mirror this behaviour using this extension and Firefox? I understand that it may come with a performance overhead it is possible, but it could be an experimental feature with a warning for those who are interested in using it.

Allow to set the background transparency

What if we could set the transparency of tabs and the top bar so we can have transparency of background image while changing the tab bar and toolbar.

I saw this WaveFox has it in windows and linux.

Is it possible to do similar thing in macOS?

Wider Range for Brightness Sliders Under Customisation Tab

On Firefox Add-Ons site I saw Mozilla made some official Firefox themes, so I hope it would be awesome if you can make even more flexibility in your extension so users can customize the interface to reach similar effects as these:

Snap-Crab-No-Name-2023-7-12-0-39-40-No-00
Snap-Crab-No-Name-2023-7-12-0-40-49-No-00
Snap-Crab-No-Name-2023-7-12-0-42-8-No-00

Context menu light mode

The context menu is always in light mode when using the extension, even though dark mode is enabled in settings->themes. Also included a picture of extension options if it's relevant.

image

image

Is it a bug or is it intended and I should change it with css?

Set color for current page

I suggest adding a color input with a button and a trash can to the settings menu. This input would be used to set a color for the current page. Trash can would be used to delete the set color. I'd have fun trying to tackle this, if you think it's a good idea.

use default system buttons

hi, it would be great if its possible that the extension just changes the headerbar and not the close-button
the bar looks like this:
Captura desde 2022-07-19 19-11-15-cropped

and im asking if its possible to use other close button like the adwaita ones :)
Captura desde 2022-07-19 19-13-43-cropped

thank you

Endlessly re-applying theme

There's a bug where a theme is endlessly re-applied which leads to high CPU usage and slows down Firefox completely. It happens when going from dark theme to light theme, and vice versa.

Steps (Dark mode)

  1. Enable "Allow light tab bar"
  2. Select "Dark Mode"
  3. Open a new private window and search for anything.

Google loads up with light theme the first time and that's when Firefox starts to flicker as the theme is re-applied endlessly.

Steps (Light mode)

  1. Enable "Allow light tab bar"
  2. Select "Light Mode"
  3. Open a new private window.

Private window loads up with dark theme and same thing as before happens. Flickering (look at the edges of the browser), high CPU usage and sluggish browser.

Caused error for jquery

Show this when I login battlenet in china (seems different from other areas). It's fine when disable this addon
Uncaught (in promise) Error: Permission denied to access property "apply"

Compatibility Issues With Any Other Add-on

I installed this extension and it looks really good, so i tried to make my sidebery setup work with it, but i can't;
i tried forcing the colors to use " toolbar-bgcolor " and " lwt-accent-color " and i also tried to make it transparent since i noticed that the normal sidebar ( for example history ) has the correct colors but both of these tries made it just black.

Smooth Transition Between Colour Change

Currently when we change the tab, the colour flashes, it would be a nice toggle addon to enable if we wish to set time delay and transition colour slowly instead of direct flash.

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.