Avoid duplicate downloads in Page Info export (GM_download fallback gating) by cbkii · Pull Request #37 · cbkii/userscripts · GitHub
Skip to content

Avoid duplicate downloads in Page Info export (GM_download fallback gating)#37

Merged
cbkii merged 1 commit into
mainfrom
cx/investigate-download-handling-logic-4punsl
Jan 11, 2026
Merged

Avoid duplicate downloads in Page Info export (GM_download fallback gating)#37
cbkii merged 1 commit into
mainfrom
cx/investigate-download-handling-logic-4punsl

Conversation

@cbkii

@cbkii cbkii commented Jan 11, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Downloads could be duplicated because the GM_download mobile timeout and fallback paths were not gated, causing secondary fallback attempts to run after an initial download attempt.
  • The change aims to ensure only a single download path runs and to avoid triggering anchor/data-url fallbacks when GM.download has already handled or timed out.

Description

  • Bumped pageinfoexport.user.js @version to 2026.01.11.0251 and updated download handling logic in saveWithGMDownload to track fallback state and errors.
  • Added new internal flags (fallbackAttempted, allowAutoFallback, lastError) and updated handleError/timer logic to prevent auto-triggering secondary fallbacks on timeout or when fallback already ran.
  • Adjusted the calling flow in saveReport to skip the fallback chain when saveWithGMDownload indicates it already attempted fallback or auto-fallback is disabled.

Testing

  • No automated tests were run for this change (manual test instructions were included in the commit message).

Codex Task

Manual test: open any page -> Userscripts UI -> Page Info Export -> Export page info; verify only one download prompt appears.\nManual test (XBrowser): trigger export; verify no duplicate downloads and fallback actions appear after delay.
@cbkii cbkii merged commit 286804d into main Jan 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant