WebKit vs QtWebKit as an embedded browser - browser

I need an embedded browser in an application. I am thinking of either using WebKit and call it via some API or use QtWebKit.
I do not understand the difference between QtWebKit and WebKit.
does QtWebKit put some UI i.e. frame/window on top on WebKit?
I see that PhantomJS uses QtWebKit when it is being built.
Is there a way to use Chromium as an embedded browser?

Qt provides a cross platform UI framework similar to platform specific MFC (Windows). QtWebkit is Qt's port of WebKit web browser engine. This will mean that you will easily be able to use WebKit's functionality inside a Qt UI application which usually relies on signal/slot mechanism.
QtWebkit embeds Webkit and provides easy to use APIs for your application with the QWebView class. So, I suggest you use QWebView for browser functionality in your application. If interested integration internals, a QWebView::setUrl call, will fall through QWebView -> QWebPage -> QWebFrame -> QWebFrameAdapter to reach WebCore which is core renderer of WebKit. You can see that at QtWebkit github repo.
Pros
Integrating QtWebkit is far easier compared to directly integrating WebKit into your application. Unlike QWebView APIs, there will be no easy to use API's with WebKit. In addition you have to really familiar with WebKit for direction integration. Also note that WebKit project doesn't have releases. Only nightly builds, from which you have to choose from.
Also with QWebView, you will not have handles cases like drawing
combo box drop downs which WebKit leaves to the embedding
application.
Cons
Using QtWebkit, you will not get latest Webkit functionality as
it is released. You will have to wait it's port to QtWebkit.
You can use Qt's QtWebEngine class for using Chromium as embedded browser

Related

Can I integrate a native app in a web browser?

I need to display a native app (in my case, a video game built on unity) in a web browser page.
Local video and input streaming would be a solution, but video encoding is consuming too much computer resources.
Is there a way to display a native app in a web browser page?
Sure, you need to compile your application for WebAssembly. Or, to be more precise, cross-compile it, since WebAssembly binary code runs on a virtual stack machine.
You take your native code, compile it into a .wasm module, and then load that .wasm module with WebAssembly.instantiateStreaming().
There are many toolchains that can have WebAssembly as the compilation target. I think the 2 most popular ones are Emscripten and wasm-pack.
There is also wabt, but that is rather a set of lower level tools, not quite a toolchain.
And since you mentioned Unity, I have no experience with it, but there is some official documentation on WebAssembly.
Here is a game that was developed in C# and cross-compiled to WebAssembly.

JXcore vs Electron

question
I am wondering what the main differences are between Electron and JXcore.
background
I was thinking about how I could make a NodeJS server into an app and I came across both of these. They seem to do the same thing, except that JXcore supports mobile and Electron doesn't.
side question
If Electron doesn't support mobile then how was the slack mobile app created?
Thanks in advance!
From the JXCore site(http://jxcore.com/tech/):
JXcore is a fork on the open source Node.js project
It uses LLVM to compile javascript as opposed to V8 which NodeJS does.
In terms of what are the main differences- Electron is a framework for building native, cross platform desktop applications, where it appears JXCore is a javascript engine forked from NodeJS.
Electron is built with NodeJS, and Chromium. So to make it fair, the comparison would be better stated "How does Electron work with NodeJS vs JXcore". Since I don't have any experience with JXCore, I can't answer that question. I would venture to say the only way to know that is to fork electron and replace Node with JXCore.
Based on your background, I would assume you are thinking about making one application that works cross platform across mobile and desktop environments. To that, I would say it is possible, but you are going to have 2 different projects. There are things in Electron that you wouldn't want included in your mobile app, since they are working with completely different operating systems. You are right that electron does not support mobile (it wasn't built for that).
As far as your side question goes, there are any number of technologies that slack could have used to create their mobile app. They could have used Java , Swift, Objective-C, .NET, Ruby, or Javascript.
There are cross platform tools such as RubyMotion, NativeScript, React Native, and Xamarin that could also be used to create native mobile apps, that all compile down into the native language the mobile OS understands.
A final approach could be the use of tools such as Cordova/Phonegap which create mobile apps via a "web view". Essentially, this is like creating an app that launches a web browser to interact with your phone.
If you are looking for an example on how to build once and use everywhere, I would look at the github repo found here https://github.com/NathanWalker/angular-seed-advanced. This shows a common codebase that can be used in Electron, Web, and Mobile.

I try to make chart graph component, library . for web and desktop. what language most common?

I try to make chart graph component, library . for web and desktop. what language most common?
I try make very cheap chart, graph component. I worked for 3D engine programmer.
I always use C++ and my own library.
I want to make cheap library component for desktop application and web service.
which language is common for desktop developing?
what language and platform most use for web page chart?I hope there is no download at all. difficulty is not matter at all for me.
I've just completed a 3D chart library for the desktop, mobile and the web. I used Java for the desktop, wrote a native Android application (it's a Java-like platform, different API but same programming language), and Javascript (actually Dart compiled to Javascript) for the web. I didn't do a native iOS version. Those were my choices, I think it worked out well. Your mileage may vary.

Will Firefox OS support C libs?

I'm developing a cross-mobile platform framework using C as base. Then i will make some wrappers for each specific platform (like ios, android, bb). One of my targets platform is firefox-os. I de like to know if will be possible to use c libs in firefox-os, but i couldn't find anything about it.
If you look at the following Firefox OS architecture document it should answer your questions:
https://wiki.mozilla.org/B2G/Architecture
For example, under Gaia it says, "Its only interface to the underlying operating system is through Open Web APIs, which are implemented by Gecko." That means that Javascript is the only interface you have to lower-level calls provided they are available via the Open Web APIs.
A workaround would be compiling your C code to JavaScript with emscripten. Firefox will implement asmjs in the near future, so the compiled code will probably be very performant (since emscripten will target asmjs as output).

embedded browser using XULRunner

Are there any examples of to use XULRunner to embed the browser control inside a app? (preferably in c or c++ for native win32 apps)
I have tried QT, wxWidgets, Awesomium, chrome embedded, LLmozLib, midori and Embedding/NewApi/Win32
The best one is wxWebConnect (which is part of wxWidgets framework). Why, cause you don't need the whole mozilla code base to build it plus the actual browser control is perfect as in plugins work, everything is rendered correctly (gmail, youtube etc etc)
So what's my problem or question? Well the wxWebConnect uses XULRunner to embed the browser control, my application is native win32 app and not wxWidgets app. I've searched the net to find another example of how use XULRunner to embed the gecko browser in native win32 apps..without luck!
Anyone know of projects/code that just use XULRunner and not require the entire mozilla source tree?
Thanks.
There's a list of XULRunner-based applications at
https://developer.mozilla.org/en/XULRunner_Hall_of_Fame
Whether you use wxWebConnect or embed XULRunner directly you are still going to have as part of your applications deployment the XULRunner engine and it's folder hierarchy. That's the nature of the beast.
Try GeckoFX, if you are okay with using .NET. Looking at the GeckoFX code might also give you enough insights to embed xulrunner in your native C++ Win32 app.

Resources