fix(about): send Edge Add-ons installs to their listing
BookmarkMagic went live on Edge Add-ons on 2026-11-19. Its "Store listing" link chooses the listing by runtime.id, and only the Chrome Web Store's id was known, so an install from Edge Add-ons was sent to the README's install section. storeUrlFor now looks the id up in a map of each Chromium store's item id to its listing. Edge's item id is Partner Center's "CRX ID", which is what an install reports; the Product ID is a different number, the one the EDGE_PRODUCT_ID secret takes. Any other id (an unpacked build) still goes to the install section. Ships with the next release (CHANGELOG [Unreleased]); docs/06 §3.5 says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1657646b01
commit
ce97979706
4 files changed
+38
-10
No files matched your search
+5
-1
@@ -12,7 +12,11 @@ version bump).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
Nothing yet.
|
||||
### Changed
|
||||
|
||||
- **About → Store listing** on a copy installed from Microsoft Edge Add-ons now
|
||||
opens BookmarkMagic's Edge Add-ons page, live since 2026-11-19. Until now it
|
||||
opened the install section of the project's README.
|
||||
|
||||
## [1.3.0] — 2026-11-18
|
||||
|
||||
|
||||
+6
-4
@@ -398,10 +398,12 @@ only route a user has from inside the product to rate or review it, which
|
||||
`13 §6` depends on. Since v1.3.0 one package serves the Chrome Web Store and
|
||||
Edge Add-ons, so the link is chosen at run time (`links.ts` `storeUrlFor`):
|
||||
the Firefox build → the AMO listing, addressed by the gecko id; a Chromium
|
||||
copy whose `runtime.id` is the Chrome Web Store item id (`00 §9`) → that
|
||||
listing; anything else — an Edge Add-ons install, an unpacked build → the
|
||||
README's install section, which lists every store. The label was "Chrome Web
|
||||
Store" until then.
|
||||
copy whose `runtime.id` is a store's item id (`00 §9`) → that store's
|
||||
listing — the Chrome Web Store's, or Edge Add-ons' (mapped after the listing
|
||||
went live on 2026-11-19, so from the release after 1.3.0); anything else — an
|
||||
unpacked build → the README's install section, which lists every store. 1.3.0
|
||||
itself sends an Edge Add-ons install to that section, which links the Edge
|
||||
listing too. The label was "Chrome Web Store" until v1.3.0.
|
||||
|
||||
**No email address appears anywhere in the product.** Since v1.1.0 the
|
||||
project's addresses are per purpose (`security@` in `SECURITY.md`, `privacy@` in
|
||||
|
||||
+20
-3
@@ -33,6 +33,22 @@ const CWS_ITEM_ID = 'eghnciphhegekmnofffpgbdfefckdhmg';
|
||||
/** The published Chrome Web Store listing. */
|
||||
const CWS_URL = `https://chromewebstore.google.com/detail/bookmarkmagic/${CWS_ITEM_ID}`;
|
||||
|
||||
/**
|
||||
* The Edge Add-ons item id — Partner Center's "CRX ID", and the `runtime.id`
|
||||
* of every copy installed from Edge Add-ons (docs/00 §9). Not the Product ID,
|
||||
* which is what the `EDGE_PRODUCT_ID` secret needs.
|
||||
*/
|
||||
const EDGE_ITEM_ID = 'nchfchjnlihbifggooggpmmacighmdjg';
|
||||
|
||||
/** The published Edge Add-ons listing (live since 2026-11-19). */
|
||||
const EDGE_URL = `https://microsoftedge.microsoft.com/addons/detail/${EDGE_ITEM_ID}`;
|
||||
|
||||
/** Each Chromium store's item id → its listing. */
|
||||
const CHROMIUM_LISTINGS: ReadonlyMap<string, string> = new Map([
|
||||
[CWS_ITEM_ID, CWS_URL],
|
||||
[EDGE_ITEM_ID, EDGE_URL],
|
||||
]);
|
||||
|
||||
/**
|
||||
* The Firefox Add-ons listing, addressed by the gecko id, which AMO resolves
|
||||
* (docs/13 §8). The "@" is percent-encoded on purpose: AMO decodes it, and the
|
||||
@@ -49,8 +65,9 @@ const INSTALL_URL = `${REPO_URL}#install`;
|
||||
* The only route from inside the product to rating or reviewing it, which
|
||||
* docs/13 §6 lists as a post-launch channel. One Chromium package serves the
|
||||
* Chrome Web Store and Edge Add-ons, so the Chromium choice is made at run
|
||||
* time, by extension id: the Chrome Web Store's own id gets its listing, any
|
||||
* other (an Edge Add-ons install, an unpacked build) the install section.
|
||||
* time, by extension id: each store's own id gets its listing (an Edge user
|
||||
* who installed from the Chrome Web Store has that store's id, and gets that
|
||||
* listing), any other id (an unpacked build) the install section.
|
||||
*
|
||||
* There is deliberately **no support email here.** Putting an address on an
|
||||
* in-product surface invites users to mail their real bookmarks file, which is
|
||||
@@ -61,7 +78,7 @@ const INSTALL_URL = `${REPO_URL}#install`;
|
||||
*/
|
||||
export function storeUrlFor(install: { firefox: boolean; extensionId: string }): string {
|
||||
if (install.firefox) return AMO_URL;
|
||||
return install.extensionId === CWS_ITEM_ID ? CWS_URL : INSTALL_URL;
|
||||
return CHROMIUM_LISTINGS.get(install.extensionId) ?? INSTALL_URL;
|
||||
}
|
||||
|
||||
export interface LabelledLink {
|
||||
|
||||
@@ -116,8 +116,13 @@ describe('store listing', () => {
|
||||
const amo = storeUrlFor({ firefox: true, extensionId: 'anything' });
|
||||
expect(amo).toBe('https://addons.mozilla.org/firefox/addon/bookmarkmagic%40poli0981.dev/');
|
||||
expect(decodeURIComponent(amo)).toContain('bookmarkmagic@poli0981.dev');
|
||||
// A Chromium copy with any other id — Edge Add-ons assigns its own, an
|
||||
// unpacked build gets a random one — goes to the list of every store.
|
||||
// Edge Add-ons assigns its own id — Partner Center's "CRX ID", not the
|
||||
// Product ID — and an install from there gets the Edge listing.
|
||||
expect(storeUrlFor({ firefox: false, extensionId: 'nchfchjnlihbifggooggpmmacighmdjg' })).toBe(
|
||||
'https://microsoftedge.microsoft.com/addons/detail/nchfchjnlihbifggooggpmmacighmdjg',
|
||||
);
|
||||
// A Chromium copy with any other id — an unpacked build gets a random
|
||||
// one — goes to the list of every store.
|
||||
expect(storeUrlFor({ firefox: false, extensionId: 'abcdefghijklmnopabcdefghijklmnop' })).toBe(
|
||||
`${REPO_URL}#install`,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user