Babele Dunnit wrote:
...OK, I give up. What should I implement to open and render a PDF in-
place in an embedded Firefox window? I have some partially working
code, but I am doing something wrong and the PDF stops loading... some
pointer to relevant code would be highly appreciated :)
Thanks!
This worked for me without anything special. So did loading youtube
pages with flash animations. I did use --enable-plugins in my .mozconfig
file when compiling xulrunner SDK from mozilla 1.9.1 sources for
Firefox, but I would not say this is the key to it. I would rather think
that having Firefox with the add-on installed was the thing that helped.
If not look for a file called nsnull.* in the SDK and try to put the pdf
plugin there. Not sure about the Adobe license for doing that, though,
so you should check it.
After instantiating the nsIWebBrowser with
nsresult rv = NS_OK;
pWebBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID, &rv);
you should also get the nsIWebBrowserSetup interface on it and set the
ALLOW_PLUGINGS flag (and others) to PR_TRUE, like:
nsCOMPtr<nsIWebBrowserSetup>
pWebBrowserSetup = do_QueryInterface(pWebBrowser, &rv);
check_nsresult
( // this is one of my own functions :)
rv,
"Query Web Browser object for the Web Navigation "
"interface failed."
);
if (pWebBrowserSetup)
{
pWebBrowserSetup->SetProperty(nsIWebBrowserSetup::SETUP_ALLOW_PLUGINS,
PR_TRUE);
pWebBrowserSetup->SetProperty(nsIWebBrowserSetup::SETUP_ALLOW_JAVASCRIPT,
PR_TRUE);
pWebBrowserSetup->SetProperty(nsIWebBrowserSetup::SETUP_ALLOW_META_REDIRECTS,
PR_TRUE);
pWebBrowserSetup->SetProperty(nsIWebBrowserSetup::SETUP_ALLOW_SUBFRAMES,
PR_TRUE);
pWebBrowserSetup->SetProperty(nsIWebBrowserSetup::SETUP_ALLOW_IMAGES,
PR_TRUE);
pWebBrowserSetup->SetProperty(nsIWebBrowserSetup::SETUP_USE_GLOBAL_HISTORY,
PR_FALSE);
// ??
pWebBrowserSetup->SetProperty(nsIWebBrowserSetup::SETUP_IS_CHROME_WRAPPER,
PR_FALSE);
}
Hope that helps,
Timothy Madden
# Use objdir to build in a separate directory from the sources
mk_add_options moz_objd...@topsrcdir@/obj-x86-d...@config_guess@
# Build the browser application (Firefox) and xulrunner runtime
# for embedding
mk_add_options MOZ_BUILD_PROJECTS="xulrunner browser"
mk_add_options MOZ_CO_PROJECT="xulrunner browser"
ac_add_app_options xulrunner --enable-application=xulrunner
ac_add_app_options browser --enable-application=browser
# Enable debug-only code
ac_add_options --enable-debug
ac_add_options --disable-optimize
# Disable test applications
ac_add_options --disable-tests
# Enable accessiblity
ac_add_options --enable-accessibility
# Enable cryptography for SSL, SMIME
ac_add_options --enable-crypto
# Enable features/support
ac_add_options --enable-mathml
ac_add_options --enable-svg
ac_add_options --enable-plugins
ac_add_options --enable-activex
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding