Take the 2-minute tour ×

More precisely my goal is to create an add-on (or plug-in?) which is able to communicate with my main Cocoa application using something like the NSDistributedNotificationCenter. I need to be able to inject JavaScript code into the current webpage and get return values from the JS calls when my add-on receives the request to do so by my main application. Then I need to pass the return values back to my main application for processing.

Alternatively if there is a simple way to call JS in the active Firefox webpage and get return values that would also do the job.

If you want more info on why I want to do this, you can look at my other question: http://stackoverflow.com/questions/1711342/how-to-send-javascript-code-to-ie-using-c-net-3-5-run-it-then-get-a-string

Note that I'm not only interested in knowing how to make a Firefox add-on but also in everything I talked about above. For example, how to inject JS into the active webpage, etc.

I'd like guidance on what technologies to use, tutorials and sample code if possible. The best would be a sample Xcode project but I'm not counting on this :P

Thanks in advance!

N.B: I'm working on 10.4.

share|improve this question
Not really related to the question but: "N.B: I'm working on 10.4." Any reasons for not updating? –  Benoit Nov 24 '09 at 16:10
This is not my personal computer. I tried to convince my boss that we should upgrade my workstation to 10.5 but being a Windows developer it didn't seem to be a priority for him! :P –  Form Nov 24 '09 at 16:33
add comment

3 Answers

You could try using C-Types with FF, which is a regular dll being called by Javascript in your addon, this is WAY better approach that using XPCOM, because if the Interfaces you use in there can change in each FF version, indeed you will have to do multiple dlls each for your addon supported FF versions

Go here my friend->


share|improve this answer
add comment

First learn how to write add-ons for Firefox. Adding Objective-C code afterwards is the easy part.

share|improve this answer
Can Firefox addons (not plugins) have languages other than js (and xul for layout)? –  Amarghosh Nov 24 '09 at 16:23
From the look of this tutorial (which I had found before posting my question) XPCOM seems interesting but it looks like it's used inside js only... I'm still clueless about which technology I need to use to develop an addon in C / Obj-C. Where does the C / Obj-C code fit in all these technologies? –  Form Nov 24 '09 at 16:47
developer.mozilla.org/en/… –  Georg Schölly Nov 24 '09 at 19:01
add comment

I know there is source available to the OSX FF Plugins for displaying download progress over the Dock Icon (http://github.com/vasi/firefox-dock-progress) and the "pdf plugin" that allows FF to do in-line PDFs is on Google Code.

share|improve this answer
add comment

Your Answer


