Skip to content

🐞 Restore web and local PDF tabs after extension reloads - #202

Merged
lindsey-pony[bot] merged 8 commits into
mainfrom
restore-pdf-tabs-on-reload
Nov 18, 2026
Merged

lindsey-pony[bot] merged 8 commits into
mainfrom
restore-pdf-tabs-on-reload

Conversation

@JFWooten4

Copy link
Copy Markdown
Member

Summary

Preserve open PDF tabs across unpacked-extension reloads, including local file:// PDFs and web PDFs.

  • Register each PDF's original source URL and current physical page without storing document bytes.
  • Track tab window, index, pinned state, and active state; reopen Chrome-closed tabs or refresh surviving tabs in place.
  • Support both the direct MIME-handler path and the older extension-page redirect fallback, without depending on temporary stream/blob URLs.
  • Skip local-file reopening when Chrome's Allow access to file URLs permission is disabled, and never overwrite unrelated tabs.
  • Remove intentionally closed tabs from the recovery registry, avoid duplicate tab recreation during the second recovery pass, and skip incognito persistence.
  • Add six regression tests and document the file-permission requirement.

Verification

  • Verified all six committed file changes and that the branch's Git tree differs from main.
  • Confirmed the recovery worker script parses successfully and the package manifest remains valid JSON.
  • Added tests/pdf-tab-recovery.test.mjs to npm test. Automated Node tests have not been executed in this environment.

Limitations

  • The first reload after installing this feature cannot recover tabs that an earlier viewer version never registered.
  • Local PDFs need file-scheme access permission and must still exist at the saved path.
  • Reloading a surviving tab may re-fetch the PDF; recovery does not cache PDF bytes.

JFWooten4 and others added 8 commits October 18, 2026 16:22
Preserve the original web or local PDF URL, page position, and tab placement across unpacked extension reloads. Reopen missing viewer tabs, refresh surviving tabs, respect local file access permissions, and cover recovery with regression tests.

Co-authored-by: Codex Web <noreply@openai.com>
Expose completion of the extension-update recovery passes to regression tests and await that completion instead of relying on a 35 ms scheduling delay. Keep the real Chrome listener behavior unchanged.

Co-authored-by: ChatGPT 6 <noreply@openai.com>
Compare the full extension scheme and host instead of relying on URL.origin, which is opaque for chrome-extension URLs in the Node test environment. Include saved registry diagnostics on recovery test failures.

Co-authored-by: ChatGPT 6 <noreply@openai.com>
Main replaced the old hardcoded npm test list with a feature-owned test runner, while this PR added recovery tests to that obsolete command. Preserve main's full test, suite, and syntax commands; add a standalone test:recovery command for the six new regression tests. The new test must also be registered in scripts/test-suites.mjs under an appropriate suite for the full CI ownership check. That runner path is outside the selected PR's permitted resolution-file scope, so do not weaken or bypass the inventory check.
…tabs

Main added text-fragment page-number precedence while the PR added the PDF-open background registration message at the same location. Retain text-fragment precedence for requestedPage and send that effective physical page and original PDF source to the recovery worker. The PR's separate page-change message remains integrated, preserving session-page resume and all newer viewer navigation controls.
main added the paragraph-double-click test shortcut after this PR branched; the PR separately adds test:recovery in the same scripts object. Retain both shortcuts and the feature-owned test runner. Register the newly added recovery test under navigation in scripts/test-suites.mjs so the existing CI suite inventory no longer rejects it. No behavior or other test ownership is removed.
@lindsey-pony
lindsey-pony Bot merged commit f4f6274 into main Nov 18, 2026
14 checks passed
@lindsey-pony
lindsey-pony Bot deleted the restore-pdf-tabs-on-reload branch November 18, 2026 23:20
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