registering chrome

34 views
Skip to first unread message

Emiliano Heyns

unread,
Sep 18, 2025, 5:00:15 AMSep 18
to zotero-dev
What is wrong with this:

const aomStartup = Cc["@mozilla.org/addons/addon-manager-startup;1"].getService(Ci.amIAddonManagerStartup);
 const manifestURI = Services.io.newURI(`${rootURI}manifest.json`);
 let chromeHandle = aomStartup.registerChrome(manifestURI, [
      ["icons", "zotero-open-pdf", "icons/"]
    ]);

I'm getting

Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [amIAddonManagerStartup.registerChrome]

I'm using the same code in BBT where it does succeed (although BBT also loads FTLs, this plugin does not)

XY Wong

unread,
Sep 22, 2025, 5:43:13 AMSep 22
to zotero-dev
The `icons` is not a valid registration type (usually you're only supposed to use `content`). For more details, see https://searchfox.org/firefox-esr140/source/toolkit/mozapps/extensions/AddonManagerStartup.cpp#822-841

Emiliano Heyns

unread,
Sep 22, 2025, 6:11:16 AMSep 22
to zotero-dev
Ah I thought it was a path.
Reply all
Reply to author
Forward
0 new messages