473,542 Members | 2,049 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+CS S 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 2133

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

Similar topics

9
6673
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. Working dir : "C:\test copy" "copy.php" PHP script : <?php
2
7960
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
10555
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 keydown and keypress events in Firefox, but then I can't seem to get the key code. I also don't know if the window.event.srcElement.type works with...
5
2517
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 be defined identically (to take up 100% of the width of the parent table), and indeed IE makes them the same width, as I wanted and expected. But in...
4
3159
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 simple embedded dll, but then i lose the trust prompt that ClickOnce offers. Any ideas? Mark
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
1911
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 ( http://www.mib.org/~agt/WIDGETS/test.html ) inserts a new table row each time the submit button is clicked. (I'm working on Yet Another To-Do List, in case you're...
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 program just dissappears) I have created a simple example and was able to reproduce the same thing with this. I've just started using tkinter so I...
4
5350
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 doesn't happen with IE7. There's a little program below which illustrates the problem. I create two multi-line select boxes. The first one has an...
0
7330
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7571
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7721
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7324
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5246
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3380
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3376
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
943
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.