Hi,
I am trying to embed Firefox in a wxWidgets application that comes
with the Mozilla source (release 2.0.0.12). I used the wxEmbed sample
and after some modifications I was able to make it compile and mostly
work. I can navigate to a typed URL just fine, however when I try to
click on a link etc on the resulting page, it does not work. Is there
something obvious that I have missed? Here is the portion of the code
that has been used to create the embedded browser and navigate to the
page.
nsresult rv;
mWebBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID, &rv);
if (!mWebBrowser || NS_FAILED(rv))
return NS_ERROR_FAILURE;
mWebBrowser->SetContainerWindow(NS_STATIC_CAST(nsIWebBrowserChrome
*, this));
nsCOMPtr<nsIDocShellTreeItem> dsti =
do_QueryInterface(mWebBrowser);
dsti->SetItemType(
mIsChromeContainer ?
nsIDocShellTreeItem::typeChromeWrapper :
nsIDocShellTreeItem::typeContentWrapper);
nsCOMPtr<nsIBaseWindow> browserBaseWindow =
do_QueryInterface(mWebBrowser);
mNativeWindow = aParent;
if (!mNativeWindow)
return NS_ERROR_FAILURE;
browserBaseWindow->InitWindow( mNativeWindow,
nsnull,
aX, aY, aCX, aCY);
browserBaseWindow->Create();
nsCOMPtr<nsIWebProgressListener>
listener(NS_STATIC_CAST(nsIWebProgressListener*, this));
nsCOMPtr<nsIWeakReference>
thisListener(do_GetWeakReference(listener));
(void)mWebBrowser->AddWebBrowserListener(thisListener,
NS_GET_IID(nsIWebProgressListener));
if (mIsURIContentListener)
mWebBrowser-
>SetParentURIContentListener(NS_STATIC_CAST(nsIURIContentListener *,
this));
............................
if (mWebBrowser)
{
nsCOMPtr<nsIWebNavigation> webNav =
do_QueryInterface(mWebBrowser);
if (webNav)
{
return webNav->LoadURI(aURI,
nsIWebNavigation::LOAD_FLAGS_NONE,
nsnull,
nsnull,
nsnull);
}
}
Is there something specific that I need to do to make sure that I can
interact with the resulting web page?
Thanks in advance.
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding