将WebKit用于桌面应用程序

编程入门 行业动态 更新时间:2024-10-19 15:41:42
本文介绍了将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用于桌面应用程序

本文发布于:2023-11-07 15:09:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566784.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   桌面   WebKit

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!