5

I've got a working add-on for Firefox, which was built using the cfx tool. The tool is being depracated in favor of jpm from Firefox 38 onwards. I followed the instructions to make the switch, but while running, I get the term undefined often, even though the add-on works just fine.

JPM undefined Starting jpm run on Magnetz
Creating XPI
JPM undefined XPI created at C:\Temp\example@add-on-1.0.0.xpi (133ms)
Created XPI at C:\Temp\example@add-on-1.0.0.xpi
JPM undefined Creating a new profile

Someone in the forums suggested that the undefined comes from an install.rdf file, which I don't have. I only have a package.json, which is what the cfx-based process requires.

Looking at the contents of typical install.rdf files, it seems to contain more or less the same data as a package.json. Is there any way to convert the package.json to install.rdf?

I've actually not been able to find a recently updated install.rdf for add-ons, with most links talking about the older XUL-based add-ons.

I'm also confused about why a Python-based tool (cfx) favors a JavaScript-based package.json file, whereas the newer JavaScript-based tool (jpm) favors an arguably deprecated XML-based install.rdf.

aalaap
  • 4,145
  • 5
  • 52
  • 59

1 Answers1

0

There is a guide for transitioning to jpm from cfx here. In short, you do not have to create your own install.rdf file, both cfx and jpm create one for you. Install.rdf is an old crufty xml file, but it is necessary for the extension to work at all in Firefox.

The package.json file has a field 'Title' that you can add in order to provide a 'display name' for your add-on - this replaces the older 'fullName' field.

As for the 'JPM undefined' message you see - I think that's actually a bug in JPM.

therealjeffg
  • 5,790
  • 1
  • 23
  • 24
  • The guide on the AMO dev hub has similar info, but neither of them tell me explicitly at what point the install.rdf is created or how I can ask it to do so. Do I need to jpm init in my existing add-on folder? – aalaap Mar 05 '15 at 02:06
  • install.rdf is create by jpm when you run jpm xpi, see [this function](https://github.com/mozilla/jpm/blob/master/lib/rdf.js#L21-L131) in the jpm source. – therealjeffg Mar 06 '15 at 19:04
  • Okay... so, like you said, my problem of 'undefined' is probably not related to index.rdf at all and I've been barking up the wrong tree... – aalaap Mar 08 '15 at 14:36