Skip to content

Fix mobile PDF loading on older WebViews#446

Open
codedogQBY wants to merge 1 commit into
mainfrom
codex/fix-mobile-pdf-withresolvers
Open

Fix mobile PDF loading on older WebViews#446
codedogQBY wants to merge 1 commit into
mainfrom
codex/fix-mobile-pdf-withresolvers

Conversation

@codedogQBY

@codedogQBY codedogQBY commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Analysis

Mobile PDF loading can fail before the reader UI finishes initializing on older Android/Harmony WebViews because the bundled PDF reader path expects Promise.withResolvers. Issues #128 and #271 both show the same runtime error: TypeError: Promise.withResolvers is not a function.

The reader bundle is generated into reader.html, so the compatibility shim has to run before the foliate/pdf bundle executes.

Changes

  • Add a small Promise.withResolvers polyfill in reader.template.html before the bundled reader insertion point.
  • Rebuild reader.html so Expo ships the generated asset with the same early polyfill.

Verification

  • pnpm --filter @readany/app-expo run build:reader
  • pnpm --filter @readany/app-expo exec tsc --noEmit
  • Verified the polyfill appears before the foliate/pdf bundle in both reader.template.html and generated reader.html.
  • git diff --check

Fixes #128
Fixes #271
Fixes #311

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant