Trigger FireFox extensions from a custom button

2019-09-19 04:02发布

I have converted some Chrome extensions to firefox .xpi and installed them in FF. They show up in the add ons list but how can I make a custom button somewhere in a toolbar and trigger the extension?

In Chrome you have a specific toolbar that shows the extensions… and To trigger them.

Cheers,

M

1条回答
ら.Afraid
2楼-- · 2019-09-19 04:29

If you are using the addon SDK do something like this:

//WIDGET METAINFO
var meta_info = widgets.Widget({
    id: "meta_info",
  label: "Displays information about Meta",
  contentURL: data.url("icons/meta.png"),
  panel: meta_panel
});
var meta_panel = panel.Panel({
  width: 500,
  height: 300,
  contentURL: data.url("html/meta.html"),
  contentScriptFile: data.url("js/meta_panel.js"),
  onShow: function()
  {
      get_metas();
  }
});

if you want to do bootstrap see these templates here, you can install the xpi to see it in action:

I'm making more templates let me know if there's one you would like to see.

查看更多
登录 后发表回答