I need to build my application GUI using HTML/CSS/JavaScript with a C++ backend all cross platform. I made simple tests with QtWebKit, XULRunner and Mozilla.
Well from the simple testes I notice something that is very batters me and it is the deployment size of the browsers libs/framework. It's big: 8 MB and above.
Is there some kind of smaller embedded browser I missing?
I don't know about other platforms, but the smallest way to do it on Windows is by using the system built-in Web Browser Control. It's based on COM, which can be quite complicated to program for. Following code gets you a such a beast:
HWND htmlWindow = ::CreateWindowExA(
dwExStyle,
ATLAXWIN_CLASS,
"about:blank",
dwStyle,
x, y, w, h,
hwndParent,
NULL,
hInstance,
NULL
);
CAxWindow2 helperWindow;
helperWindow.Attach(htmlWindow);
CComPtr<IWebBrowser2> theWebBrowserControl;
HRESULT hr = helperWindow.QueryControl(&theWebBrowserControl);
The above code sample is the fruit of multiple weeks of painfully trying to understand this COM thing. Well, hope you find it useful somehow...
Note: above sample depends on ATL (not MFC).
I think dillo requires c calling conventions, but it might do for your needs. No javascript or flash, or or or, but it does support CSS.
On reading the question again, I see that you need javascript, which dillo does not currently support. Sorry.
I have a suggestion that might solve the problem:
On Windows use IE control and on Linux use Mozilla(which will probably be available as a dynamic library that you can load).
This will make your app the smallest it can be but you'll have to create a wrapper around IE/Mozilla to deal with them easily from code and your HTML/CSS/JS will have to be cross-browser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With