chromium 桌面_如何使用Chromium和PyInstaller将Web应用程序转换为桌面应用程序

chromium 桌面

Packaging and distributing your app sounds simple in principle. It’s just software. But in practice, it’s quite challenging.

打包和分发应用程序在原理上听起来很简单。 这只是软件。 但是在实践中,这非常具有挑战性。

I’ve been working on a Python module called Sofi that generates user interfaces. It can deliver a desktop feel while using standard single-page web technologies. For flexibility, I designed it to work through two methods of distribution: in-browser and executable.

我一直在研究一个名为Sofi的Python模块,该模块可生成用户界面。 使用标准单页Web技术时,它可以提供桌面感觉。 为了提高灵活性,我将其设计为通过两种分发方法进行工作:浏览器内和可执行文件。

Running in the browser, it functions much like a normal webpage. You can load it by opening a file, or launch it from your shell. I also built an executable that runs as a packaged app, independent and without external requirements.

它运行在浏览器中,功能类似于普通网页。 您可以通过打开文件来加载它,或者从您的Shell中启动它。 我还构建了一个可执行文件,该可执行文件作为打包的应用程序运行,独立且没有外部需求。

Over time, as I hacked at code in Atom — my editor of choice these days — I remembered that Atom is actually a browser. It uses Node.js as a back end, and the Electron framework for its user interface. This inspired me to start poking at Electron’s internals, hoping to find examples and best practices on how they solved desktop packaging.

随着时间的流逝,当我黑客攻击Atom(这是我如今的首选编辑器)中的代码时,我记得Atom实际上是一个浏览器。 它使用Node.js作为后端,并使用Electron框架作为其用户界面。 这启发了我开始研究Electron的内部结构,希望找到有关如何解决台式机包装的示例和最佳实践。

It didn’t take long for me to discover that it’s all built on top of free and open sourced technologies: the Chromium browser and the Chromium Embedded Framework. This featured easy-to-integrate example customizations that were capable of fulfilling my requirements.

我花了很长时间才发现它们全部建立在免费和开源技术之上:Chromium浏览器和Chromium嵌入式框架 。 这个功能具有易于集成的示例定制功能,可以满足我的要求。

With all this in hand, I got to work.

有了这些,我就可以工作了。

Chromium嵌入式框架 (The Chromium Embedded Framework)

Chromium is the base code that feeds Google’s Chrome browser. It brings together all the elements that render an interface, process user input, and script its functions.

Chromium是Google Chrome浏览器的基本代码。 它汇集了呈现界面,处理用户输入并编写其功能脚本的所有元素。

The Chromium Embedded Framework (CEF) is a group of C functions that that can control that browser. It also provides scripts that help simplify the process of building and compiling it.

Chromium嵌入式框架(CEF)是一组C函数,可以控制该浏览器。 它还提供了有助于简化构建和编译过程的脚本。

Visual Studio Code, Slack, Mattermost, Curse, Postman, and Kitematic are all examples of desktop apps that use Electron. These systems all qualify as websites that exploit the browser underneath with CEF.

Visual Studio Code,Slack,Mattermost,Curse,Postman和Kitematic都是

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值