GithubHelp home page GithubHelp logo

Icon for dark theme about undoclosetab HOT 6 CLOSED

m-reimer avatar m-reimer commented on August 30, 2024
Icon for dark theme

from undoclosetab.

Comments (6)

M-Reimer avatar M-Reimer commented on August 30, 2024

Thanks for reporting.
I've filed a bug for this: https://bugzilla.mozilla.org/show_bug.cgi?id=1405026
I currently don't know of any way to get info about the loaded theme.

from undoclosetab.

KwanEsq avatar KwanEsq commented on August 30, 2024

As long as your icon is static the currently undocumented browser_action.theme_icon key of the manifest should do what you want (especially once https://bugzilla.mozilla.org/show_bug.cgi?id=1404568 lands)
Some in-tree doc here: https://hg.mozilla.org/mozilla-central/file/613f64109bde/toolkit/components/extensions/schemas/manifest.json#l352
basically add

"theme_icons": [{
  "dark": "icons/undoclosetab.svg",
  "light": "icons/undoclosetab-light.svg",
  "size": 19
}]

to browser_action

from undoclosetab.

M-Reimer avatar M-Reimer commented on August 30, 2024

You are right, but the discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1394579#c20 suggests, that there may be a better API in future.
The API, you found, is better than nothing, so I'll have a look at this and ship the next version with two SVG icons.

from undoclosetab.

M-Reimer avatar M-Reimer commented on August 30, 2024

See:
ff5962f
I'll leave this bug open for now, waiting for the resolution of https://bugzilla.mozilla.org/show_bug.cgi?id=1394579#c20
But I can live with the current solution. The second icon is autogenerated by just replacing the "dark" color with white automatically.

from undoclosetab.

MatMoul avatar MatMoul commented on August 30, 2024

I think this API can reply to this issue :
https://developer.mozilla.org/fr/Add-ons/WebExtensions/API/browserAction/setIcon

from undoclosetab.

M-Reimer avatar M-Reimer commented on August 30, 2024

The keys, suggested by @KwanEsq are now officially documented:
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/browser_action
So I guess we won't see anything better in the near future.
As I already use this since a few versions, I'll close this issue now.

from undoclosetab.

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.