-   Programming (
-   -   Use firefox as user-interface for shell script? (

chuckj 03-29-2010 08:54 AM

Use firefox as user-interface for shell script?
In Windows, I was able to use IE as a user interface because I could code a WSF (Windows equivalent to shell script) to respond to events in IE.

Now that I've moved to Linux/Firefox, I'd like to use Firefox in a similar way.

Specifically, I would like to write a bash script to run lsdvd with XML output, use XSL to transform the XML for Firefox, then take an action (encode a selected track on the DVD) based on the user's selection. I would be happy if I could make Firefox write something somewhere that the script could read, but I suspect that security measures would prevent that.

I think this is possible because I saw this done somewhere in a configuration program. I have more experience now and could figure it out from the example, but I can't remember where I saw it.

Does anyone have any suggestions?

Thank you,
Chuck Jungmann

ta0kira 03-29-2010 01:50 PM

I've used PHP to write a front-end for a script and it works to a limited extent (error handling is coarse,) but that requires a running web server, not just a browser. Other than something like that, I don't think it's worth trying to use Firefox as a GUI; maybe try Java.
Kevin Barry

Tinkster 03-29-2010 02:16 PM

It should actually be possible using XUL - have a look here:

Now I'm not saying that I feel this is sensible ;} ... as far as
I'm concerned you may achieve faster results with something like
PyQt or even java (shudder).

chuckj 03-29-2010 10:47 PM

Argh...slow connection lost my response...

I've considered using a local web server, like, but that seems like overkill.

The reason I want to use Firefox is because I'm reasonably adept at using XML/XSL with javascript to allow a drill-down interface for large datasets. It would take me a long time to develop something similar in Python. It would make more sense to use the local webhost.

I remember seeing a configuration application on a Nokia Internet Tablet that used Firefox. I can't find it, it may have been on an earlier version of the OS that I lost when I updated. But having seen it, I just want to see if anyone has ever done this.

I will look at XUL, but am also wondering if there is an alternate set of privileges in Firefox if it can determine that it is running locally? I have seen another thread in the forums that discussed running a shell script from Firefox. That could suit my purposes, but I'm hesitant to use it unless I can understand how that doesn't defy security. I'm afraid it is an option that will be denied in the future.

Thanks for your responses...


All times are GMT -5. The time now is 06:50 PM.