Repository navigation
Let inline-vis frames load in the iOS shell WebView - #5988
Merged
Merged
Conversation
The shell WebView used react-native-webview's default originWhitelist, which cancels about:srcdoc, blob: and data: subframes before onShouldStartLoadWithRequest runs. Pass a whitelist that admits the page-local protocols allowsSubframeLoad already accepts. Fixes get-bb#5986
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Human comments
What was wrong
The iOS shell's WebView never set
originWhitelist, so react-native-webview 13.16.1 used its default (about:blank,http://*,https://*). ItscreateOnShouldStartLoadWithRequestcancels any load that misses the whitelist before it calls the app'sonShouldStartLoadWithRequest. inline-vis renders into<iframe srcDoc>, which loadsabout:srcdoc, so every inline-vis page in the iOS app stayed a blank 224px frame. Theabout:/blob:/data:subframe allowance from #5508 (allowsSubframeLoad) was never reached. Details and reproduction in #5986.What changed
apps/mobile/src/lib/shell/shell-save-file.ts: exportSHELL_ORIGIN_WHITELIST, http(s) plus the page-local protocolsallowsSubframeLoadalready accepts, built from the sameSUBFRAME_LOCAL_PROTOCOLSset.ProfileWebViewScreenpasses it asoriginWhitelist, so those loads reach the existingonShouldStartLoadWithRequest, which still decides what loads. Top-frameabout:/blob:/data:navigations now reach that handler too instead of react-native-webview'sLinking.canOpenURLfallback. The handler returns false for them, as before.How you verified
shell-save-file.test.ts: every URLallowsSubframeLoadaccepts (about:srcdoc,blob:,data:, same-origin https) passes react-native-webview's whitelist matching withSHELL_ORIGIN_WHITELIST, andabout:srcdocfails it with the default list. The new tests do not compile or pass without the change.pnpm exec turbo run test --filter=@bb/mobileon this branch: 46 files, 343 tests pass.turbo run test typecheck lint --filter=@bb/mobilepassed with the same change on an older base (5b34962ab6). On this branchtypecheckcould not run locally becausetsrsis not installed in my checkout.linthas no errors, andoxfmt --checkis clean for the changed files.npx expo run:ios --configuration Release --no-bundler) connected to a local server. Before the change, a fencedinline-visblock and a thread-storage::inline-visdirective were blank 224px frames. After it, both render inside the message. I did not run the Maestro flows.Fixes #5986