Firefox 附加组件 Action Button 没有图标

Firefox add-on Action Button has no icon

我在 index.js 中将此代码添加到我的附加 SDK 扩展中:

var button = ActionButton({
  id: "my-button",
  label: "my button",
  icon: {
    "16": "./us16.png",
    "32": "./us32.png"
  },
  onClick: firstClick
});

操作按钮添加得很好并且可以工作,但是没有显示图标。我将这两个图标文件放在我的加载项的根文件夹中。我应该把它们放在别处吗?

(Button documentation.)

是的。将您的图标放在 data 文件夹中,同时将路径保留在代码中。

我有同样的问题。解决方案是将此代码添加到 packet.json "permissions":{"private-browsing":正确}

看这里Firefox SDK Sample Add On Exported XPI Action Button Doesn't Show Up