本周项目:Beaker 浏览器
本周,我们采访了 Paul Frazee,他是 Beaker 浏览器 的创作者。Beaker 是一款实验性的点对点网络浏览器,使用 Dat 协议从用户的设备托管网站。
🌐 This week we caught up with Paul Frazee, creator of Beaker Browser. Beaker is an experimental peer-to-peer web browser that uses the Dat protocol to host sites from users’ devices.
什么是 Beaker?为什么创建它?
🌐 What is Beaker and why did you create it?
Beaker 是一个参与式浏览器。这是一个为独立开发者打造的浏览器。
🌐 Beaker is a participatory browser. It's a browser for indie hackers.
网络是封闭源代码的。如果你想影响社交媒体的运作方式,你必须在 Facebook 或 Twitter 工作。对于搜索,则是谷歌。控制权掌握在公司手中,而不是用户自己。
🌐 The Web is closed source. If you want to influence how social media works, you have to work at Facebook or Twitter. For search, Google. Control is in the hands of companies, rather than the users themselves.
使用 Beaker,我们有了一种新的网络协议:去中心化档案传输。“Dat”。它可以按需创建网站,免费提供,然后从设备上分享。无需服务器。这就是我们的创新。
🌐 With Beaker, we have a new Web protocol: the Decentralized Archive Transport. "Dat." It creates sites on demand, for free, and then shares them from the device. No servers required. That's our innovation.

当你在 Beaker 浏览 Dat 网站时,你会下载这些文件。这个网站属于你,永远属于你。你可以保存它、分支它、修改它,并免费分享你的新版本。所有内容都是开源的。
🌐 When you visit a Dat site in Beaker, you download the files. The site is yours, forever. You can save it, fork it, modify it, and share your new version for free. It's all open-source.
所以这就是它的目的:我们正在为开源网站打造一个浏览器。我们希望它成为一个社交黑客的工具包。
🌐 So that's what it's about: We're making a browser for open-source Websites. We want it to be a toolkit for social hacking.
谁应该使用 Beaker?
🌐 Who should be using Beaker?
黑客。修改者。有创造力的人。喜欢摆弄东西的人。
🌐 Hackers. Modders. Creative types. People who like to tinker.
如何创建一个使用 Dat 的新项目?
🌐 How do I create a new project that uses Dat?
我们有一个叫做 bkr 的命令行工具,有点像 git + npm。下面是创建一个网站的方法:
🌐 We've got a command-line tool called bkr that's kind of like git + npm. Here's creating a site:
$ cd ~/my-site
$ bkr init
$ echo "Hello, world!" > index.html
$ bkr publish
这是一个 fork 站点的示例:
🌐 And here's forking a site:
$ bkr fork dat://0ff7d4c7644d0aa19914247dc5dbf502d6a02ea89a5145e7b178d57db00504cd/ ~/my-fork
$ cd ~/my-fork
$ echo "My fork has no regard for the previous index.html!" > index.html
$ bkr publish
这些网站随后会通过你的浏览器进行托管。这有点像 BitTorrent;你在一个 P2P 网络中共享网站。
🌐 Those sites then get hosted out of your browser. It's a little like BitTorrent; you share the sites in a P2P mesh.
如果你想要一个图形界面,我们在浏览器中内置了一些基本工具,但我们正在把这些工具推向用户层。这些都将成为可修改的用户应用。
🌐 If you want a GUI, we have some basic tools built into the browser, but we're pushing those tools into userland. It's all going to be moddable user apps.
为什么选择在 Electron 上构建 Beaker?
🌐 Why did you choose to build Beaker on Electron?
对于这个项目来说,这很明显。如果我自己分叉 Chrome,我现在就得写 C++ 了!没人想做那种事。我了解 Web 技术栈,并且可以快速使用它工作。这毫无疑问。
🌐 It was obvious for this project. If I forked Chrome myself, I'd be writing C++ right now! Nobody wants to do that. I know the Web stack, and I can work quickly with it. It's a no-brainer.
说实话,我不确定没有 Electron 我能否完成这些。这是一款非常棒的软件。
🌐 The truth is, I'm not sure I could do any of this without Electron. It's a great piece of software.
你在构建 Beaker 时遇到了哪些挑战?
🌐 What are some challenges you've faced while building Beaker?
一半的时间都在研究工具,并弄清楚我能做多少。
🌐 Half of it is poking at the tools and figuring out how much I can get away with.
制作浏览器本身相当容易。Electron几乎就是一个用于制作浏览器的工具包……除了浏览器标签页;那个花了我很长时间才弄对。我最终崩溃了,去学习如何制作SVG。效果要好得多,但我花了三四次迭代才弄对。
🌐 Making the browser itself was pretty easy. Electron is practically a toolkit for making browsers. ...Except for the browser tabs; that took me forever to get right. I finally broke down and learned how to do SVGs. It's much better looking, but it took 3 or 4 iterations before I got that right.
Electron 应该在哪些方面改进?
🌐 In what areas should Electron be improved?
如果我能将开发者工具停靠在 Web 视图中就太好了。
🌐 It'd be really great if I could dock the devtools inside a webview.
Beaker 的下一步计划是什么?
🌐 What's coming next in Beaker?
为 Dat 站点提供安全的 DNS 名称。一个可社交配置的 URL 方案,称为“应用方案。” 更多 Dat API。
🌐 Secure DNS names for Dat sites. A socially configurable URL scheme, called the "app scheme." More Dat APIs.
对于可能有兴趣为项目做出贡献的人,Beaker 在哪些方面需要帮助?
🌐 For folks who may be interested in contributing to the project, in what areas does Beaker need help?
我们有很多未解决的问题。不要害怕联系我。在 freenode 的 #beakerbrowser。我们有一个贡献者页面,我们会把你加进去。如果你来奥斯汀,我请你喝一杯啤酒。
🌐 We have lots of open issues. Don't be afraid to ping me. #beakerbrowser on freenode. We keep a page for contributors and we'll add you to it. And if you visit Austin, I'll buy you a beer.
有哪些 Electron 开发技巧可能对其他开发者有用?
🌐 Any Electron tips that might be useful to other developers?
- 使用现有的构建工具。相信我,你不想自己去折腾解决方案。使用 electron-builder。使用模板仓库。
- 如果你需要在 Electron 仓库中提交一个问题,请尽量提供方便重现的问题步骤。这样你会更快得到回复,团队也会感激。更好的是,尝试自己修复它。看看其内部实现其实相当有趣。
- 请至少通读一遍所有指南和高级文档。
- 不要构建浏览器,这是一个饱和的市场。
