打包一个 HTML5 应用程序并将其部署在桌面上

Pack an HTML5 app and deploy it on the desktop(打包一个 HTML5 应用程序并将其部署在桌面上)

本文介绍了打包一个 HTML5 应用程序并将其部署在桌面上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了大量文章和 stackoverflow 问题,但我似乎无法解决问题.

I have read tons of articles and stackoverflow questions but I seem not get it to work.

我想为客户分发一些产品信息,这些信息将通过 CD 或 U 盘发送.回到我用 Flash 做的那些日子.因为flash可以编译成一个叫做Flash投影仪的EXE,不用安装就可以运行我的Flash内容.

I want to distribute some product information for a customer which will be send out on a CD or USB stick. Back in the days I did it with Flash. Because flash could compile into a EXE called Flash projector and could run my Flash content without installation.

现在我想尝试一下 HTML5.我需要一种将所有内容打包到 CD 上的方法,使其无需安装即可随处运行.

Now I want to give HTML5 a spin. And I need a way to pack everything on a CD an make it run everywhere without installation.

我听说我可以编译 Chromium 并将其嵌入到 C++ 应用程序中.(http://code.google.com/p/chromiumembedded/)我可以在 QtWebkit 中使用 QT.(http://developer.qt.nokia.com/doc/qt-4.8/qtwebkit.html)我可以编译 Webkit 并将其嵌入到 C++ 应用程序中...(http://www.webkit.org/)

I heard something that I could compile chromium and embed it in a c++ application. (http://code.google.com/p/chromiumembedded/) I could use QT with QtWebkit. (http://developer.qt.nokia.com/doc/qt-4.8/qtwebkit.html) I could compile Webkit and embed it in a c++ application... (http://www.webkit.org/)

示例太大了,我没有任何 C++ 技能 =(

The examples are to big and I do not have any C++ skills =(

然后还有像 mozilla chromeless (http://mozillalabs.com/chromeless)(和 berkelium (https://github.com/sirikata/berkelium))这样的项目

Then there are projects like mozilla chromeless (http://mozillalabs.com/chromeless) (and berkelium (https://github.com/sirikata/berkelium)

使用 chromeless 我的 JQuery Javascript 不起作用,而 Berkelium ......我没有编译......

With chromeless my JQuery Javascript did not work and Berkelium... I did not get to compile...

我没有 http://www.appcelerator.com/ 或其他付费/商业选项的预算......(还有Flash/Air 和 Silverlight 不是一个选项).因为 Content 也应该部署在 web 服务器上,而不使用插件......

I have no budget for http://www.appcelerator.com/ or other paid/commercial options... (also Flash/Air and Silverlight are not an option). Because Content should also be deployed on the web server without the use of plugins ...

我不需要对操作系统的任何访问权限.我想要的是我的 Jquery/Backbone 应用程序,它使用 JSON 文件在桌面客户端中运行而无需安装.

I do not need any access to the OS. What I want have my Jquery/Backbone app which consumes JSON files to run in a desktop client without installation.

所以没有浏览器地址栏只是拾取 index.html 而其他一切都由应用程序处理......像全屏和关闭这样的东西会很好......

So no browser adressbar just pickup the index.html and everything else is handled by the app... Something like Fullscreen and Close would be nice...

不幸的是,我不能依赖已安装的customers OS"浏览器,因为目标群体太大,我希望有很多旧浏览器.

Unfortunately I cannot rely on the installed browser of the "customers OS" because the target group is to large and I expect alot of old browsers.

谁能告诉我如何轻松"编译一个应用程序,使我的 Web 应用程序可以从 CD 在桌面上运行而没有安全警告等?

Can anyone give me instruction how to compile "easily" an app which makes my web app stuff running on the desktop from CD without security warnings, etc?

或者是否有任何我可以使用的预编译包?

Or are there any pre-compiled packeges that I could use?

推荐答案

Node-webkit 结合了 Chromium (Chrome) 浏览器和 Node.js.据我了解,您不需要额外的 API,但也不需要使用它们,只需创建一个非常短的 json 文件并压缩您的项目就足够了,您甚至可以将所有内容组合成一个可执行文件.该项目提供二进制文件,因此无需编译.

Node-webkit combines the Chromium (Chrome) browser with Node.js. As I understand it, you don't need the extra APIs, but you don't need to use them, simply creating a really short json file and zipping up your project is enough, and you can even combine everything into a single executable. The project provides binaries, so no compiling needed.

https://github.com/rogerwang/node-webkit

这篇关于打包一个 HTML5 应用程序并将其部署在桌面上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:打包一个 HTML5 应用程序并将其部署在桌面上

基础教程推荐