fix(Comix): restore chapter fetch blocked by Cloudflare in WebView#213
Closed
acepilot147 wants to merge 1 commit into
Closed
fix(Comix): restore chapter fetch blocked by Cloudflare in WebView#213acepilot147 wants to merge 1 commit into
acepilot147 wants to merge 1 commit into
Conversation
- executeInWebView runs under a macOS-Safari User-Agent, but cf_clearance is issued for the iPad app UA, so the WebView's own resource loads (main.js) and the SPA's API requests were rejected by Cloudflare and the chapter list never loaded. executeInWebView exposes no User-Agent option, so read the WebView's UA once and reuse it for both native requests (interceptRequest) and the Cloudflare challenge (CloudflareError), binding cf_clearance to the identity the WebView actually uses. - Fix the chapter page-size rewrite: the "$1100" replacement string is mis-parsed (the $1 backreference swallows the following digits), turning page=1&limit=20 into page=1100 (an out-of-range page) and returning zero chapters. Use a function replacement instead. Assisted-by: Claude Code:claude-opus-4-8
9 tasks
acepilot147
added a commit
to acepilot147/general-extensions
that referenced
this pull request
Jun 12, 2026
…lpha.91) Replace the WebView User-Agent workaround (rejected in inkdex#213) with the first-class alpha.91 APIs: set source.userAgent so the WebView runs under the app's default UA that cf_clearance is bound to, and adopt cloudflareBypassCompleted in place of the deprecated saveCloudflareBypassCookies. Bump @paperback/toolchain and @paperback/types to 1.0.0-alpha.91. Also fix the chapter page-size rewrite: the "$1100" replacement string is mis-parsed (the $1 backreference swallows the trailing digits), turning limit=20 into page=1100 and returning zero chapters; use a function replacement. Assisted-by: Claude Code:claude-opus-4-8
acepilot147
added a commit
to acepilot147/general-extensions
that referenced
this pull request
Jun 12, 2026
…lpha.91) Replace the WebView User-Agent workaround (rejected in inkdex#213) with the first-class alpha.91 APIs: set source.userAgent so the WebView runs under the app's default UA that cf_clearance is bound to, and adopt cloudflareBypassCompleted in place of the deprecated saveCloudflareBypassCookies. Bump @paperback/toolchain and @paperback/types to 1.0.0-alpha.91. Also fix the chapter page-size rewrite: the "$1100" replacement string is mis-parsed (the $1 backreference swallows the trailing digits), turning limit=20 into page=1100 and returning zero chapters; use a function replacement. Assisted-by: Claude Code:claude-opus-4-8
niclimcy
pushed a commit
that referenced
this pull request
Jun 13, 2026
…lpha.91) Replace the WebView User-Agent workaround (rejected in #213) with the first-class alpha.91 APIs: set source.userAgent so the WebView runs under the app's default UA that cf_clearance is bound to, and adopt cloudflareBypassCompleted in place of the deprecated saveCloudflareBypassCookies. Bump @paperback/toolchain and @paperback/types to 1.0.0-alpha.91. Also fix the chapter page-size rewrite: the "$1100" replacement string is mis-parsed (the $1 backreference swallows the trailing digits), turning limit=20 into page=1100 and returning zero chapters; use a function replacement. Assisted-by: Claude Code:claude-opus-4-8
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.
Summary
Restores Comix chapter fetching, which was broken by Cloudflare. The WebView (
executeInWebView) runs under a macOS-Safari User-Agent whilecf_clearanceis issued for the iPad app UA, so the WebView's own bundle/API requests were rejected and the chapter list never loaded; sinceexecuteInWebViewhas no UA option, the extension now reads the WebView's UA once and reuses it for native requests and the Cloudflare challenge. Also fixes the page-size rewrite, where the"$1100"replacement string was mis-parsed into an out-of-rangepage=1100and returned zero chapters.Checklist
Making changes
For updates to existing extensions
versionvalue inpbconfig.tsfor each modified extension.For new extensions
npx paperback-cli test --generate EXTENSION_NAME.Testing changes
npm run conformancepasses.npm test -- EXTENSION_NAMEpasses.Committing changes
type(Scope): summary, e.g.fix(EXTENSION_NAME): ...).AI assistance
Pick one:
Assisted-by: AGENT_NAME:MODEL_VERSIONtrailer to each AI-assisted commit.