Frank Hansen
> I was able to get your exaple to work. (using mozilla version 0.7)

   Good - it is a very simple plugin.

> But I _do_ need to be able to communicate with this plugin using
> LiveConnect, which I have not been able to get working. My "dream"
> example could be as simple as an plugin with a text widget (sound
> familliar?), AND the possibility to set the contents of this textbox via
> Javascript.

   You are aware that LiveConnect is dead and you have to use XPCOM?

   Its not too hard to do an XPCOM interface, here is one way:
   1. Describe the interface in XPIDL.
   2. Create a type library for the interface.
xpidl -m typelib -w $(XPIDL_INCLUDES) IMe.idl

   3. Create a header for the interface.
xpidl -m header -w $(XPIDL_INCLUDES) -o $* IMe.idl
   4. Include the header in your code, define the interface ID (IID), derive
your main plugin instance class from the interface, use one of the
NS_IMPL_ISUPPORTS* macros to implement basic XPCOM, and implement the
methods of the interface.
   5. Copy the XPTs to the components directory and the plugin to either the
components or plugin directories or both - there may now be an official
location that works but I've had this fail so many times I always copy to
both.
   6. From JS on HTML pages you may need to ask for privileges and use a
long form of reference to talk to the interface.
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var me = document.theMe.IMe;
me.hello();
   7. I've probably forgotten something.

   If I find some time, I'll try to add this to evmoz.

   Neil



Reply via email to