ylecuyer / envify

Colorify tabs with current env
https://addons.mozilla.org/en-US/firefox/addon/envify/
40 stars 5 forks source link

Non-highlighted tabs use default theme instead of active theme. #7

Closed markstory closed 4 years ago

markstory commented 6 years ago

When envify is installed and the current tab does not match a highlight colour, it takes on the 'Default' theme background colour which is not necessarily the user's default theme.

Steps to Reproduce

  1. Use the theme picker to pick the 'Light' or 'Pastel Gradient' themes.
  2. The customize preview will update to the correct theme.
  3. Once the customize panel is closed, the inactive tab background colours will revert to dark grey which is not the user theme background.
jnachtigall commented 6 years ago

I think I've hit the same bug when using the Dark Theme. With Dark Theme the normal (not matched, that is, not red or yellow) tab background is always the default, normal, light theme but I actually use the Dark theme.

This came also up at reddit at: https://www.reddit.com/r/firefox/comments/8i09ij/envify_colorize_browser_tabs_for/dyoulp9/

ghost commented 6 years ago

+1, it sets default theme even when custom theme applied

etiennewan commented 6 years ago

I'm able to reproduce. This is perfectly normal because we are using theme.reset()

Note that this will always reset the theme back to the original default theme, even if the user had selected a different theme before this extension's theme was applied.

I think we will have to save the theme of the user with browser.theme.getCurrent() when installing the addon and use the result of the promise with theme.update() instead of using theme.reset().

But what if the user changes its theme ? What time would be best to query the browser about the theme being selected by the user : when opening Firefox, when opening a new tab ... ? Working right now on it to figure it out :)

ylecuyer commented 6 years ago

Great idea @etiennewan. We should add an advanced settings to trigger this behaviour. We should tag it has beta meanwhile Firefox issue is resolved.

The save may be done once as user do not change their theme every day. May be a button to update the saved theme would be useful in case the user change the theme.

tzikas97 commented 6 years ago

A hacky way of fixing this is by creating another environment and using *``** as the value. Then choose a color that is close to the one of the theme you are using! :smiley: image

garrettw commented 6 years ago

FYI the color for the dark theme is #323234. The downside of this is that you lose the blue highlight bar on the active tab so it's a little harder to see which tab is active.

rubcap commented 6 years ago

Hi, thanks for this great add-on! However, it seems to override my chosen, custom theme (FF 60.0.2 on Win10 here).

When Envify is activated, the custom theme isn't used at all. After deactivating Envify and restarting Firefox, the custom theme is shown again.

As a user, I guess I'd only want the selected tab (and optionally the title bar with it) to be color-overriden if it matches one of the specified domains. Thanks in advance.

Smile4ever commented 6 years ago

I think we will have to save the theme of the user with browser.theme.getCurrent() when installing the addon and use the result of the promise with theme.update() instead of using theme.reset().

I agree with @EtienneWan

The save may be done once as user do not change their theme every day. May be a button to update the saved theme would be useful in case the user change the theme.

@ylecuyer We could do a getCurrent() when loading the extension, and use the https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/theme/onUpdated event for theme updates (we should ignore the events that Envify triggers).

ylecuyer commented 6 years ago

I have noticed that the filled bug in the mozilla bugtracker has been asigned to @nt1m for his internship project. (https://bugzilla.mozilla.org/show_bug.cgi?id=1415267)

Hope it will get fixed soon :p

If not we could implement the described workaround.

toddmilne commented 6 years ago

Any update on this? I love this add-on but will probably not use it while I am unable to also use my current theme :(

ylecuyer commented 6 years ago

No @toddmilne, I tried to save the state of the browser theme at the install of the addon but the object returned by the API is empty (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/theme/getCurrent)

We have to wait for the bug linked above to be solved

sinhix commented 5 years ago

Just asking if it's ok after one year :) I found this extension today and had the issue

ylecuyer commented 5 years ago

Sadly this hasn't been fixed yet. I have asked Mozilla about it when they asked me to update the extension for FF 70. I'm waiting for their reply meanwhile you can follow the bug linked above.

Smile4ever commented 5 years ago

@ylecuyer Why don't you follow the combined approach from @etiennewan and myself as a temporary workaround? I am willing to submit a pull request if you want.

ylecuyer commented 4 years ago

Good news, it looks like this bug has been fixed in https://bugzilla.mozilla.org/show_bug.cgi?id=1592831 though if I understand the tagging the fix will be shipped in ff 74

fabiomargarido commented 4 years ago

Now that FF74 has shipped, can this be fixed?

ylecuyer commented 4 years ago

The fixed introduced in ff74 isn't enough for this extension though now browser.theme.getCurrent() is now working correctly so I could implement the workarround.

There is a PR available here https://github.com/ylecuyer/envify/pull/27 I hope some of you can review/test it before releasing a new version :)

ylecuyer commented 4 years ago

Fixed with #27

Please disable the extension before changing the global theme of the browser and enable it back after