-->

creating xpi does not work

2019-07-23 08:54发布

问题:

I have been trying to learn about Add On Development for Firefox. I am hitting a snag and I am not too sure what the issue is? I have tried installing the SDK and Python on two different machines Python 2.5 (on a win server 2008) and python 2.6 (on windows 7) successfully. I installed the Add On SDK with no problems. Followed this tutorial to a TEE. https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Getting_Started_With_cfx the test runs perfectly using cfx run on both machines and setups. Looks great. My issue is when I do cfx xpi to create the xpi file. It creates the file no problem and I can install this no problem on a Mac FireFox browser and it all works like a charm. However, when I try to install this on any Windows Firefox browser in the Add-Ons manager it installs perfectly but the icon that is supposed to be in the add-on toolbar never shows up. Why would this example xpi not work on Windows Firefox?

This is the code in my lib/main.js file

var widgets = require("sdk/widget");
var tabs = require("sdk/tabs");
var widget = widgets.Widget({
  id: "jquery-link",
  label: "jQuery website",
  contentURL: "http://www.jquery.com/favicon.ico",
  onClick: function() {
    tabs.open("http://www.jquery.com/");
  }
});

Exactly like the tutorial. I don't believe its a code issue more than a setup issue? Or maybe there is another step that is missing for Windows Firefox (maybe a setting in options? Security? or maybe some file needs to be registered in the registry?). The strangest part about this is that it works no problem with cfx run, I see the jQuery icon in the add-on bar. When I create the xpi file and install it into the same Firefox browser I just tested it with it doesn't work? Any clue why?