Skip to content

Add chrome.runtime message API to allow sharing URLs with other extensions - #263

Open
pirate wants to merge 1 commit into
stefanXO:masterfrom
pirate:archivebox-session-export-api
Open

Add chrome.runtime message API to allow sharing URLs with other extensions#263
pirate wants to merge 1 commit into
stefanXO:masterfrom
pirate:archivebox-session-export-api

Conversation

@pirate

@pirate pirate commented May 14, 2026

Copy link
Copy Markdown

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:

chrome.runtime.sendMessage(tabManagerPlusExtensionId, {
  method: "tabManagerPlus.getSavedSessions",
  displayName: "ArchiveBox"
})

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:

{
  ok: true,
  sessions: [{
    id: string,
    name: string,
    date: number,
    tabs: [{ title: string, url: string, favIconUrl?: string }]
  }]
}

Only http:// and https:// tab URLs are exported.

Screenshots

Seeded Tab Manager Plus saved sessions:

Seeded Tab Manager Plus saved sessions

ArchiveBox configured with the unpacked Tab Manager Plus extension ID:

ArchiveBox Tab Manager Plus extension ID config

First request opens the Tab Manager Plus approval UI:

Tab Manager Plus pending external access request

Approved extension is persisted with name and ID:

Tab Manager Plus allowed external extension

ArchiveBox imports the approved saved-session URLs:

ArchiveBox import review for Tab Manager Plus URLs

Imported URLs are tagged by source and session:

ArchiveBox saved URLs tagged from Tab Manager Plus import

How to test with ArchiveBox

  1. Clone both repos:
git clone https://github.com/ArchiveBox/archivebox-browser-extension
git clone https://github.com/pirate/Tab-Manager-Plus
cd Tab-Manager-Plus
git checkout archivebox-session-export-api
pnpm install
pnpm build
cd ../archivebox-browser-extension
pnpm install
pnpm build
  1. Load both unpacked extensions into Chrome or Chrome Canary:
  • Tab Manager Plus: load the Tab-Manager-Plus repo root.
  • ArchiveBox: load archivebox-browser-extension/.output/chrome-mv3.
  1. 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.

  2. Save at least one window/session in Tab Manager Plus.

  3. In ArchiveBox Options -> Bulk Import URLs, click "Import from Tab Manager Plus".

  4. The first request should open Tab Manager Plus options with a red "External Session Access" approval box. Approve ArchiveBox.

  5. Return to ArchiveBox and click "Import from Tab Manager Plus" again. The saved session URLs should appear in the import review table.

  6. Click "Import Selected". Imported URLs should be tagged with tab-manager-plus plus the saved session name, or a date fallback like tab-manager-plus-YYYYMMDDHHMM for unnamed sessions.

Validation

  • pnpm build in Tab Manager Plus.
  • pnpm exec tsc --noEmit in ArchiveBox.
  • pnpm build in ArchiveBox.
  • pnpm test in ArchiveBox.
  • End-to-end local Chrome Canary run using Extensions.loadUnpacked for both unpacked extensions, covering first-request approval, persisted allowlist, import review, and final saved URL tags.

@pirate pirate changed the title Add external saved sessions API Add chrome.runtime message API to allow sharing URLs with other extensions May 14, 2026
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