473,511 Members | 12,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Lightweight embedding of Firefox Gecko into application whose toplevel is Python--possible?

Sorry for crossposting to several lists, but from what I can tell, what
I want to do may involve several different areas of expertise. (None of
which I have :-( )

I'd like to use Gecko as the UI for an application mostly implemented in
Python. Ideally, I'd like to somehow come up with a Python module that
wraps the Gecko, so that I can:

1) Create windows whose content is drawn by Gecko.
1) Dynamically manipulate what is shown by Gecko.
2) Respond to mouse events and keypresses occurring on the window Gecko
is in.

I really don't need, or want, anything beyond this. Presumably Gecko
does have some notion of the DOM, since it handles CSS (which I do want)
and CSS needs the DOM to be meaningful. And I'm also assuming that Gecko
has or requires JavaScript, in order to actually do things with the DOM,
or at least to handle DOM events. (Or at the very least to handle mouse
events, since key events could in theory be handled outside of the
layout engine.) But I'd like to be able to build something with _just_
those features.

Given the above, using Firefox or even Xulrunner seems to be very
heavyweight and unnecessary. It would be somewhat nice to be able to
manipulate a XUL DOM to created panes, menus, etc. But even that is not
necessary--so far as I can tell, DOM manipulation+CSS has the ability
right now to do menus, scrollable sidebars, panes, etc.

I'd like to get away from the rest of the FF/Mozilla baggage (especially
XPCOM) because:

1) I don't want to have to deal with XPCOM, chrome stuff, XUL, make
details, XPIDL (or whatever it is), etc. etc. My brain is already too
full. :-)
2) Even if I did want to deal with the above, I find the documentation
for it disorganized and, more often than not, out of date. Not a
criticism, just an unavoidable weakness of open source development with
a large number of developers.

Given that the _only_ thing I really want to use is the Gecko layout
engine with some sort of relatively rudimentary keyboard and mouse
handling (I'll do all of the sophisticated handling in Python), it'd
just be nice to be able to dispense with all of the rest of the stuff.

For the record, I do know that PyXPCOM is still being developed, and
what little I've been able to glean suggests it's been going reasonably
well. However, I'm not sure it will do what I want it to. It appears to
be a way to write XPCOM components in Python, and I have no idea if that
will allow me to just use Python in the same way JavaScript is used
right now, which is what I want. From what little I've been able to
track down it seems that PyXPCOM may only be the starting point for
moving towards using Python for DOM scripting. Also, I'm not sure when
it will actually be done. Up-to-date online info about PyXPCOM (aside
from bug tracking) seems very sparse.

Given all of that, answers to the following questions (or suggestions
related to the whole endeavour) would be appreciated.
1) Does this even seem feasible? Can Gecko be 'broken out' from the
other Moz technologies to this extent?
2) Does anyone know of similar projects?
3) Can anyone point out a simple example of encapsulating Gecko in a
small C/C++ app, and then running/communicating with Gecko from that
code? (i.e. a Gecko embedding "Hello world") This is in some sense what
I'd be doing, since using Gecko from Python would involve (I assume)
wrapping Gecko in a Python-compatible C wrapper. I've come across a
number of embedding Gecko tutorials, but nothing that starts at such a
basic level.
4) Do I need to somehow provide/link in a windowing system of some sort,
or do I get that with the version of Gecko appropriate for the target
platform?
5) Will PyXPCOM let me do what I want? And is it close enough that I
should just wait for it? (It doesn't bother me if all of the rest of the
Moz/FF stuff is included in my app, just as long as I don't have to deal
with it.)

Many thanks,
Ken McDonald
Dec 19 '06 #1
0 2132

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
6671
by: Jean-Marc Molina | last post by:
Hello, I can't find a way to execute a Windows application, whose directory path contains blank spaces, from a PHP script. I also wonder if the problem happens under Linux and other OS. ...
2
7959
by: Sharon | last post by:
Can I use request.servervariables("HTTP_USER_AGENT") to determine if the user has Firefox or Internet Explorer? Is the return string differentiated enough? Thanks for any input.
3
10552
by: coolsti | last post by:
Can someone help me enhance this code snippet which works only for IE so that it will also work for Firefox? I have been trying all sorts of things and have gotten to where I can capture the...
5
2513
by: thatseattleguy | last post by:
I'm stumped. Visit: http://positivesweat.com/class.html ....and look at the tables in the middle labeled "morning" and "evening". Do this in both IE and Firefox. The tables appear to me to...
4
3157
by: markoueis | last post by:
Is there any way to embed a ClickOnce Application into the browser? I love the way ClickOnce works, but the problem is I would like it to display the windows form in the browser. I could use a...
2
4166
by: Furer Ramon | last post by:
Has anyone a example with source code to emmbed a true type fonts with a application? Thanks a lot Ramon Furer
1
1908
by: atilghman | last post by:
I've run into a problem with style computation under Firefox (Gecko/20061010 Firefox 2.0) which I can't understand. Any help would be appreciated. My short test case (...
4
2105
by: mdmdmd | last post by:
Hello, I wish to collect 4 files from a user. So I have decided to use tkFileDialog askopenfilename. My problem is that after a few file selections the root window is destroyed (the whole...
4
5348
by: Patrick Nolan | last post by:
I am using javascript to manipulate optgroups in select elements. When the results are displayed in Firefox 2.0 there is an annoying blank line at the top of the multi-line select box. This...
0
7367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7430
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7089
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1581
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
790
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
451
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.