-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Description
Summary
Visiting https://www.reddit.com/ crashes the WebContent process. The crash is triggered by Google reCAPTCHA calling the unimplemented navigator.getBattery() API, which throws an unhandled TypeError in a promise, ultimately crashing the tab process.
Operating system
macOS
Steps to reproduce
- Launch Ladybird
- Navigate to https://www.reddit.com/
- Wait ~10 seconds for the page to load and reCAPTCHA to initialise
Expected behavior
Either:
navigator.getBattery()returns a rejected promise with aNotSupportedError(spec-compliant stub), or- The unhandled promise rejection is handled gracefully without crashing the WebContent process
Actual behavior
The WebContent process crashes with the following log output:
WebContent: [TypeError] Battery Status API is not yet implemented
at <unknown>
at <unknown>
at https://www.gstatic.com/recaptcha/releases/P8cyHPrXODVy7ASorEhMUv3P/recaptcha__en.js:157:417
at <unknown>
at https://www.gstatic.com/recaptcha/releases/P8cyHPrXODVy7ASorEhMUv3P/recaptcha__en.js:1639:102
at https://www.gstatic.com/recaptcha/releases/P8cyHPrXODVy7ASorEhMUv3P/recaptcha__en.js:1633:278
at https://www.gstatic.com/recaptcha/releases/P8cyHPrXODVy7ASorEhMUv3P/recaptcha__en.js:583:368
at <unknown>
at OO (https://www.gstatic.com/recaptcha/releases/P8cyHPrXODVy7ASorEhMUv3P/recaptcha__en.js:1187:348)
...
Ladybird: WebContent process crashed! Last page loaded: https://www.reddit.com/
Ladybird: Consider raising an issue at https://github.com/LadybirdBrowser/ladybird/issues/new/choose
Reduced test case
Minimal HTML reproduction:
<!DOCTYPE html>
<html><body>
<script>
navigator.getBattery().then(b => console.log(b));
</script>
</body></html>Log output
WebContent(78620): FIXME: Unimplemented Navigator.maxTouchPoints
WebContent(78620): Potential FIXME: Returning from PerformanceObserver::observe() as we don't support the PerformanceEntry type 'navigation'
WebContent(78620): Potential FIXME: Returning from PerformanceObserver::observe() as we don't support the PerformanceEntry type 'longtask'
WebContent(78620): FIXME: Unimplemented IDL interface: 'StorageManagerPrototype.estimate'
WebContent(78620): [Unhandled JavaScript exception (in promise):] [TypeError] Battery Status API is not yet implemented
at <unknown>
at <unknown>
at https://www.gstatic.com/recaptcha/releases/P8cyHPrXODVy7ASorEhMUv3P/recaptcha__en.js:157:417
at <unknown>
at https://www.gstatic.com/recaptcha/releases/P8cyHPrXODVy7ASorEhMUv3P/recaptcha__en.js:1639:102
at https://www.gstatic.com/recaptcha/releases/P8cyHPrXODVy7ASorEhMUv3P/recaptcha__en.js:1633:278
at https://www.gstatic.com/recaptcha/releases/P8cyHPrXODVy7ASorEhMUv3P/recaptcha__en.js:583:368
at <unknown>
at OO (https://www.gstatic.com/recaptcha/releases/P8cyHPrXODVy7ASorEhMUv3P/recaptcha__en.js:1187:348)
at https://www.gstatic.com/recaptcha/releases/P8cyHPrXODVy7ASorEhMUv3P/recaptcha__en.js:673:472
at <unknown>
at https://www.gstatic.com/recaptcha/releases/P8cyHPrXODVy7ASorEhMUv3P/recaptcha__en.js:1638:229
at <unknown>
at run (https://www.gstatic.com/recaptcha/releases/P8cyHPrXODVy7ASorEhMUv3P/recaptcha__en.js:538:154)
at <unknown>
Ladybird(75723): WebContent process crashed! Last page loaded: https://www.reddit.com/
Build info
- Commit:
4b47245e99615433ed4ba046d77bf38b0947ccff - Platform: macOS (arm64 / Apple Silicon)
- Build type: Release (default
./Meta/ladybird.py run)
Notes
There are two separate issues here that together cause the crash:
navigator.getBattery()is unimplemented — the Battery Status API (W3C spec) should at minimum return a rejected promise rather than throwing aTypeErrorthat propagates as an unhandled rejection.- An unhandled promise rejection from third-party script (reCAPTCHA) is causing the entire WebContent process to crash, rather than being logged and discarded. This seems like the more critical robustness issue — unhandled rejections in untrusted page scripts should not be fatal to the process.
Reddit is a very high-traffic site. Fixing either of these would unblock it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels