Comments (6)
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.
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.
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.
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.
I think this API can reply to this issue :
https://developer.mozilla.org/fr/Add-ons/WebExtensions/API/browserAction/setIcon
from undoclosetab.
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)
- Extension stopped working HOT 3
- Updated translations for 'ptbr'
- Updated translations for 'zh_CN': zh_CN
- [Feature request] Option for left-click to open the context menu HOT 1
- Firefox policies support HOT 13
- Add Support for Manage Extension Shortcuts to allow shortcut to activate an undo HOT 3
- Empty closed tabs list sometimes HOT 15
- wrong issue HOT 2
- List of recently closed tabs missing from right click menu HOT 1
- [New addon] Closed tab notifier HOT 3
- After each start, the list is empty HOT 6
- The “Web” icon in Undo Close Tab context menu is outdated HOT 1
- Right click sporadically stops working HOT 1
- in firefox 113 the toolbar button right click no longer works. HOT 2
- is there a different version of this extension for closing tab instead undo close tab?
- [Idea] Suggestions to change extension icon HOT 8
- [Idea] keyboard short for using undo close functionality HOT 1
- New translations for 'it': Italian (Italiano)
- "Recently closed windows" greyed out after restart HOT 3
- Can't find Icon unduclosetab sinds firefox 120.01 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from undoclosetab.