xul and inter browser communications

View: New views
2 Messages — Rating Filter:   Alert me  

xul and inter browser communications

by Claudio Bizzarri :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ciao a tutti,

I'm writing an application for controlling an embedded device using
serial port. At this moment, I use net2ser and a xul application that
use jslib (socket, file and http for the moment). Pete gave me a big
help and now my application works very well. I've put this application
in jslib directory behind chrome so I can start it with this command:

firefox -chrome chrome://jsliblive/content/blax.xul

For the moment I'm installing my application on every client copying
my two files (blax.xul and blax.js) into jsliblive chrome directory.

Now I have a problem: I have 30-40 clients that will use my
application, but there is a web application in central server that
needs to pass to my xul application some data: for examples, in my xul
app i have a textbox labelled "status" and I need to set it on "start"
or "stop" value by javascript provided by php code on central server.
But I cannot set elements of a window that is not father of other.

I've tried to supply xul code by central server, but without success:
I cannot open window using chrome://jsliblive/content/blax.xul (I've
got Errore: uncaught exception: [Exception... "Component returned
failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMJSWindow.open]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame ::
http://192.168.1.5/vis_copia/ :: <TOP_LEVEL> :: line 15"  data: no])
or http://c192.168.1.5/vis_copia/blax.xul (in this case i've got a bad
xul window, not well formatted, the grid components are not correctly
viewed).

Can you help me or can you redirect me to some place where I can
retrieve some pieces of information? Can I use some jslib feature to
send some message from a firefox window to my blax.xul?

Thank you in advance.

Regards,
Claudio Bizzarri
_______________________________________________
Jslib mailing list
Jslib@...
http://mozdev.org/mailman/listinfo/jslib

Re: xul and inter browser communications

by Pete Collins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


>
>Now I have a problem: I have 30-40 clients that will use my
>application, but there is a web application in central server that
>needs to pass to my xul application some data: for examples, in my xul
>app i have a textbox labelled "status" and I need to set it on "start"
>or "stop" value by javascript provided by php code on central server.
>But I cannot set elements of a window that is not father of other.
>  
>
You will need to pass your xul app some xml data which you can then
parse for the desired values.

>
>Can you help me or can you redirect me to some place where I can
>retrieve some pieces of information? Can I use some jslib feature to
>send some message from a firefox window to my blax.xul?
>
>
>  
>

To distribute, I would recommend creating an XPI package that can be
installed on your 30-40 clients, this will need to include jsLib.

Using remote XUL like a generated php web page wont work because the
code you are calling from your XUL file is privileged and only
accessible from chrome urls (a package).

Any info you need from your web API over http can be obtained using
XMLHTTPRequest object.

--pete

--
Pete Collins - Founder, Mozdev Group Inc.
www.mozdevgroup.com
Mozilla Software Development Solutions
tel: 1-719-302-5811
fax: 1-719-302-5813

_______________________________________________
Jslib mailing list
Jslib@...
http://mozdev.org/mailman/listinfo/jslib
LightInTheBox - Buy quality products at wholesale price!