Skip to content

fix(weixin): wait for article content instead of DOM quietness - #2476

Draft
laybxc wants to merge 1 commit into
jackwener:mainfrom
laybxc:fix/weixin-drag-verification-detection
Draft

laybxc wants to merge 1 commit into
jackwener:mainfrom
laybxc:fix/weixin-drag-verification-detection

Conversation

@laybxc

@laybxc laybxc commented Sep 7, 2026

Copy link
Copy Markdown

Description

weixin download uses page.wait(5) before extraction. Numeric wait can return after just 500 ms of DOM quietness, allowing an empty loading shell to reach extraction before the article arrives.

Poll the same tab for a parsed document, an article URL, a title and non-empty #js_content (text or media). The adapter owns its single navigation, skipping the Official Account homepage. Extraction cleans a clone without modifying the live page, and metadata is extracted only once content is ready.

The readiness loop uses a 15-second budget after navigation. Browser requests retain their existing transport timeout and errors; there is no additional RPC timeout wrapper. An in-flight request can exceed the readiness budget, but a late response is neither downloaded nor followed by another probe.

Explicit verification interaction prompts retain the existing failure result. Other incomplete pages raise TIMEOUT; intermediate URLs and opaque iframes are not classified as verification failures. Pages may advance naturally while waiting, without refresh, URL rewriting or CAPTCHA interaction. Readiness means extractable content is present, not that all dynamically appended content or media have finished loading.

Related: #2045. This addresses premature extraction; it does not establish that the challenge in that report resolves without interaction. #1770's stdout work is separate.

Type of Change

  • 🐛 Bug fix

Checklist

  • I ran the checks relevant to this PR
  • I updated tests or docs if needed
  • I included output or screenshots when useful

Validation

  • Current revision: all 65 tests across four WeChat adapter test files pass, including delayed content, natural redirects, explicit interaction prompts, incomplete pages, late responses, transport errors, parsing state, media-only articles and download ordering.
  • Current revision: build, typecheck, silent-column-drop and typed-error gates pass.
  • Before this simplification, the full suite passed with an isolated OPENCLI_CONFIG_DIR: 632 files, 7336 tests passed, 1 skipped. The full suite was not rerun for this scoped simplification.
  • Current revision live check through the protected ego-lite route: the public article downloaded successfully (16.0 KB); Markdown title, metadata and body were read back.
  • Earlier live testing: a public short-link article downloaded successfully; the supplied long-parameter article remained verification-blocked and produced no Markdown. The change does not establish improved access success rates.

This remains a draft.

@laybxc
laybxc marked this pull request as draft September 7, 2026 14:03
@laybxc laybxc changed the title fix(weixin): detect drag and iframe verification pages fix(weixin): wait for article content instead of DOM quietness Sep 7, 2026
@laybxc
laybxc force-pushed the fix/weixin-drag-verification-detection branch from 4b6280b to 2b9e6ea Compare September 7, 2026 15:53
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.

1 participant