使用Javascript和HTML进行桌面应用程序开发 [英] Desktop application development with Javascript and HTML

查看:193
本文介绍了使用Javascript和HTML进行桌面应用程序开发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找使用HTML和JavaScript进行桌面应用程序开发的Titanium Appcelerator替代品。我想将Web应用程序转换为桌面应用程序。因此,将有很多服务器交互。 Appcelerator是一个不错的选择,但看起来该公司不再对Desktop SDK感兴趣。此外,来自Appcelerator的ajax请求不保留cookie。



我读到Adobe Air可以用于桌面应用程序开发,但我不想使用flash。 / p>

XULRunner有多好?它会允许像Growl notificaiton和创建托盘图标这样的功能吗?



我能用Qt中的Javascript和HTML开发应用程序吗?

解决方案

我开始研究Titanium for desktop dev。我喜欢这个概念,但不喜欢实现。然后我偶然发现了chromiumembedded并且对它非常满意。它基本上是基于铬的Web浏览器控件。
http://code.google.com/p/chromiumembedded/



它是用C ++编写的,因此您可以在容器应用程序中执行所需的所有低级操作系统(Growl,托盘图标,本地文件访问,COM端口等),以及然后所有的应用程序逻辑和gui在html / javascript中。它允许您拦截任何http请求以提供本地资源或执行一些自定义操作。例如, http://localapp.com/SetTrayIconState?state=active 的请求可能是被容器截获,然后调用C ++函数更新托盘图标。



它还允许您创建可以直接从javascript调用的函数。



我最大的挑战是贬值。在CEF中直接调试javascript非常困难。我所知道的Firebug并不支持。


I am looking for Titanium Appcelerator alternatives for Desktop application development with HTML and JavaScript. I want to convert a web app to a desktop application. Hence, there will be a lot of server interaction. Appcelerator was a good choice, but it looks like the company is no longer interested in the Desktop SDK. Also, ajax request from Appcelerator does not retain cookies.

I read that Adobe Air can be used for desktop app development, but I don't want to use flash.

How good is XULRunner? Will it allow features like Growl notificaiton and creating tray icons?

Will I be able to develop applications using mostly Javascript and HTML in Qt?

解决方案

I started looking into Titanium for desktop dev. I liked the concept but not the implementation. I then stumbled upon chromiumembedded and have been mostly very happy with it. It's basically a web browser control based on chromium. http://code.google.com/p/chromiumembedded/

It's written in C++ so you can do all the low level OS stuff you want(Growl, tray icons, local file access, com ports, etc) in your container app, and then all the application logic and gui in html/javascript. It allows you to intercept any http request to either serve local resources or perform some custom action. For example, a request to http://localapp.com/SetTrayIconState?state=active could be intercepted by the container and then call the C++ function to update the tray icon.

It also allows you to create functions that can be called directly from javascript.

My biggest challenge has been debuging. It's very difficult to debug javascript directly in CEF. There's no support for anything like Firebug that I am aware of.

这篇关于使用Javascript和HTML进行桌面应用程序开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆