项目简介
Ladybird 是一款真正独立的网页浏览器,采用基于 Web 标准的新型引擎。它使用多进程架构,渲染进程沙箱隔离,图像解码与网络请求均在进程外进行,并继承 SerenityOS 的 LibWeb、LibJS 等组件。目前处于预 Alpha 阶段,支持 Linux、macOS、Windows(WSL2) 等平台。
README 预览
# Ladybird\n\n[Ladybird](https://ladybird.org) is a truly independent web browser, using a novel engine based on web standards.\n\n> [!IMPORTANT]\n> Ladybird is in a pre-alpha state, and only suitable for use by developers\n>\n\n## Features\n\nWe aim to build a complete, usable browser for the modern web.\n\nLadybird uses a multi-process architecture with a main UI process, several WebContent renderer processes,\nan ImageDecoder process, and a RequestServer process.\n\nImage decoding and network connections are done out of process to be more robust against malicious content.\nEach tab has its own renderer process, which is sandboxed from the rest of the system.\n\nAt the moment, many core library support components are inherited from SerenityOS:\n\n- LibWeb: Web rendering engine\n- LibJS: JavaScript engine\n- LibWasm: WebAssembly implementation\n- LibCrypto/LibTLS: Cryptography primitives and Transport Layer Security\n- LibHTTP: HTTP/1.1 client\n- LibGfx: 2D Graphics Library, Image Decoding and Rendering\n- LibUnicode: Unicode and locale support\n- LibMedia: Audio and video playback\n- LibCore: Event loop, OS abstraction layer\n- LibIPC: Inter-process communication\n\n## How do I build and run this?\n\nSee [build instructions](Documentation/BuildInstructionsLadybird.md) for information on how to build Ladybird.\n\nLadybird runs on Linux, macOS, Windows (with WSL2), and many other \*Nixes.\n\n## How do I read the documentation?\n\nCode-related documentation can be found in the [documentation](Documentation/) folder.\n\n## Get in touch and participate!\n\nJoin [our Discord server](https://discord.gg/nvfjVJ4Svh) to participate in issue and development discussions.\n\nPlease read [Getting involved with Ladybird](Documentation/GettingStartedContributing.md) if you're new to Ladybird and want to help.\n\nBefore opening an issue, please see the [issue policy](CONTRIBUTING.md#issue-policy) and the [detailed issue-reporting guidelines](ISSUES.md).\n\nThe project participatio
常见问题 (5)
故障排除如何修复 Ladybird RequestServer 在启动时崩溃并提示 "database disk image is malformed" 的问题?
HTTP 磁盘缓存数据库已损坏。请关闭 Ladybird,然后删除缓存目录并重启:
rm -rf ~/.cache/Ladybird
如果您设置了自定义缓存位置,请改为删除 $XDG_CACHE_HOME/Ladybird。Ladybird 会自动重建缓存。无需删除 ~/.config/Ladybird,因为该目录存储的是配置信息,而非磁盘缓存。
较新构建中的代码修复会传播 CacheIndex 初始化错误,而不会导致 RequestServer 崩溃,但清除损坏的缓存仍是目前的即时变通方案。
故障排除为什么在使用 Pi-hole 或自定义 DNS 服务器时,Ladybird 在首次加载页面后显示 "Unable to resolve host"?
这是由 Ladybird 缓存中残留的过期 DNS 地址记录导致的。当 TTL 非常短时,A/AAAA 记录可能会在父级 CNAME 记录仍被缓存期间过期,因此后续查询会跟随 CNAME,却找不到可用的 IP 地址。修复方法是 LibDNS/RequestServer 中标题为 "Forget about fully expired RRs" 的更改(修复了 issue #12215)。请将 Ladybird 更新到包含该修复的构建版本并重新构建,例如运行 git pull && ./Meta/ladybird.py run。作为临时解决方法,请前往 about:settings → Network,从 Custom DNS 切换为系统/默认解析器,然后重启 Ladybird。
故障排除如何修复 Intl.NumberFormat.formatRangeToParts 接收空数组时 Ladybird 在 ICU.h:104 处触发的 SIGILL 错误?
此崩溃由 Intl.NumberFormat().formatRangeToParts(0, []) 触发。Ladybird 将空数组传递给 ICU 进行十进制转换,ICU 返回 U_DECIMAL_NUMBER_SYNTAX_ERROR,随后 ICU.h:104 中的 verify_icu_success() 以 SIGILL 中止,而不是产生 JavaScript 层面的完成结果。
修复方法:将 Ladybird 更新/重新构建到包含 PR "LibUnicode+LibJS: Throw instead of aborting on Intl input ICU refuses." 的版本。该补丁可防止无效的 ICU 输入导致原生运行时崩溃。
受影响版本上的变通方法:在调用 API 之前将两个端点都转换为 JavaScript 数字,因为 Number([]) 等于 0:
const nf = new Intl.NumberFormat();
nf.formatRangeToParts(Number(0), Number([]));
或者使用包装函数:
function safeFormatRangeToParts(nf, start, end) {
return nf.formatRangeToParts(Number(start), Number(end));
}
不要直接向受影响的 Ladybird 版本传递数组或其他非原始类型的端点。
故障排除如何修复 Ladybird 在 DevTools 断开连接时因 VERIFY(m_devtools_client_count > 0) 而崩溃的问题?
此崩溃发生的原因是 DevTools 客户端状态可能与标签页的当前页面失去同步,尤其是在将 DevTools 附加到 mail.google.com 等页面时。该问题已通过 LibWebView/LibWeb 的更改得到修复,该更改可使 DevTools 状态与标签页的页面保持同步。请将 Ladybird 升级到包含该修复的发布版本或构建版本。作为 Ladybird 1.0 上的临时解决方法,请避免在受影响的标签页上附加 DevTools 或反复断开 DevTools 连接,并在崩溃后重启 Ladybird。
故障排除为什么 Ladybird 中 YouTube 长评论缺少"阅读更多"按钮?
这是由 Ladybird 旧的 -webkit-line-clamp 实现导致的:被截断的内容未被包含在可滚动溢出区域中,因此 scrollHeight 错误地返回了与 clientHeight 相同的值。YouTube 使用这些值来检测被截断的评论,因此它认为没有内容可展开,便隐藏了"Read more"按钮。控制台中的 Battery Status API 错误与此无关。修复方法是 LibWeb 的变更"Keep clamped -webkit-line-clamp content in scrollable overflow",它会像 Firefox 那样对隐藏的被截断内容进行布局和测量。将 Ladybird 更新到包含该 PR 的构建版本并重新构建。作为临时解决方案,请在 Firefox 或其他浏览器中打开该视频/评论。