browserAction.setIcon() throws "IconPath not found" error
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(Not tracked)
People
(Reporter: r-a-y, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0
Steps to reproduce:
This is a simplified version of the code I'm using to change the button icon when a button is clicked:
browser.browserAction.onClicked.addListener(() => {
const icon = 'icons/heart-outline.svg'
browser.browserAction.setIcon({ path: { '16': icon, '32': icon } })
})
Note that "icon" is a relative path.
Actual results:
In v78, when I clicked on my browserAction button, my button would also change its icon.
In v91, I get the following error:
13:13:21.008 Error: Internal error: Type IconPath not found Schemas.jsm:1602:13
get targetType resource://gre/modules/Schemas.jsm:1602
normalize resource://gre/modules/Schemas.jsm:1609
<anonymous> resource://gre/modules/Schemas.jsm:1508
withChoices resource://gre/modules/Schemas.jsm:601
normalize resource://gre/modules/Schemas.jsm:1500
r resource://gre/modules/Schemas.jsm:2014
withPath resource://gre/modules/Schemas.jsm:639
checkProperty resource://gre/modules/Schemas.jsm:2013
normalize resource://gre/modules/Schemas.jsm:2086
fixedArgs resource://gre/modules/Schemas.jsm:2691
map self-hosted:221
checkParameters resource://gre/modules/Schemas.jsm:2686
stub resource://gre/modules/Schemas.jsm:2792
setBrowserAction moz-extension://a01d4993-3d74-47e9-890f-43b80f873ae1/background.js:25
<anonymous> moz-extension://a01d4993-3d74-47e9-890f-43b80f873ae1/background.js:31
Expected results:
In v91, the button icon should change as it did in previous versions.
It doesn't appear that browserAction.setIcon has changed since v78.
Updated•4 years ago
|
Description
•