feat(ext): bookmark all open tabs in one action (#46)#50
Merged
Conversation
Adds a "Save all tabs" popup button that saves every http(s) tab in the current window in one batched bookmarks.json write. core: - addBookmarks(file, bookmarks, nowIso): pure, replay-safe batch append that de-dupes by URL against existing *active* bookmarks and within the batch. Tombstoned URLs aren't treated as duplicates (re-save allowed). Exported. extension-shared: - bookmark-factory: optional `folder` input (default ""). - save-flow: saveAllTabs(...) + SaveAllTabsResult (shared SaveFailure type, reuses classify). Pre-filters unsafe schemes via isSafeBookmarkUrl, builds a bookmark per safe tab, then one updateBookmarksOrBootstrap call whose mutator applies addBookmarks; reports saved / skippedUnsafe / skippedDuplicate / total. - save-result-view: applySaveAllResult(...) — count message + Saved ✓ + auto-close. - popup: "Save all tabs" button (magenta secondary) + handler. Restricts the batch to http(s) tabs (isSafeBookmarkUrl also allows chrome:/about:, which aren't useful bookmarks); groups saves into a dated `Session YYYY-MM-DD` folder. manifests: add the `tabs` permission (chrome + firefox). NOTE: this widens the install prompt to "Read your browsing history" — needed to read every tab's url/title. tests: addBookmarks (5), saveAllTabs (6), applySaveAllResult (3). docs: CLAUDE.md roadmap item 8 -> done; smoke-test steps in both READMEs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Closes #46.
What
A "Save all tabs" button in the popup saves every http(s) tab in the current window in one batched
bookmarks.jsonwrite — for closing out a research session.Behavior
Bookmarkper tab and persists them through oneupdateBookmarksOrBootstrapcall (oneclient.update, replay-safe), not one-per-tab.addBookmarks(file, bookmarks, nowIso)skips any candidate whose URL matches an existing active bookmark, and de-dupes within the batch. Tombstoned URLs aren't treated as duplicates (so a deleted page can be re-saved). The dedupe runs inside the mutator, so it stays correct across a 409 replay.Session YYYY-MM-DDfolder (the issue's example). Folder is asaveAllTabsoption; the popup passes the dated name.http(s)tabs. Note:isSafeBookmarkUrl(the XSS allowlist) intentionally permitschrome:/about:, so it alone wouldn't skip browser-internal tabs —saveAllTabsstill applies it as a defense-in-depth guard (skippedUnsafe), but the "only real web pages" policy lives in the popup.✓ saved N tabs (skipped M), then the popup auto-closes (reusing the Popup save button stuck in 'saving…' state with progress cursor after successful save #43 pattern).Adds the
tabspermission to both manifests — required to read every tab's URL/title. This widens the install prompt to "Read your browsing history". Calling out explicitly for review.Files
core:addBookmarks+ export.extension-shared:bookmark-factory(folder),save-flow(saveAllTabs+SaveAllTabsResult/SaveFailure),save-result-view(applySaveAllResult),popup.ts/popup.html.Out of scope (per issue)
History import; cross-window "all windows"; a folder/root chooser UI (dated folder is the default).
Verification
addBookmarks)saveAllTabs, +3applySaveAllResult)🤖 Generated with Claude Code