Hi everybody,
I am currently working on embedding the mozilla browser in a Python
application under Win32, and decided to take the
nsIWebBrowser/nsIWebBrowserChrome approach. I noticed that essential
functions to get this working are marked as [noscript] in the xpcom
interface files, so i took the noscript parts out and recompiled the
descriptors, et voila, it is indeed possible. (read the other mail i
wrote regarding noscript problems)
I did not implement nsIWebBrowserChrome as the (outdated) documentation
requires, still nsIWebBrowser is embeddable in a window created with
Venster and displays well.
However I would like to implement nsIWebBrowserChrome so I could gain
access to extended functionality of nsIWebBrowser like javascript
hosting (which seems non-functional, at least my AJAX test fails),
tabbing (which isnt working either), or logging errors. The problem is
that as soon as access is made to my object, python crashes within
pyxpcom. I don't know exactly what is wrong.
# This is how I started:
class WebBrowserChrome:
_com_interfaces_ =
nsIWebBrowserChrome,nsIWebBrowserChromeFocus,nsIWebProgressListener,nsIEmbeddingSiteWindow,nsISHistoryListener,nsIObserver,nsIContextMenuListener,nsITooltipListener,nsISupportsWeakReference
def __init__(self, handle):
self.chromeFlags = nsIWebBrowserChrome.CHROME_DEFAULT
self.webBrowser = None
self.siteWindow = handle
self.title = 'Test'
self.visibility = True
...
# later on:
self.webbrowser.containerWindow = server.WrapObject(self.chrome,
nsIWebBrowserChrome)
print self.webbrowser.containerWindow # crashes here
basewindow = self.webbrowser.queryInterface(nsIBaseWindow)
self.basewindow = basewindow
webnav = self.webbrowser.queryInterface(nsIWebNavigation)
basewindow.initWindow(self.main.container.handle, 0, 0, 0, 100, 100)
basewindow.create() # crashes here too
Only if I dont set containerWindow, the program runs.
Can anyone give me a clue? Maybe I'm forgetting something elemental?
Best regards,
Leonard Ritter
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom