docs(store): Edge listing names no other browser

Partner Center warned on the zh-CN description: "Avoid referencing other
browsers in your extension description such as Firefox". Edge's developer
policy (1.1.2) says a listing must not reference other browsers, and the
first Edge copy was the Chrome Web Store description with two bullets
swapped: the export bullet still listed seven browsers, and the swapped
import bullet itself named Chrome, Brave and Firefox.

- store/listing.*.md: Firefox Add-ons and Edge Add-ons get a heading
  each. The Edge section is a complete description, pasted whole, that
  names no browser but Edge: the profile "Bookmarks" file is the one "Edge
  and similar browsers keep", HTML export is "the standard bookmark file
  every major browser can import". Every other line matches the Chrome
  Web Store copy; the Firefox copy is unchanged.
- tests/unit/store-listing.test.ts: one Edge description per locale, 250
  to 5,000 characters, no other browser's name; and the same pattern must
  find the browsers the Chrome Web Store copy lists, so it cannot pass by
  matching nothing.
- docs/08 §10, docs/13 §9, docs/11 §4, store/README.md: the rule, where it
  is tested, and policy 1.5.2's "should" about the privacy policy, left
  as it is unless review raises it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
poli0981andClaude Opus 5.5 committed 2026-11-18 23:45:49 +07:00
1 parent bcc4c81a8c
commit 1657646b01
10 files changed
+344 -17

No files matched your search

+12 -3
View File
@@ -281,9 +281,18 @@ browser_specific_settings: {
`minimum_chrome_version` included (Edge versions follow Chromium's, so
136 means Edge 136). The zip uploaded to Edge is the same Release asset as
the Chrome one, with the same checksum.
- Partner Center rejects a listing whose name or description sells it as a
Chrome extension; the Edge listing copy (`13 §3`) is reworded to name
Chromium-based browsers where it has to mention Chrome's file format.
- **The listing names no other browser.** Edge's developer policy (1.1.2)
says an extension "must not reference other browsers", and Partner Center
warns on any browser name in a description — on 2026-11-18 it flagged
"Firefox" in the first Edge copy, which was the Chrome Web Store
description with two bullets swapped and still listed seven browsers. The
Edge copy in `store/listing.*.md` is now a complete description of its own:
the profile `Bookmarks` file is the one "Edge and similar browsers keep",
HTML export is the file "every major browser can import", and
`tests/unit/store-listing.test.ts` fails on a name pasted back in. The same
policy (1.5.2) asks that the privacy policy refer "primarily" to Edge;
`legal/PRIVACY.md` names all three stores. That is a *should*, so it is left
as it is unless review raises it.
- Edge's bookmarks API is Chromium's: the same roots ("Favorites bar", "Other
favorites"), `folderType` included. Whether Edge marks the roots of a
signed-in, syncing profile with `syncing: true` — which would leave no
+5
View File
@@ -278,6 +278,11 @@ them is tested where it lives:
and the issue chooser; every key `tree-keyboard.ts` switches on has a row;
it states a goal and an untested list, and it is dated. It cannot tell
whether a sentence is *true* — that is `§5`'s last item.
- **`store-listing.test.ts`** (2026-11-18, after v1.3.0) — the Edge Add-ons
copy in every `store/listing.*.md`: one complete description under the Edge
heading, 250 to 5,000 characters (Partner Center's range), naming no browser
but Edge (`08 §10`, `13 §9`). The same pattern has to find the browsers the
Chrome Web Store copy lists, so it cannot pass by matching nothing.
- **`tests/unit/scripts/`** — the repo's own gates, tested like code. New in
v1.1.0: `guard.test.ts` (`08 §3`), `check-manifest.test.ts` (a correct build
passes, one without the CSP fails) and `sanitize-formats.test.ts` (the
+5 -4
View File
@@ -333,10 +333,11 @@ Still ship the fix forward.
Edge marks syncing roots).
3. Partner Center → Edge → **Create new extension** → upload the Release's
`bookmarkmagic-X.Y.Z-chrome.zip` — the Chrome package, unchanged.
4. Listing from `store/listing.<lang>.md`'s **Edge** block (it avoids selling
the extension as a Chrome one, `08 §10`); category *Productivity*; privacy
answers as `08 §5`; privacy policy URL as above; screenshots from
`store/screenshots/`.
4. Listing from `store/listing.<lang>.md`'s **Microsoft Edge Add-ons**
section: a complete description of its own, pasted whole, that names no
browser but Edge (Edge's policy 1.1.2 — Partner Center warns on any other
browser's name, `08 §10`); category *Productivity*; privacy answers as
`08 §5`; privacy policy URL as above; screenshots from `store/screenshots/`.
5. Submit; record the outcome in `15`. Note the **Product ID** on the
extension's overview page — `EDGE_PRODUCT_ID` — and the listing URL, which
the About link and the README can then use (`06 §3.5`).
+6
View File
@@ -23,6 +23,12 @@ same spelling as `src/public/_locales/`. Adding a language: `docs/07 §6` and
`docs/13 §4` — the `LANGUAGES` paragraph inside *every* description lists the
languages, so all of them are re-pasted when one is added.
Since v1.3.0 each file also carries the **Firefox Add-ons** and **Microsoft
Edge Add-ons** copy, under headings of their own. The Edge description is
complete and is pasted whole: Edge's policy forbids naming other browsers, so
it is the one description that never says Chrome or Firefox (`docs/13 §9`,
checked by `tests/unit/store-listing.test.ts`).
The summary field is capped at **132 characters** by the dashboard. Each file
records its own count; re-check after any edit, because the limit is enforced at
submission time and a rejection there costs a round trip.
+50 -2
View File
@@ -57,9 +57,9 @@ https://github.com/poli0981/bookmarkmagic
**Distribution:** Public, all regions.
## Firefox Add-ons and Microsoft Edge Add-ons (since v1.3.0)
## Firefox Add-ons (since v1.3.0)
The description above, with the two bullets that name Chrome replaced by these — on Firefox and Edge they would not be true as written (Edge also refuses a listing that sells itself as a Chrome extension):
The description above, with the two bullets that name Chrome replaced by these — on Firefox they would not be true as written:
```
• Import bookmark files (HTML, JSON, CSV) — including the "Bookmarks" file
@@ -85,4 +85,52 @@ category *Bookmarks* · licence *GNU General Public License v3.0* · Firefox
(desktop) only — not Android · the same privacy-policy URL · support site: the
repository's issues.
## Microsoft Edge Add-ons (since v1.3.0)
A description of its own, pasted whole. Edge's developer policy (1.1.2) says a
listing "must not reference other browsers", and Partner Center flags any
browser name in the description — it did on 2026-11-18, for "Firefox". So this
copy names no browser but Edge: the import bullet describes the files by what
they are, and the export bullet says "every major browser" instead of listing
seven. `tests/unit/store-listing.test.ts` fails if a name comes back.
```
Move your bookmarks between browsers the simple way: with a file. No account.
No cloud sync. 100% offline.
WHAT IT DOES
• Import bookmark files (HTML, JSON, CSV) — including the "Bookmarks" file
that Edge and similar browsers keep in their profile folder, and JSON
bookmark backups — with a full preview before anything is written: counts,
folders and duplicates first.
• Choose how to import: into a new dated folder (safe default), merge into
the folders you already have, or replace everything (it shows exactly what
will be deleted and saves a safety backup first).
• Can skip links you already have.
• Export everything — or just the folders you pick — to HTML (the standard
bookmark file every major browser can import), JSON, CSV, or Markdown.
• Edit your bookmark tree: search, rename, drag to move or reorder, sort a
folder A→Z, create folders, delete, and find duplicate links.
PRIVACY BY DESIGN
• Works entirely on your device. No servers, no analytics, no tracking.
• Only two permissions: "bookmarks" (the whole point) and "storage" (your
settings). Nothing else.
• Free & open source (GPL-3.0) — read the code on GitHub.
LANGUAGES
English · Tiếng Việt · 日本語 · 简体中文 · Română
LIMITATIONS (HONESTY CORNER)
• Favicons can't be imported — the extensions API for bookmarks has no
favicon field.
• Imported bookmarks get today's date — browsers don't let extensions set a
bookmark's original creation date. Your exported files keep the real dates.
• CSV is a flattened view: empty folders and "which folder is the toolbar"
aren't preserved. Use HTML or JSON for a faithful backup.
Source code, issue tracker & privacy policy:
https://github.com/poli0981/bookmarkmagic
```
**Edge Add-ons:** category *Productivity* · the same privacy-policy URL.
+51 -2
View File
@@ -61,9 +61,9 @@ https://github.com/poli0981/bookmarkmagic
法的文書は英語のみです(`docs/14`)。プライバシーポリシーの URL は EN 版と
同じものを使います。
## Firefox Add-ons と Microsoft Edge Add-ons(v1.3.0 以降)
## Firefox Add-ons(v1.3.0 以降)
上の説明文のうち、Chrome に触れている 2 項目を次のものに置き換えて使います(Firefox と Edge ではそのままでは正しくなく、Edge は Chrome 拡張機能として紹介するリスティングを受け付けません):
上の説明文のうち、Chrome に触れている 2 項目を次のものに置き換えて使います(Firefox ではそのままでは正しくないため):
```
• ブックマークファイル(HTML、JSON、CSV)をインポートします。Chromium 系
@@ -89,4 +89,53 @@ Firefox Add-ons のみ、「制限事項」に追加:
*GNU General Public License v3.0* · Firefox(デスクトップ)のみ · 同じ
プライバシーポリシー URL。
## Microsoft Edge Add-ons(v1.3.0 以降)
専用の説明文を、そのまま丸ごと貼り付けます。Edge の開発者ポリシー(1.1.2)は
リスティングが他のブラウザに言及することを認めておらず、Partner Center は説明文
にブラウザ名があると警告します(2026-11-18 に「Firefox」で警告が出ました)。
そのため、この説明文は Edge 以外のブラウザ名を含みません。名前が戻ると
`tests/unit/store-listing.test.ts` が失敗します。
```
ブックマークをブラウザ間で移すいちばん簡単な方法は、ファイルを使うことです。
アカウント不要、クラウド同期なし、完全オフラインで動作します。
できること
• ブックマークファイル(HTML、JSON、CSV)をインポートします。Edge などの
ブラウザがプロファイルフォルダに保存している「Bookmarks」ファイルや、
JSON 形式のブックマークのバックアップにも対応。書き込む前に必ずプレビュー
を表示し、件数・フォルダ・重複を先に確認できます。
• インポート方法を選べます。日付付きの新しいフォルダに入れる(安全な既定
値)、既存のフォルダに統合する、またはすべて置き換える(削除される内容を
正確に示し、安全のためのバックアップを先に保存します)。
• すでにあるリンクはスキップできます。
• すべて、または選んだフォルダだけを HTML(主要なブラウザならどれでも
インポートできる標準のブックマークファイル)、JSON、CSV、Markdown に
エクスポートできます。
• ブックマークツリーを編集できます。検索、名前の変更、ドラッグでの移動と
並べ替え、フォルダの A→Z 並べ替え、フォルダの作成、削除、重複リンクの検出。
設計としてのプライバシー
• すべて端末上で動作します。サーバーも、分析も、トラッキングもありません。
• 権限は 2 つだけです。「bookmarks」(本来の目的)と「storage」(設定の
保存)。それ以外は要求しません。
• 無料・オープンソース(GPL-3.0)です。コードは GitHub で確認できます。
対応言語
English · Tiếng Việt · 日本語 · 简体中文 · Română
制限事項(正直に)
• ファビコンはインポートできません。ブラウザのブックマーク API に
ファビコンの項目がないためです。
• インポートしたブックマークの日付は本日になります。拡張機能がブックマーク
の元の作成日を設定することをブラウザが許可していないためです。エクスポート
したファイルには本来の日付が残ります。
• CSV はフラットな形式です。空のフォルダや「どれがブックマークバーか」は
保持されません。忠実なバックアップには HTML か JSON をお使いください。
ソースコード、問題の報告、プライバシーポリシー:
https://github.com/poli0981/bookmarkmagic
```
**Edge Add-ons:** カテゴリ *Productivity* · 同じプライバシーポリシー URL。
+56 -2
View File
@@ -67,9 +67,9 @@ https://github.com/poli0981/bookmarkmagic
Documentele juridice există doar în limba engleză (`docs/14`); URL-ul politicii
de confidențialitate este același ca în versiunea în engleză.
## Firefox Add-ons și Microsoft Edge Add-ons (din v1.3.0)
## Firefox Add-ons (din v1.3.0)
Descrierea de mai sus, cu cele două puncte care numesc Chrome înlocuite de acestea — în Firefox și Edge n-ar fi adevărate așa cum sunt scrise (iar Edge refuză o pagină care se prezintă drept extensie Chrome):
Descrierea de mai sus, cu cele două puncte care numesc Chrome înlocuite de acestea — în Firefox n-ar fi adevărate așa cum sunt scrise:
```
• Importă fișiere de marcaje (HTML, JSON, CSV) — inclusiv fișierul „Bookmarks”
@@ -95,5 +95,59 @@ Doar pentru Firefox Add-ons, adăugați la LIMITĂRI:
licența *GNU General Public License v3.0* · doar Firefox (desktop) · același
URL al politicii de confidențialitate.
## Microsoft Edge Add-ons (din v1.3.0)
O descriere proprie, lipită întreagă. Politica pentru dezvoltatori a Edge (1.1.2)
nu permite ca o listare să menționeze alte browsere, iar Partner Center
avertizează la orice nume de browser din descriere (a făcut-o pe 2026-11-18,
pentru „Firefox”). Așadar textul acesta nu numește niciun browser în afară de
Edge; `tests/unit/store-listing.test.ts` eșuează dacă un nume revine.
```
Mutați marcajele între browsere în cel mai simplu mod: cu un fișier. Fără cont.
Fără sincronizare în cloud. 100% offline.
CE FACE
• Importă fișiere de marcaje (HTML, JSON, CSV) — inclusiv fișierul „Bookmarks”
pe care Edge și browserele similare îl păstrează în dosarul profilului, precum
și copiile de rezervă JSON ale marcajelor — cu o previzualizare completă
înainte de a scrie ceva: numărul de marcaje, dosarele și duplicatele, de la
început.
• Alegeți cum se face importul: într-un dosar nou cu dată (varianta sigură,
implicită), prin îmbinare cu dosarele pe care le aveți deja sau prin
înlocuirea completă (arată exact ce se va șterge și salvează mai întâi o
copie de rezervă de siguranță).
• Poate omite linkurile pe care le aveți deja.
• Exportă tot — sau doar dosarele alese — în HTML (fișierul standard de
marcaje, pe care îl importă toate browserele principale), JSON, CSV sau
Markdown.
• Editează arborele de marcaje: căutare, redenumire, mutare și reordonare
prin tragere, sortarea unui dosar A→Z, dosare noi, ștergere și găsirea
linkurilor duplicate.
CONFIDENȚIALITATE PRIN DESIGN
• Funcționează în întregime pe dispozitivul dumneavoastră. Fără servere, fără
statistici, fără urmărire.
• Doar două permisiuni: „bookmarks” (rostul extensiei) și „storage” (setările
dumneavoastră). Nimic altceva.
• Gratuit și open source (GPL-3.0) — puteți citi codul pe GitHub.
LIMBI
English · Tiếng Việt · 日本語 · 简体中文 · Română
LIMITĂRI (CU SINCERITATE)
• Pictogramele site-urilor nu pot fi importate — API-ul pentru marcaje al
extensiilor nu are un câmp pentru ele.
• Marcajele importate primesc data de azi — browserele nu permit extensiilor să
seteze data originală de creare a unui marcaj. Fișierele exportate păstrează
datele reale.
• CSV este o vedere aplatizată: dosarele goale și „care dosar este bara de
marcaje” nu se păstrează. Pentru o copie de rezervă fidelă, folosiți HTML sau
JSON.
Cod sursă, raportarea problemelor și politica de confidențialitate:
https://github.com/poli0981/bookmarkmagic
```
**Edge Add-ons:** categoria *Productivity* · același URL al politicii de
confidențialitate.
+52 -2
View File
@@ -56,9 +56,9 @@ https://github.com/poli0981/bookmarkmagic
Lưu ý: các tài liệu pháp lý chỉ có bản tiếng Anh (`docs/14`), nên URL chính sách
riêng tư giống hệt bản EN.
## Firefox Add-ons và Microsoft Edge Add-ons (từ v1.3.0)
## Firefox Add-ons (từ v1.3.0)
Dùng phần mô tả ở trên, thay hai gạch đầu dòng có nhắc Chrome bằng hai dòng sau — trên Firefox và Edge, viết như cũ sẽ không đúng (Edge cũng từ chối listing tự giới thiệu là tiện ích Chrome):
Dùng phần mô tả ở trên, thay hai gạch đầu dòng có nhắc Chrome bằng hai dòng sau — trên Firefox, viết như cũ sẽ không đúng:
```
• Nhập tệp bookmark (HTML, JSON, CSV) — kể cả tệp "Bookmarks" trong thư mục
@@ -83,4 +83,54 @@ Riêng Firefox Add-ons, thêm vào phần GIỚI HẠN:
giấy phép *GNU General Public License v3.0* · chỉ Firefox (máy tính) · cùng
URL chính sách quyền riêng tư.
## Microsoft Edge Add-ons (từ v1.3.0)
Một bản mô tả riêng, dán nguyên khối. Chính sách nhà phát triển của Edge (1.1.2)
không cho listing nhắc đến trình duyệt khác, và Partner Center cảnh báo khi mô
tả có tên trình duyệt nào — ngày 2026-11-18 nó đã báo vì chữ "Firefox". Vì vậy
bản này không nêu tên trình duyệt nào ngoài Edge: gạch về nhập tệp mô tả tệp
theo đúng bản chất của nó, gạch về xuất tệp ghi "mọi trình duyệt phổ biến" thay
cho danh sách bảy cái tên. `tests/unit/store-listing.test.ts` báo lỗi nếu một
cái tên quay lại.
```
Chuyển bookmark giữa các trình duyệt theo cách đơn giản nhất: bằng một tệp.
Không tài khoản. Không đồng bộ đám mây. Hoàn toàn offline.
TIỆN ÍCH NÀY LÀM GÌ
• Nhập tệp bookmark (HTML, JSON, CSV) — kể cả tệp "Bookmarks" mà Edge và các
trình duyệt tương tự lưu trong thư mục hồ sơ, cùng bản sao lưu bookmark dạng
JSON — và xem trước đầy đủ trước khi ghi bất cứ thứ gì: số lượng, thư mục
và mục trùng lặp.
• Chọn cách nhập: vào một thư mục mới theo ngày (mặc định an toàn), gộp vào
các thư mục bạn đã có, hoặc thay thế toàn bộ (cho biết chính xác những gì
sẽ bị xóa và lưu bản sao lưu an toàn trước).
• Có thể bỏ qua các liên kết bạn đã có.
• Xuất toàn bộ — hoặc chỉ những thư mục bạn chọn — ra HTML (tệp bookmark
chuẩn mà mọi trình duyệt phổ biến đều nhập được), JSON, CSV hoặc Markdown.
• Chỉnh sửa cây bookmark: tìm kiếm, đổi tên, kéo thả để di chuyển hoặc đổi
thứ tự, sắp xếp thư mục A→Z, tạo thư mục, xoá và tìm liên kết trùng lặp.
RIÊNG TƯ NGAY TỪ THIẾT KẾ
• Chạy hoàn toàn trên máy bạn. Không máy chủ, không phân tích, không theo dõi.
• Chỉ hai quyền: "bookmarks" (chính là mục đích của tiện ích) và "storage"
(thiết lập của bạn). Không gì khác.
• Miễn phí & mã nguồn mở (GPL-3.0) — bạn có thể đọc mã trên GitHub.
NGÔN NGỮ
English · Tiếng Việt · 日本語 · 简体中文 · Română
GIỚI HẠN (NÓI THẲNG)
• Không thể nhập favicon — API bookmark của trình duyệt không có trường
favicon.
• Bookmark được nhập vào sẽ mang ngày hôm nay — trình duyệt không cho phép tiện
ích đặt lại ngày tạo gốc của một bookmark. Các tệp bạn xuất ra vẫn giữ ngày
thật.
• CSV là dạng phẳng: thư mục rỗng và thông tin "thư mục nào là thanh bookmark"
sẽ không được giữ lại. Hãy dùng HTML hoặc JSON nếu muốn sao lưu trung thực.
Mã nguồn, nơi báo lỗi & chính sách riêng tư:
https://github.com/poli0981/bookmarkmagic
```
**Edge Add-ons:** danh mục *Productivity* · cùng URL chính sách quyền riêng tư.
+45 -2
View File
@@ -55,9 +55,9 @@ https://github.com/poli0981/bookmarkmagic
法律文件仅有英文版本(`docs/14`),隐私政策 URL 与英文版相同。
## Firefox Add-ons 与 Microsoft Edge Add-ons(v1.3.0 起)
## Firefox Add-ons(v1.3.0 起)
使用上面的描述,并把提到 Chrome 的两条换成下面两条——原文在 Firefox 和 Edge 上并不成立(Edge 也不接受把自己介绍为 Chrome 扩展程序的页面):
使用上面的描述,并把提到 Chrome 的两条换成下面两条——原文在 Firefox 上并不成立:
```
• 导入书签文件(HTML、JSON、CSV)——包括 Chromium 内核浏览器(Chrome、Edge、
@@ -80,4 +80,47 @@ https://github.com/poli0981/bookmarkmagic
**Firefox Add-ons:** 摘要 = 上面的摘要 · 类别 *Bookmarks* · 许可证
*GNU General Public License v3.0* · 仅限 Firefox(桌面版)· 相同的隐私政策 URL。
## Microsoft Edge Add-ons(v1.3.0 起)
使用一份单独的完整描述,整段粘贴。Edge 的开发者政策(1.1.2)规定商品页面不得提及
其他浏览器,描述中出现浏览器名称时 Partner Center 也会发出警告(2026-11-18 曾因
“Firefox”而警告)。因此这份描述除 Edge 外不提任何浏览器;若有名称被加回,
`tests/unit/store-listing.test.ts` 会失败。
```
在浏览器之间转移书签,最简单的方式就是用一个文件。无需账户,没有云同步,
100% 离线运行。
功能
• 导入书签文件(HTML、JSON、CSV)——包括 Edge 等浏览器保存在个人资料文件夹中的
“Bookmarks”文件,以及 JSON 格式的书签备份。写入任何内容之前都会先完整预览:
数量、文件夹和重复项一目了然。
• 自选导入方式:放入一个带日期的新文件夹(安全的默认选项)、合并到您已有的
文件夹,或全部替换(会准确显示将删除的内容,并先保存一份安全备份)。
• 可以跳过您已有的链接。
• 导出全部书签,或只导出您选择的文件夹,格式可选 HTML(各主流浏览器都能导入的
标准书签文件)、JSON、CSV 或 Markdown。
• 编辑书签树:搜索、重命名、拖动以移动或重新排序、将文件夹按 A→Z 排序、
新建文件夹、删除,以及查找重复的链接。
隐私至上的设计
• 完全在您的设备上运行。没有服务器,没有分析,没有跟踪。
• 只有两项权限:“bookmarks”(核心功能)和“storage”(保存您的设置)。
仅此而已。
• 免费且开源(GPL-3.0)——可在 GitHub 上查看代码。
语言
English · Tiếng Việt · 日本語 · 简体中文 · Română
局限(坦诚说明)
• 无法导入网站图标——扩展程序的书签 API 没有网站图标字段。
• 导入的书签日期为今天——浏览器不允许扩展程序设置书签的原始创建日期。
您导出的文件会保留真实日期。
• CSV 是扁平化的视图:空文件夹以及“哪个文件夹是书签栏”都不会保留。
如需完整备份,请使用 HTML 或 JSON。
源代码、问题跟踪和隐私政策:
https://github.com/poli0981/bookmarkmagic
```
**Edge Add-ons:** 类别 *Productivity* · 相同的隐私政策 URL。
+62
View File
@@ -0,0 +1,62 @@
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { describe, expect, it } from 'vitest';
import { LOCALES, type Locale } from '@/lib/i18n/resolve-locale';
import { CHROME_LOCALE_DIRS } from '../helpers/locales';
/**
* The Microsoft Edge Add-ons copy in `store/listing.*.md` — docs/13 §9.
*
* Edge's developer policy (1.1.2) says a listing must not reference other
* browsers, and Partner Center flags a browser name in the description. It did
* on 2026-11-18, for "Firefox", in a copy that was then "the Chrome Web Store
* description with two bullets swapped" — the swap had left the export bullet's
* list of seven browsers in place. So the Edge copy is a complete description
* of its own, and nothing else would notice a name pasted back into it.
*/
const ROOT = process.cwd();
const read = (path: string): string => readFileSync(join(ROOT, path), 'utf8');
const listing = (locale: Locale): string => read(`store/listing.${CHROME_LOCALE_DIRS[locale]}.md`);
/**
* Every browser the listings name, Edge excepted. Bounded by ASCII letters
* only, so a name that runs straight into CJK text ("Chrome的") still matches,
* while a word that merely starts with one ("operare") does not.
*/
const OTHER_BROWSERS =
/(?<![A-Za-z])(?:Chrome|Chromium|Firefox|Mozilla|Brave|Safari|Vivaldi|Opera|Netscape|Internet Explorer)(?![A-Za-z])/giu;
/** The fenced blocks between the Edge heading and the next `## ` heading. */
function edgeDescriptions(text: string): string[] {
const [, after = ''] = text.split(/^## Microsoft Edge Add-ons.*$/mu);
const [section = ''] = after.split(/^## /mu);
return [...section.matchAll(/^```\n([\s\S]*?)\n```$/gmu)].map((match) => match[1] ?? '');
}
describe('the Microsoft Edge Add-ons listing', () => {
it.each(LOCALES)('%s has one complete description, pasted whole', (locale) => {
const descriptions = edgeDescriptions(listing(locale));
// One block, not a recipe of bullets to swap: the recipe is how the Chrome
// Web Store's list of browsers reached Partner Center.
expect(descriptions).toHaveLength(1);
// Partner Center accepts 250 to 5,000 characters.
const length = descriptions[0]?.length ?? 0;
expect(length).toBeGreaterThanOrEqual(250);
expect(length).toBeLessThanOrEqual(5000);
});
it.each(LOCALES)('%s names no browser but Edge', (locale) => {
const [description = ''] = edgeDescriptions(listing(locale));
expect(description.match(OTHER_BROWSERS) ?? []).toEqual([]);
});
it.each(LOCALES)('%s still names them in the Chrome Web Store copy', (locale) => {
// That copy lists the browsers on purpose. A pattern that found nothing
// there would let the check above pass on any text at all.
const [chromeWebStoreCopy = ''] = listing(locale).split(/^## /mu);
expect(chromeWebStoreCopy.match(OTHER_BROWSERS)).toEqual(
expect.arrayContaining(['Chrome', 'Brave', 'Firefox', 'Safari', 'Vivaldi', 'Opera']),
);
});
});