0
votes

I am trying to work through https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Annotator with jpm (https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/jpm) rather than cfx, and running into difficulties:
=> the button/widget that the addon adds does not appear in my browser. Not even in the Additional Tools and Features section if I go to Customize the browswer appearance.

This is the SDK v1.17, and Firefox v38.0.1 for Linux (openSuSE13.2).

I have created the structure and files with given names and contents, telling jpm to use main.js as the entry point, rather than index.js, in order to match the tutorial (which is cfx-based).

I am also passing jpm the -b PATH-TO-FIREFOX-BINARY flag, because it apparently doesn't follow the symlink at /usr/bin/firefox, but it sounds like that's a known issue.

I am also also passing jpm the -p MY-DEV-PROFILE flag because I found that with the introductory tutorial (https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Getting_Started_%28jpm%29) that was the only way I could get that button to show up.

But that doesn't help here, nor does leaving off that option.

The Addon Manager confirms that the extension is installed.

So I am open to suggestions. Obviously I am new to extension development, and pretty new to javascript in general.

I had also better ask while I am here: What I want to do is modify the behaviour of Firefox's Find (in page); can something like that be done with the SDK, or do I need to use the Overlay method?

Any other suggestions helpful for learning addon development would also be welcome (but should probably be done as comments, rather than Answers; let's save Answers for the original question about this tutorial button).

Thanks!

2

2 Answers

0
votes

The widget api was removed in Firefox 38. For most cases you can replace widget with the button apis we introduced in Firefox 29, see this blog post for more information.

0
votes

Ah, heheh, never mind.

It was just an impedence mismatch between the original cfx instructions and the jpm way of doing things.

While I had told jpm to use main.js instead of index.js, I had failed to tell it that main.js was in the "./lib/" directory instead of the root directory of the extension.

After changing the package.json to say

"main": "./lib/main.js"

it works - as far as that goes. But it turns out that the entire tutorial is no longer valid; see my (Edward's) comment on canuckistani's answer.

My subsidiary questions about whether the SDK will even do what I want (changing some Find behaviour) and any other advice/resources still stand, however.