Skip to content

Fix ExHentai image reload retries - #1327

Open
DolphinZZZZZ wants to merge 1 commit into
machsix:masterfrom
DolphinZZZZZ:fix-exhentai-image-retry
Open

DolphinZZZZZ wants to merge 1 commit into
machsix:masterfrom
DolphinZZZZZ:fix-exhentai-image-retry

Conversation

@DolphinZZZZZ

@DolphinZZZZZ DolphinZZZZZ commented Jun 27, 2026 •

Copy link
Copy Markdown

提交这个 PR 的理由

这个改动主要针对 E-Hentai / ExHentai 图片页上的一个实际失败场景。

当图片加载失败时,网站本身会通过 nl(...) 重试 token 请求另一个图片源。这个机制在原始页面上通常还能使用,但在 Super-preloader 插入的新页面里不太可靠:被插入的图片元素和加载失败元素可能会丢失原始的 ID / 事件处理逻辑,导致插入页里的失败图片不容易手动重试。

另一个实际影响是,失败图片的原站重试 / 重新加载流程可能会干扰当前滚动位置。自动翻页后,如果前面某张失败图片触发重试,页面可能会被重新拉回前面的图片位置,造成用户明明在继续往下滑,却又被拽回去。

这个 PR 增加了 ExHentai 专用的重试处理,让当前页和 Super-preloader 插入页里的失败图片都可以通过同一套 nl token 流程重试。实现上尽量把重试限制在失败图片元素本身:后台请求新的重试结果,解析新的图片地址和 token,然后原地替换对应图片,避免为了重试而触发整页跳转、地址变化或滚动位置跳回。

这里使用 document-start,是因为重试 hook 需要尽早安装,最好在页面脚本定义或调用 nl(...) 之前介入。

Summary

  • add ExHentai/E-Hentai image reload handling around nl(...) retry tokens
  • retry failed gallery images across inserted pages with a visible reload button and status message
  • run at document-start so the page-level retry hook can be installed before the site defines handlers
  • rebuild dist/Super_preloaderPlus_one_New.user.js

Verification

  • npx --yes pnpm@10.25.0 -C . run build passed
  • npx --yes pnpm@10.25.0 -C . run check passed lint and typecheck; format:check fails on pre-existing unmodified docs files: docs/.vitepress/cn.ts, config.ts, en.ts, theme/index.ts
  • node --check dist/Super_preloaderPlus_one_New.user.js passed
  • pnpm run test is blocked in this local environment by TLS certificate verification when downloading Violentmonkey; with NODE_TLS_REJECT_UNAUTHORIZED=0, download/browser launch succeeds but the local VM install flow times out before assertions

@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

@DolphinZZZZZ is attempting to deploy a commit to the machsix's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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