[loop cycle 3] feat(calls): expose minimal window.chrome so WhatsApp enables call buttons#11
Merged
Conversation
…buttons
WhatsApp Web disables the voice/video call buttons unless it considers the environment
an eligible Chrome/Edge browser. The UA and navigator.userAgentData already report
Chrome 131, but the calling-eligibility check also probes for `window.chrome`, which
WebKitGTK does not expose — so the call buttons stay greyed even though this WebKitGTK
build (2.52) ships WebRTC and the app already enables it + auto-grants mic/camera.
Add a minimal, idempotent `window.chrome = { app:{isInstalled:false}, runtime:{} }`
stand-in (section 1b in bridge.js), matching what a real Chrome minimally exposes. It is
origin-guarded, wrapped in its own try/catch, and never clobbers a genuine window.chrome.
Verified in a real WebKitGTK engine (origin spoofed to web.whatsapp.com): window.chrome
becomes an object with runtime + app.isInstalled===false when absent; a pre-existing
window.chrome is preserved; the userAgentData and Notification shims are unaffected.
NOTE: whether the call button actually un-greys can only be confirmed on a logged-in
WhatsApp — see the PR's human-test gate. If it is still disabled, the next lever is
WebRTC codec availability (H264/VP8) in this WebKitGTK build (backlog C2).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016o9cWBaPy4zU4BAurUVoTp
karem505
added a commit
that referenced
this pull request
Jun 28, 2026
Bundles six loop-shipped fixes: - perf(dnd): stream dropped files as base64 to cut peak memory on large videos (#9) - fix(notifications): forward service-worker showNotification to the native toast (#10) - feat(calls): expose a minimal window.chrome so WhatsApp enables call buttons (#11) - fix(notifications): de-duplicate burst-repeated native toasts (#12) - fix(dnd): route AVIF/HEIF photos as photos; broaden MIME labels (#13) - fix(calls/capability): return a complete Chrome high-entropy client-hints set (#14) Plus integration: SW notifications share the dedup window; base64_encode is test-only now. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016o9cWBaPy4zU4BAurUVoTp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Targets "calls are not supported." WhatsApp Web disables the voice/video call buttons unless it judges the environment an eligible Chrome/Edge browser. The UA and
navigator.userAgentDataalready report Chrome 131, but the calling-eligibility check also probeswindow.chrome, which WebKitGTK doesn't expose — so the buttons stay greyed.Crucially, this is a detection gate, not a capability one: it was verified that this WebKitGTK build (2.52.3) ships WebRTC (libwebrtc codec symbols +
enable-webrtcpresent), and the app already enables it and auto-grants mic/camera (enable_webview_mediainwindow.rs). So the engine can do calls once WhatsApp considers it eligible.How
bridge.jssection 1b adds a minimal, idempotent stand-in:app.isInstalled:falseis exactly what a normal web page in real Chrome sees — it steers WhatsApp away from the Chrome-Apps path, not into it.runtime:{}satisfies atypeof chrome.runtimeprobe without exposing callable extension APIs.window.chrome.Verification
Gate 1 —
cargo build --locked+cargo test: PASS (51 tests).Gate 2 — real WebKitGTK engine harness (origin spoofed), two cases: PASS
window.chromebecomes an object withruntime+app.isInstalled===false; userAgentData (3 brands) + Notification shim intact.{__sentinel:"real"}) → sentinel preserved (no clobber); existing shims intact.Gate 3 — generation-blind code review: APPROVE, severity none, no must-fix. Confirmed the no-clobber guard, descriptor flags matching real Chrome, low regression risk (minimal stub avoids triggering extension/Chrome-App code paths), isolation, and idempotency.
⚠ Human-test gate (please confirm before merging)
The call button can't be exercised headlessly — it needs a logged-in WhatsApp. Before merging, please:
If the buttons are still disabled, this wasn't the (only) gate — the next lever is WebRTC codec availability (H264/VP8) in this WebKitGTK build, tracked as backlog C2. Either way this change is safe and reversible (it only adds a Chrome marker).
🤖 PR-ONLY — do not auto-merge. Releasing whatRust is manual via a
v*tag; this loop never merges, bumps the version, or tags a release. Opened by thewhatrust-fix-loop(cycle 3/6).