Embed a web browser into a page

lkcl luke.leighton at googlemail.com
Sun Mar 29 08:29:27 EDT 2009


On Feb 12, 12:44 am, "Carbon Man" <dar... at nowhere.com> wrote:
> Hi,
> I need to embed a web browser into a python page. I am coming from the MS
> world where I created an app that all of it's interfaces were actually web

 "its" not "it's".  "it apostrophe s" is short for "it is".  so you've
said "i created an app that all of it is interfaces were actually web
pages.  additions of apostrophes have resulted in lunar exploration
rockets crashing, amongst other things (programs written in
fortran...)


> pages rendered in an Internet Explorer activex control.


> wondering if there is a way to do something similar that would work
> cross-platform?

 well, if you want to run python under wine, and attempt to install
pythoncom-win32 under that, i _have_ had some success in getting
python 2.5 to work as a wine application, and worked with the wine
team to fix a number of critical bugs in the not-exactly-posix-
compliant MSVCRT.

 so you _could_ conceivably get that up and running, and it would be
_kinda_ cross-platform.  don't even think of using python 2.7 yet
because changes in python 2.7 make extensive use of message-mode
NamedPipes, and the wine NamedPipes infrastructure doesn't support
message-mode, and so screws up on critical things like the thread
module.


> I guess there is much more complexity in it when you start to go across o/s
> platform boundaries. The common web interface would then be Gecko orWebKit?

 yes.  so, therefore, you need to look at python-hulahop or
pywebkitgtk with patch #13 and webkit-glib/gdom (webkit with patch
#16401, or use my pre-patched tree - http://github.com/lkcl/webkit/tree/16401.master


> So can someone suggest what would be required to build a cross-platform
> Python app that was capable of browsing HTML files, receiving events from
> the browser, and that allows the embedded page to call host Python modules
> from Javascript via an object reference? Or I am asking too much :)

 you're not asking too much - you're just asking for a whopping great
30mb of dependencies, whichever way you go.

 if you'd like to help out, we _really_ do need builds of webkit for
win32, patched, which took a week, last time i tried - see
http://lkcl.net/webkit/cross-compile-gtk.notes.txt

 and then win32 builds of pywebkitgtk on top of _that_.

 either way, if you go the python-hulahop or the pywebkitgtk-patched +
webkit-patched route, you're in for about two weeks non-stop of
build / compilation / dependency-hunting, to get something going on
win32.

 as i've done webkit-win32 once before, i will be in a position to
help advise you (and the bugs in gcc i encountered will likely have
been fixed by now in "official" releases).

 whereas the python-hulahop build process you're likely to be the
first person ever, in the world, to try building python-hulahop for
win32.

 l.





More information about the Python-list mailing list