我需要使用CSS / HTML5 / JavaScript制作桌面应用程序。此应用程序应该跨平台工作(Linux / Mac / Windows),并将作为简单的可执行文件(而不是安装程序)进行分发,用户只需打开它即可立即开始使用它。它还需要在无法访问互联网的机器上脱机工作。
I need to make a desktop application using CSS/HTML5/JavaScript. This application should work cross-platform (Linux/Mac/Windows) and will be distributed as a simple executable (not an installer), where the user simply opens it and can start using it right away. It also needs to work offline, on machines where internet is not accessible.
所以我认为WebKit将是完美的选择。实际上我继续安装Xcode,并且在很短的时间内我有一个可执行文件打开一个窗口并加载了一些CSS / HTML / JavaScript。
So I thought WebKit would be the perfect choice. In fact I went ahead, installed Xcode, and in little time I had an executable that opened a window and loaded some CSS/HTML/JavaScript.
但是,我的问题是我没有Linux / Windows机器。我买不起Windows副本,我不想经历安装操作系统和安装Visual Studio或其他任何东西的努力,并试图为这些平台制作可执行文件。
However, my issue is that I don't have Linux/Windows machines. I can't afford buying a Windows copy and I don't want to go through the effort of having to install the OS and installing the Visual Studio or whatever thing, and trying to make an executable for those platforms as well.
我想知道WebKit附带的每个平台是否都有预构建的可执行文件。因此,我所要做的就是更改应用程序的图标,名称并告诉它在哪里获取html / css / javascript,它将为我需要的平台生成可执行文件。
I was wondering if there was a pre-built executable for each platform that comes with WebKit. So that all I have to do is change the icon of the application, the name and tell it where to get the html/css/javascript and it would make an executable for the platforms I need.
这可能吗?我最好的选择是什么?
Is this possible? What are my best alternatives?
推荐答案你可以使用 node-webkit 。
You can use node-webkit.
它使用webkit呈现网页并执行Javascript ,您将可以访问所有Node.js javascript API(读/写文件,...)
It uses webkit to render the webpage and execute the Javascript, and you will have access to all the Node.js javascript API (reading/writing files, …)
更多推荐
将WebKit用于桌面应用程序
发布评论