Repository navigation
fix: report failed saves and stop clicking links during capture (v1.2.2) - #27
Merged
Merged
Conversation
The popup ignored the background's response and showed "Saved!" for every
outcome, including protected pages and captures that died mid-way. And
expandCollapsedSections() clicked every [aria-expanded="false"] element,
including menu links, which navigated the tab away; the capture script
then returned nothing, which background.js treated as "user cancelled".
- popup checks response.success and shows a localized reason
- background distinguishes Abort ({cancelled: true}) from a capture that
returned nothing (page-navigated error) and answers when no tab is found
- new src/expand-policy.js: never click links to another page, links that
open a new tab or download, or form submit buttons
- context-menu failures set a "!" badge and are shown when the popup opens
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #27 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 4 4
Branches 1 1
=========================================
Hits 4 4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merged
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.
Fixes the two failures behind the recent Chrome Web Store reviews ("nothing actually happens"; "it sends me to another page").
What was wrong
popup.jsawaitedsendMessagebut never looked atresponse.success, so protected pages and failed captures still showed "Saved!" with no file.expandCollapsedSections()calls.click()on every[aria-expanded="false"],.expand,.collapsed, … element. On a menu link like<a href="/services/" aria-expanded="false">, that navigates the tab away. The injected script dies,executeScriptreturns no result, andbackground.jstreated that as "user pressed Abort" and returned quietly. The result was a different page, no file, and "Saved!".Changes
{ cancelled: true }explicitly.page-navigatederror instead of passing as a cancel.src/expand-policy.js, injected next toturndown.js. Expansion never clicks:#andjavascript:toggles are still allowed),target/download,<details>elements are still opened.!badge and stores the error. The popup shows it when opened, then clears it.Verification
pnpm run format,lint,test: 115 tests pass, including 13 new tests forexpand-policy.End-to-end in headless Chromium with the built extension, old build (v1.2.1) vs this branch. The test copy adds
host_permissions: <all_urls>to stand in for the activeTab grant.chrome://version<a href="/services/" aria-expanded="false">menu/services/, 0 downloadsonclick!badge; popup shows the reason and clears the badgeFirefox was not tested end to end. It uses the same
browser.action/storage.local/scriptingAPIs.🤖 Generated with Claude Code