0

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: How to send JavaScript code to IE using C# (.Net 3.5), run it, then get a string return value from the JS code?

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.

2
  • Not really related to the question but: "N.B: I'm working on 10.4." Any reasons for not updating? Commented Nov 24, 2009 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 Commented Nov 24, 2009 at 16:33

3 Answers 3

1

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->

https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes/Using_js-ctypes

Sign up to request clarification or add additional context in comments.

Comments

0

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

3 Comments

Can Firefox addons (not plugins) have languages other than js (and xul for layout)?
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?
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.