Add chrome.runtime message API to allow sharing URLs with other extensions - #263
Open
pirate wants to merge 1 commit into
Open
Add chrome.runtime message API to allow sharing URLs with other extensions#263pirate wants to merge 1 commit into
pirate wants to merge 1 commit into
Conversation
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.
Summary
This adds an opt-in external messaging API so other browser extensions can import saved session URLs from Tab Manager Plus. ArchiveBox would like to use this to let users import their saved Tab Manager Plus sessions into their local ArchiveBox URL list.
The new API is intentionally small:
On first request, Tab Manager Plus opens its options page and records the requesting extension as pending. The user can approve or deny the request. Approved extensions are stored with both extension ID and display name, and can be removed later from the same options section.
When approved, the API returns normalized saved sessions:
Only
http://andhttps://tab URLs are exported.Screenshots
Seeded Tab Manager Plus saved sessions:
ArchiveBox configured with the unpacked Tab Manager Plus extension ID:
First request opens the Tab Manager Plus approval UI:
Approved extension is persisted with name and ID:
ArchiveBox imports the approved saved-session URLs:
Imported URLs are tagged by source and session:
How to test with ArchiveBox
Tab-Manager-Plusrepo root.archivebox-browser-extension/.output/chrome-mv3.In ArchiveBox Options -> Configuration, set "Tab Manager Plus extension ID" to the loaded Tab Manager Plus extension ID. If using the published Web Store build, the default ID is
cnkdjjdmfiffagllbiiilooaoofcoeff.Save at least one window/session in Tab Manager Plus.
In ArchiveBox Options -> Bulk Import URLs, click "Import from Tab Manager Plus".
The first request should open Tab Manager Plus options with a red "External Session Access" approval box. Approve ArchiveBox.
Return to ArchiveBox and click "Import from Tab Manager Plus" again. The saved session URLs should appear in the import review table.
Click "Import Selected". Imported URLs should be tagged with
tab-manager-plusplus the saved session name, or a date fallback liketab-manager-plus-YYYYMMDDHHMMfor unnamed sessions.Validation
pnpm buildin Tab Manager Plus.pnpm exec tsc --noEmitin ArchiveBox.pnpm buildin ArchiveBox.pnpm testin ArchiveBox.Extensions.loadUnpackedfor both unpacked extensions, covering first-request approval, persisted allowlist, import review, and final saved URL tags.