How to embed a web browser control in a cross-platform application?

不羁岁月 提交于 2019-11-30 09:41:57

Why not to use embedded Webkit?

QtWebkit:

The Qt port of WebKit currently compiles and runs on Linux (including Maemo), Windows, Mac OS X and Symbian.

Click here for build instructions.

A very simple test browser is built along with the port.

Since you have (assumption made from your post) .Net experience I'd go with Mono.

Have you considered Adobe AIR? http://www.adobe.com/products/air/

Mono is probably the best choice if you're primarily a .NET developer and don't care very much about making a well-integrated Mac app (one that behaves like a Mac app in all the many ways Mac users expect). Given your problem space, that sounds like where you are. That said, pay special attention to this limitation from the WebBrowser page if it applies to your problem:

The Mono Webbrowser currently lacks support for window.external, the bridge that allows Javascript code embedded in the browser to communicate with the managed world using the ObjectForScripting.

QT is very well established, and a great platform if you want to develop this in C++. Remember that there are licensing fees if this is a commercial app.

I've played a bit with wxWidgets. It's big advantage here is that it's probably going to be the smallest distribution, since you only have to include what you need. If all you need is the web browser, I'd look at this, but in my experience it's hard to make wxWidgets programs look good or act correctly on Mac (or on Windows for that matter).

Another option may be to write it as a Java app using the Eclipse Standard Widget Toolkit. This includes a browser control that embeds IE, Safari or Firefox, depending on the current platform, and generally behaves well on OS X.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!