Skip to content

Let inline-vis frames load in the iOS shell WebView - #5988

Merged
ymichael merged 3 commits into
get-bb:mainfrom
Willhong:fix/ios-shell-srcdoc-frames-pr
Nov 3, 2026
Merged

ymichael merged 3 commits into
get-bb:mainfrom
Willhong:fix/ios-shell-srcdoc-frames-pr

Conversation

@Willhong

Copy link
Copy Markdown
Contributor

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://*). Its createOnShouldStartLoadWithRequest cancels any load that misses the whitelist before it calls the app's onShouldStartLoadWithRequest. inline-vis renders into <iframe srcDoc>, which loads about:srcdoc, so every inline-vis page in the iOS app stayed a blank 224px frame. The about:/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: export SHELL_ORIGIN_WHITELIST, http(s) plus the page-local protocols allowsSubframeLoad already accepts, built from the same SUBFRAME_LOCAL_PROTOCOLS set.
  • ProfileWebViewScreen passes it as originWhitelist, so those loads reach the existing onShouldStartLoadWithRequest, which still decides what loads. Top-frame about:/blob:/data: navigations now reach that handler too instead of react-native-webview's Linking.canOpenURL fallback. The handler returns false for them, as before.

How you verified

  • shell-save-file.test.ts: every URL allowsSubframeLoad accepts (about:srcdoc, blob:, data:, same-origin https) passes react-native-webview's whitelist matching with SHELL_ORIGIN_WHITELIST, and about:srcdoc fails it with the default list. The new tests do not compile or pass without the change.
  • pnpm exec turbo run test --filter=@bb/mobile on this branch: 46 files, 343 tests pass. turbo run test typecheck lint --filter=@bb/mobile passed with the same change on an older base (5b34962ab6). On this branch typecheck could not run locally because tsrs is not installed in my checkout. lint has no errors, and oxfmt --check is clean for the changed files.
  • iOS Simulator (iPhone 17 Pro, iOS 26.4), Release build (npx expo run:ios --configuration Release --no-bundler) connected to a local server. Before the change, a fenced inline-vis block and a thread-storage ::inline-vis directive were blank 224px frames. After it, both render inside the message. I did not run the Maestro flows.

Fixes #5986

AGENT GENERATED

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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T05:05:48.458951Z 6c04f81 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ymichael
ymichael merged commit cb262fa into get-bb:main Nov 3, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS app: inline-vis pages stay blank because the shell WebView blocks about:srcdoc frames

2 participants