Repository navigation
fix(mobile): load iOS device streams over HTTP on Android - #14284
Merged
juliusmarminge merged 5 commits intoOct 19, 2026
Merged
Conversation
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This focused mobile bug fix changes only the WebView origin selection needed for Android to display HTTP iOS simulator streams, while preserving existing Android-target and iOS-viewer behavior. The small helper and targeted tests make the bounded runtime impact clear. You can add or adjust custom eligibility rules. Learn more. |
5 tasks
Member
|
Taking over this one. I'll resolve the conflict with main, rebuild the origin selection to the smallest form, and push to this branch. |
…-http-origin # Conflicts: # apps/mobile/src/features/devices/DeviceStreamWebView.tsx
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Problem
On the Android app, opening an iOS simulator's device preview against a plain-http environment (LAN or Tailscale IP, the common case) ended with "Could not receive the device stream. Reconnect to try again." The same simulator streamed fine in the desktop app.
The Android WebView loaded the inline stream document under a synthetic
https://localhost/origin for every target so WebCodecs (used for Android emulator targets) has a secure context. iOS targets stream an MJPEG<img>and aws://input socket from the environment instead, and the https document blocks those as mixed content even withmixedContentMode="always".Change
deviceStreamBaseUrlinapps/mobile/src/features/devices/device-stream-document.tspicks the document origin:http://host:port/), so MJPEG and input are same-origin.https://localhost/, unchanged, for WebCodecs.file:///, unchanged.Stream URLs, transport selection, and auth (
wsTicketquery) are unchanged. The environment origin is not a secure context over http, which is fine because iOS targets never use WebCodecs on mobile. TheonShouldStartLoadWithRequestguard still compares against the exact base URL string, which works for the origin form.Unchanged and not re-checked here: Android emulator targets on an http environment keep the
https://localhost/document with aws://socket. If that combination has a mixed-content problem of its own, it predates this PR.Maintainer takeover
Taken over from @akhial, who diagnosed the mixed-content cause and verified the fix on a native Android build. Their helper and wiring are kept. The three test tables were folded into one table-driven case in the existing test file, the helper's viewer parameter is typed as
PlatformOSType, andmainwas merged in (the WebView source object is now a plain object per the React Compiler change on main).Verification
pnpm test src/features/devices/device-stream-document.test.tsinapps/mobile: 22 passed. The two Android-viewer iOS-target rows fail without the fix.pnpm typecheckandpnpm vp lint src/features/devicesinapps/mobilepass.Native app recording: touch input and Home (by the original author)
Model: Claude Fable 5.1 (takeover), GPT-6-Astra (original). Harness: Claude Code in T3 Code.