将WebKit用于桌面应用程序 [英] Using WebKit for a desktop application

查看:148
本文介绍了将WebKit用于桌面应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用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用于桌面应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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