Compare commits

...
23 Commits
Author SHA1 Message Date
poli0981andClaude Opus 5.5 e8117c2000 docs: Edge Add-ons is live; record the v1.3.0 submissions
The owner submitted v1.3.0 to all three stores on 2026-11-18, and Edge
Add-ons approved it on 2026-11-19: the first Edge version, public, five
languages. The Chrome Web Store update and the first Firefox Add-ons
version are still in review.

- README: the Edge row of the install table links the listing, and an
  Edge Add-ons version badge (a shields dynamic badge over the store's
  public getproductdetailsbycrxid JSON) sits beside the Chrome Web Store
  one.
- docs/00: the Type line and v1.3.0 status; §9 gains the Edge item id
  (CRX ID), Product ID, Store ID and listing; §10 items 20-22 and 24
  record what was submitted, what is live and what is still open (the
  11 §5 passes have no recorded result; sync-on Edge is still unverified).
  The 1.2.1 paragraph says it never went up on its own.
- docs/13 §9: the About link matches the CRX ID, not the Product ID; done
  for 1.3.0.
- docs/15: v1.2.1 submission skipped; v1.3.0 submitted; v1.3.0 live on
  Edge; Chrome Web Store and Firefox Add-ons in review.
- CLAUDE.md: the banner and the Phase 10 exit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 07:21:17 +07:00
poli0981andClaude Opus 5.5 9a545464b8 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>
2026-11-19 07:21:17 +07:00
poli0981andClaude Opus 5.5 1657646b01 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>
2026-11-18 23:45:49 +07:00
poli0981andClaude Opus 5.5 bcc4c81a8c docs(01): knip 6.45.1, after Dependabot #45
The hand sync every Dependabot bump needs: docs/01 §2 names the version
the lockfile holds, and Dependabot only moves the lockfile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:21:38 +07:00
poli0981andClaude Opus 5.5 46093b7bd1 docs: record v1.3.0 as released
v1.3.0 is tagged (signed, on 80c7190) and released: three packages and
SHA256SUMS.txt, each checksum verified after download, and both manifests
passing check-manifest as downloaded. Nothing is submitted to a store yet.

- CLAUDE.md: the banner names 1.3.0 and what it is; the doc index points
  at docs/08's Firefox and Edge sections; Phase 10 gets its exit and two
  things to carry forward (no Firefox in CI; every change ships in two
  packages).
- docs/00: the Type line says Firefox; a v1.3.0 status paragraph; doc
  suite 1.13.
- docs/15: "v1.3.0 released" with the checksums and sizes, and
  "v1.3.0 submitted" pending for the owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:21:38 +07:00
dependabot[bot] 938ad5d8ab chore(deps-dev): Bump knip
Bumps the dev-minor-and-patch group with 1 update: [knip](https://github.com/webpro-nl/knip/tree/HEAD/packages/knip).


Updates `knip` from 6.44.2 to 6.45.1
- [Release notes](https://github.com/webpro-nl/knip/releases)
- [Commits](https://github.com/webpro-nl/knip/commits/knip@6.45.1/packages/knip)

---
updated-dependencies:
- dependency-name: knip
  dependency-version: 6.45.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-18 22:16:05 +07:00
poli0981andClaude Opus 5.5 80c7190864 chore(release): 1.3.0
Firefox and Microsoft Edge Add-ons, and maintenance mode. Permissions are
unchanged; nothing re-asks for consent (LEGAL_VERSION stays 1).

- package.json and the lockfile's root at 1.3.0; CHANGELOG [1.3.0] with
  Added / Changed / Fixed / Packages.
- docs/00 §10 items 19-26: what only the owner can do for this release
  (the store uploads, the first AMO and Edge submissions by hand, the store
  environments, real-browser QA, native review).
- docs/15: Phase 10 in the progress table; 1.2.1 may be skipped on the
  store, since 1.3.0 contains it.
- docs/13 §8: the sources archive rebuilt every file of the Firefox
  package byte for byte. docs/08 §9: Options can open a second Manager tab
  on Firefox.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:10:35 +07:00
poli0981andClaude Opus 5.5 ffceb4bd54 fix: review findings — separators are not items, Replace counts what it deletes
An adversarial review of the Firefox port found:

- #edit treated a Firefox separator as an item in three places: a folder's
  count badge, whether a folder can be expanded, and whether it can be
  sorted. A folder of separators and one bookmark offered Sort A-Z.
- Replace's confirmation counted every writable root, so a signed-in
  Chrome's account roots, which Replace never empties, were counted among
  what it would delete. In every release since 1.1.0; it now counts the
  replaceable roots only.
- The store jobs checked their files against the SHA256SUMS.txt that came
  in the same artifact, with --ignore-missing. Each file is now checked by
  name against the published Release's checksums.
- Qodana's publish job ran only after a successful scan, so a scan failing
  on findings never published them.
- getRoots' position fallback had no test. It now has two, with unknown
  ids and a Bookmarks Menu listed first.

Docs follow: the two browser modules and the warning codes (02), where the
landed index is compared (05), the separator markup and folder count (06),
what the Firefox suites are (11), the release staging and environments
limited to v* tags (12, 00), and which loose entries reach the Bookmarks
Menu on Firefox (03, 04, README).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:10:35 +07:00
poli0981andClaude Opus 5.5 23f6386d3d docs: Firefox and Edge for users — install, build, limits, listings
- BUILD.md: rebuilding the release packages, written for Firefox Add-ons'
  source review (Node.js 26 stated outright: the sources archive drops
  .nvmrc), and useful to anyone checking a store build against the source.
- README: a browser/store/requirement table (Edge and Firefox listings not
  live yet, and said so), the Firefox package on each Release is for
  checking, not installing; the privacy section names the same CSP in every
  browser; limits gain Firefox's separators, address and title lengths.
- SECURITY.md: the latest version on each of the three stores is supported.
- ACCESSIBILITY.md: Firefox and Edge are best effort and untested with
  assistive technology; separators are drawn but not announced, and Alt+↑/↓
  past one leaves the spoken position unchanged — a known limitation.
- store/listing.*.md: the AMO and Edge blocks — the two bullets that named
  Chrome rewritten for browsers in general, one more limitation for Firefox,
  and each store's fields. Translations best-effort.
- CHANGELOG: the 1.3.0 entry under [Unreleased] until the bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:10:35 +07:00
poli0981andClaude Opus 5.5 dc4cd06cbb ci: build both packages, and publish to three stores from isolated jobs
- ci.yml: the Firefox package is built and checked beside the Chrome one.
- release.yml: three release files — the Chromium package (Chrome Web Store
  and Edge Add-ons), the Firefox package and AMO's sources archive — each
  staged by exact name so a missing one fails the run, both manifests checked
  against the tag, SHA256SUMS over all three.
- One store job per store (docs/12 §3), each off until its repo variable is
  true, each in its own GitHub Environment holding only its own secrets, each
  checking the downloaded file against SHA256SUMS before uploading. They
  install tools/publish — publish-browser-extension 6.2.0 and its three
  dependencies, from their own lockfile, scripts off — instead of the ~320
  packages of the dev toolchain, which the single old job installed next to
  four Chrome secrets.
- The old job could not have worked: it sent CWS API v1.1 credentials, and
  v1.1 was shut down on 2026-10-15. store-chrome uses v2 (publisher id and a
  service account) and sets CHROME_API_VERSION explicitly. store-firefox is
  listed and desktop-only; store-edge sends the Chromium package.
- Dependabot watches tools/publish; the licence gate reads its lockfile too.
- qodana.yaml: clean since the first run's findings were handled, so any new
  one now fails that (non-required) workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:10:35 +07:00
poli0981andClaude Opus 5.5 2eaa1acce4 feat(firefox): the right roots, the Bookmarks Menu, separators and move index
What made Firefox more than a build target (docs/02 §4, 03, 04, 05 §10):

- Roots. getRoots (now browser/roots.ts) tries Firefox's GUIDs after
  folderType and the Chromium ids, and never takes the Bookmarks Menu by
  position — Firefox lists it first, and the old fallback took it for the
  bar, so a Replace emptied the Menu and the toolbar and restored into the
  wrong roots. The Menu is a fourth destination Replace also empties.
- The Menu in the file model: root "menu" (BM JSON, additive); HTML writes
  its entries loose at the top level, as Firefox's own export does; on
  Firefox loose top-level entries are routed into the Menu, elsewhere a menu
  folder stays a folder under Other. New-folder mode is unchanged.
- Separators come back as { type: "separator", url: "data:" }. Recognised by
  type (browser/live-tree.ts): left out of exports and backups, of every
  count, of the dedupe index and the duplicate finder, never a search match;
  in #edit they are aria-hidden lines that take no focus or command, with
  posinset counting items only, Alt+↑/↓ stepping past one as one place, and
  Sort A→Z sorting each run between them. The Replace confirmation says how
  many will go and that nothing brings them back; files' separators are
  counted (SEPARATORS_SKIPPED).
- Move index: Chromium counts a rightward same-folder move before removal,
  Firefox after. The adapter sends each its own number and the reply's index
  is checked — a mismatch re-reads the tree. Before this, every rightward drag
  on Firefox landed one place too far and Alt+↓ moved two.
- Firefox refuses addresses over 65 536 characters, mid-write: dropped before
  planning on Firefox (URL_TOO_LONG); nothing changes on Chromium.
- Strings true in every browser: the date note says "the browser", the About
  link is "Store listing" and goes to the listing the copy came from (AMO by
  gecko id, the Chrome Web Store by item id, else the README's install
  section); the smart-bookmark note drops "dead link". Diagnostics names the
  browser. All five locales (ja/zh-CN/ro best-effort).

bookmarks.ts was over the 300-line target, so its pure half moved to
live-tree.ts and root resolution to roots.ts before anything was added.
Tests run the root, Replace, export and #edit paths over a Firefox flavour of
the fake (docs/11 §4). Also fixes the last Qodana finding, a redundant escape
in the i18n interpolation regex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:10:35 +07:00
poli0981andClaude Opus 5.5 779335802a build(firefox): a second package, MV3, held to its own manifest gate
wxt.config.ts now builds for the target browser (docs/08 §1, §9):

- `manifestVersion: 3` for every target — WXT built Firefox as MV2;
- Firefox gets browser_specific_settings.gecko — the permanent id
  bookmarkmagic@poli0981.dev, strict_min_version 140.0 (the first that
  accepts data_collection_permissions, which AMO requires of new add-ons),
  and data_collection_permissions { required: ["none"] } — and no
  minimum_chrome_version; Chrome keeps its floor of 136;
- Vite targets firefox140 for that package;
- the sources archive AMO reviews leaves out coverage, captures, store copy,
  docs, tests and tools.

Permissions, CSP, pages and icons are identical in both packages.
check-manifest.mjs takes --browser chrome|firefox, mapped through a fixed
table to .output/<target>-mv3 (still no path from the command line), and
pins each package's exact key set and floor; the gecko block is compared key
order aside. New npm scripts: build:firefox, zip:firefox; verify:full builds
and checks both packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:10:35 +07:00
poli0981andClaude Opus 5.5 355443ef6b docs: specify Firefox (AMO) and Edge Add-ons support for v1.3.0
Docs first, as CLAUDE.md requires; the code follows in this branch.

- 08: the manifest per target (two packages from one source, MV3 for
  both); Firefox's gecko id, data-collection declaration, floor 140 and
  source-code submission; Edge takes the Chrome package unchanged.
- 02 §4, 03 §1/§3, 04, 05 §10: Firefox's GUID roots and fourth root, the
  Bookmarks Menu (`root: "menu"`, unmarked entries routed into it on
  Firefox); separators recognised by type, kept out of the file model and
  shown as untouchable lines in #edit; the move index sent by each browser's
  own rule and checked against the reply; addresses Firefox refuses dropped
  before planning; separators a file holds counted.
- 06/07: the About link follows the install; three strings that blamed
  Chrome for what every browser does are reworded; new keys listed.
- 11: a Firefox flavour of the fake, and a manual pass on real Firefox and
  Edge (including Edge signed in with sync) before the first submissions.
- 12/13: three store jobs, each in its own environment with only its own
  secrets and a four-package install; CWS API v2 (v1.1 died 2026-10-15);
  AMO and Edge runbooks for the first, manual uploads.
- 09/14 and legal/: three stores named; a clarification, not a
  LEGAL_VERSION bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:10:35 +07:00
poli0981andClaude Opus 5.5 8519e7c39e fix(qodana): act on the first run, and read the report where it really is
The first scan found 27 issues and no defect:
- two regular expressions that could be simpler, fixed: the sanitizer's
  [\p{Extended_Pictographic}] class and wxt.config.ts's split(/[/]/). A third
  is in src/ and waits for the 1.3.0 change, so this branch still builds
  byte-for-byte what v1.2.1 shipped;
- 24 that contradict a rule of this repository, switched off in
  qodana.yaml with the reason beside each: JSDoc completeness (doc comments
  here are prose, docs/10 §6), bitwise operators in the PNG CRC-32 of
  gen-icons.mjs, and the deliberately doubled dark palette in tokens.css.

`publish` failed: the qodana-report artifact holds a zip whose entries have
absolute names, so a glob for the SARIF found nothing. It now extracts the
one entry /qodana.sarif.json by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 21:03:47 +07:00
poli0981andClaude Opus 5.5 76a57fb739 docs: GO for Firefox and Edge as v1.3; the roadmap under maintenance mode
Recorded now rather than with the port, because the maintenance
announcement names it (docs/15, docs/00 §7). Settled with the owner: gecko
id bookmarkmagic@poli0981.dev, desktop only (Firefox for Android has no
bookmarks API), MV3 everywhere, and Firefox separators shown, protected and
warned about rather than stored in a file format.

The roadmap is pruned to what MAINTENANCE.md allows: scheduled snapshots
need the alarms permission and leave it; the permission rule joins the never
list; the fflate zip export, the duplicate auto-merge assistant and
bookmarklet notes are not planned; the old v1.3 "resilience" becomes v1.4.

MAINTENANCE.md no longer lists "a dependency advisory" as a release trigger
on its own: with no runtime dependencies, an advisory against the build
tools needs a release only if it changed what ships.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 21:03:47 +07:00
poli0981andClaude Opus 5.5 0ec5187e4b ci: Qodana for JS, and a harder triage workflow
qodana.yml runs qodana-js (Ultimate, QODANA_TOKEN) on pushes to main, pull
requests, a weekly schedule and by hand, in two jobs (docs/12 §2.7):

- `scan` installs the dev dependencies with scripts off — qodana-js resolves
  types through them — and holds only a read-only GITHUB_TOKEN; PR comments
  and annotations are off, the SARIF report is kept as an artifact;
- `publish` installs nothing and uploads that SARIF to code scanning
  (category qodana), so the findings sit beside CodeQL's.

The action is pinned to the commit of v2026.2.2 (the newest tag is younger
than the 7-day cooldown). Sharing a runner with dependency code is recorded
as an exception to the Sonar rule: the token can only upload reports.

triage.yml, from review of the first draft:
- comment and close first, label last — the label is what a re-run reads as
  done, so it must not exist before the work;
- an `enhancement` issue with no answer to the form is closed only when the
  owner added the label; otherwise it goes to needs-triage;
- checkout and setup-node pinned to commits, no cache: this workflow runs
  them with a write token on events anyone can trigger.

README gains the Qodana badge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 21:03:47 +07:00
poli0981andClaude Opus 5.5 eabffbe652 feat(repo): maintenance mode, with triage that closes out-of-policy requests
MAINTENANCE.md is the policy: dependency updates on a schedule, high and
critical advisories fixed as soon as a fix exists, major platform upgrades,
bug/UI/UX/accessibility/translation fixes, and features only when they are
on docs/15's roadmap or genuinely needed.

- The feature form asks one required question — on the roadmap, needed for
  a fix, or something new — and links the policy and Discussions › Ideas.
- scripts/triage.mjs decides what happens, as a pure, unit-tested function;
  .github/workflows/triage.yml carries it out with `gh` alone. Something new
  is labelled maintenance-mode, commented and closed as not planned; the two
  in-policy answers get needs-triage; an outside `feat…` pull request is
  closed the same way. Owner, members, collaborators, bots and `roadmap` are
  exempt.
- pull_request_target checks out the base branch only, runs nothing from the
  pull request, and never interpolates a title or body into the shell.
- README gains a status badge and a "Project status" section; CONTRIBUTING,
  the PR template and the issue chooser say what is accepted.
- docs: 00 status, 11 inventory, 12 §2.6 and §5 (labels), 13 §6, 15 (a
  pointer to the policy, not a copy, and the decision-log rows); CLAUDE.md
  Phase 10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 21:03:47 +07:00
poli0981andClaude Opus 5.5 11e7e50fe6 build: a licence gate over every package in the lockfile
scripts/check-licenses.mjs reads package-lock.json, where npm records each
package's own `license` field, and fails on anything outside two lists
(docs/09 §3.2):

- what the build compiles into the extension (svelte, clsx, wxt,
  @wxt-dev/browser) must be permissive and GPL-3.0-compatible;
- everything else is build tooling that never ships, so file-level copyleft
  (MPL-2.0, lightningcss) is also accepted; AGPL, source-available terms and
  missing or custom licences are not.

SPDX expressions are evaluated, nothing is installed or fetched, and the
tests call the functions directly rather than spawning the script. It runs
in `verify`, CI's quality job and the release build.

The shipped list moves out of wxt.config.ts into
scripts/credited-packages.mjs, so the build gate, the notices test and the
licence gate read one list instead of two copies and a regex.

legal/THIRD_PARTY_NOTICES.md said the tooling was all MIT/Apache-2.0/ISC; the
lockfile also has BSD, 0BSD, MIT-0, BlueOak, CC0 and MPL-2.0. Corrected — a
description of tooling that never ships, so no LEGAL_VERSION bump (14 §3.1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 21:03:47 +07:00
poli0981andClaude Opus 5.5 4b10749582 chore(deps): finish the Dependabot bumps and record the picomatch advisory
Dependabot's #39-#41 moved the packages and left the rest behind, as
docs/15 (2026-11-10) says it always does:

- biome.json and docs/10 name the schema of Biome 2.6.6;
- docs/01 records Biome 2.6.6, knip 6.44.2 and jsdom ^31.0;
- docs/12 §2.5 names the scan action's new pin, v8.4.1;
- docs/11 §6 gains a jsdom 31 column for the 100k parse (median of three
  runs, 2 484 ms) instead of overwriting the jsdom 29 figure.

docs/09 §3.1: npm audit now reports 14 high findings with one root cause,
picomatch GHSA-fc5q-39xc-vjpf, for which no fixed version exists. It is the
toolchain's glob engine, matching patterns this repository writes, and
never ships (--omit=dev stays 0). The deepmerge row goes: GitHub withdrew
that advisory on 2026-11-16.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 21:03:47 +07:00
dependabot[bot] 77de0de1d5 chore(deps-dev): Bump jsdom from 30.1.3 to 31.0.0
Bumps [jsdom](https://github.com/jsdom/jsdom) from 30.1.3 to 31.0.0.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Commits](https://github.com/jsdom/jsdom/compare/v30.1.3...v31.0.0)

---
updated-dependencies:
- dependency-name: jsdom
  dependency-version: 31.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-18 20:32:06 +07:00
dependabot[bot] 43681ecd1f chore(deps-dev): Bump the dev-minor-and-patch group with 2 updates
Bumps the dev-minor-and-patch group with 2 updates: [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) and [knip](https://github.com/webpro-nl/knip/tree/HEAD/packages/knip).


Updates `@biomejs/biome` from 2.6.4 to 2.6.6
- [Release notes](https://github.com/biomejs/biome/releases)
- [Changelog](https://github.com/biomejs/biome/blob/main/CHANGELOG_v1.md)
- [Commits](https://github.com/biomejs/biome/commits/@biomejs/biome@2.6.6/packages/@biomejs/biome)

Updates `knip` from 6.44.1 to 6.44.2
- [Release notes](https://github.com/webpro-nl/knip/releases)
- [Commits](https://github.com/webpro-nl/knip/commits/knip@6.44.2/packages/knip)

---
updated-dependencies:
- dependency-name: "@biomejs/biome"
  dependency-version: 2.6.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-minor-and-patch
- dependency-name: knip
  dependency-version: 6.44.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-18 20:26:58 +07:00
dependabot[bot] 6047f5bf30 ci(deps): Bump SonarSource/sonarqube-scan-action
Bumps the actions group with 1 update: [SonarSource/sonarqube-scan-action](https://github.com/sonarsource/sonarqube-scan-action).


Updates `SonarSource/sonarqube-scan-action` from 8.4.0 to 8.4.1
- [Release notes](https://github.com/sonarsource/sonarqube-scan-action/releases)
- [Commits](https://github.com/sonarsource/sonarqube-scan-action/compare/4d1dc0c91ee400dcf8a6dddf2f705ac36542e304...e805d875275f728fac1885b413934be6d7c63f65)

---
updated-dependencies:
- dependency-name: SonarSource/sonarqube-scan-action
  dependency-version: 8.4.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-18 20:26:38 +07:00
poli0981andClaude Fable 5.2 47206cc6c2 docs: record v1.2.1 as released on GitHub
Signed tag v1.2.1 on d61318a (PR #37, merged at the reviewed head). The
Release asset verifies against SHA256SUMS.txt (4975b5df…ca13254, 106 290
bytes); its manifest differs from 1.2.0's in `version` alone and the file
inventory is the same. `announce` and the store publish were skipped, as
their variables are unset.

Still the owner's: the docs/11 §5 pass with the 1.2.0 -> 1.2.1 upgrade over
an existing profile, a real Windows contrast theme and a screen-reader pass
over Alt+Up/Down, and the store upload.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 11:29:46 +07:00
126 changed files with 5546 additions and 1048 deletions

No files matched your search

+7
View File
@@ -6,6 +6,13 @@
blank_issues_enabled: false
contact_links:
- name: An idea, to talk through first
url: https://github.com/poli0981/bookmarkmagic/discussions/categories/ideas
about: >-
BookmarkMagic is in maintenance mode (MAINTENANCE.md). A new idea is
welcome here, where it can be discussed without an issue that has to be
accepted or refused.
- name: Security vulnerability
url: https://github.com/poli0981/bookmarkmagic/security/advisories/new
about: Report privately, never as a public issue. See SECURITY.md.
+41 -11
View File
@@ -1,20 +1,50 @@
name: Suggest a feature
description: An idea for something BookmarkMagic should do.
description: BookmarkMagic is in maintenance mode — read what that means before asking for something new.
title: '[feature] '
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Before writing: this project has a short, deliberate
[never list](https://github.com/poli0981/bookmarkmagic/blob/main/docs/15_ROADMAP.md).
Cloud sync, accounts, analytics of any kind, and anything that would
require new browser permissions are out of scope permanently — not
because they are hard, but because "offline, two permissions, no
network" is the entire point of the extension.
**BookmarkMagic is in maintenance mode**
([MAINTENANCE.md](https://github.com/poli0981/bookmarkmagic/blob/main/MAINTENANCE.md)).
A feature is added only when it is already on the
[roadmap](https://github.com/poli0981/bookmarkmagic/blob/main/docs/15_ROADMAP.md),
or when it is genuinely needed to fix a defect or remove a barrier.
Everything else is genuinely open. The roadmap in that same file lists
what is already planned.
**The first question below decides what happens to this issue.** A
request for something new is closed automatically and labelled
`maintenance-mode` — not deleted, and read; the
[Ideas discussions](https://github.com/poli0981/bookmarkmagic/discussions/categories/ideas)
are the place to talk one through. The other two answers keep the issue
open for the maintainer.
Out of scope permanently, whatever the mode: cloud sync, accounts,
analytics of any kind, and anything that would need a new browser
permission. "Offline, two permissions, no network" is the point of the
extension.
- type: dropdown
id: kind
attributes:
label: Which kind of change is this?
description: See MAINTENANCE.md. Please answer honestly — a mislabelled request is closed by hand.
options:
- Something already on the roadmap (docs/15)
- Needed to fix a bug, a UI/UX defect or an accessibility barrier
- Something new — not on the roadmap
validations:
required: true
- type: input
id: reference
attributes:
label: Which roadmap item, or which defect?
description: >-
The line in docs/15, or the issue or behaviour it fixes. Leave empty
for something new.
validations:
required: false
- type: textarea
id: problem
@@ -52,5 +82,5 @@ body:
permission, and does not involve a server, an account, or sending
data anywhere.
required: true
- label: I checked the roadmap and the never list.
required: false
- label: I read MAINTENANCE.md and checked the roadmap and the never list.
required: true
+7
View File
@@ -7,6 +7,13 @@ a translation fix does not need the parser section, and vice versa.
<!-- What changes, and what problem it solves. Link the issue if there is one. -->
**Kind of change** ([MAINTENANCE.md](https://github.com/poli0981/bookmarkmagic/blob/main/MAINTENANCE.md) — the project
is in maintenance mode): <!-- bug fix · UI/UX fix · accessibility · translation
· dependency or security update · roadmap item (which?) -->
A pull request titled `feat…` from outside the project is closed automatically
unless its feature is on the roadmap — open a feature request first.
## Checklist
- [ ] `npm run verify` is green. (Release-bearing? `npm run verify:full` —
+16
View File
@@ -56,6 +56,22 @@ updates:
- dependency-name: '@types/node'
update-types: [version-update:semver-major]
# The store-upload tool release.yml installs on its own (docs/12 §3): four
# packages, kept apart from the toolchain because they run beside store
# credentials. Its own directory, so its bumps arrive as their own PRs.
- package-ecosystem: npm
directory: /tools/publish
schedule:
interval: weekly
day: monday
open-pull-requests-limit: 2
cooldown:
default-days: 7
commit-message:
prefix: chore
prefix-development: chore
include: scope
- package-ecosystem: github-actions
directory: /
schedule:
+6
View File
@@ -45,6 +45,9 @@ jobs:
- run: npm run knip
- run: npm run coverage # vitest --coverage, thresholds per docs/11 §1
- run: npm run guard # the zero-network / no-raw-HTML gate, docs/08 §3
# Every licence in the lockfile, shipped packages held to the stricter
# list (docs/09 §3.2). Reads package-lock.json only — no network.
- run: npm run check:licenses
# Zero runtime dependencies is a public claim (README, docs/09 T5); this
# is the check that keeps it true. Dev-only advisories are tracked by
@@ -56,6 +59,9 @@ jobs:
# tabs/scripting/host_permissions that never appear in the config file.
- run: npm run build
- run: npm run check:manifest
# The second package (docs/08 §9), held to its own key set and floor.
- run: npm run build:firefox
- run: npm run check:manifest -- --browser firefox
windows:
# Not a required check. The owner develops on Windows, and the paths that
+129
View File
@@ -0,0 +1,129 @@
# Qodana — docs/12 §2.7.
#
# A separate workflow, like SonarCloud's: a Qodana outage or opinion must never
# change the colour of CI, which is what branch protection reads. Not a
# required check.
#
# Two jobs, least privilege first:
# - `scan` runs the analysis. qodana-js resolves types through node_modules,
# so the dev dependencies are installed here (install scripts off) — which
# means they share a runner with QODANA_TOKEN. That is the documented
# exception to docs/12 §2.5's "a token job installs nothing": the token
# only uploads reports to one Qodana Cloud project (rotate it in
# qodana.cloud if a dependency is ever found compromised), and this job's
# GITHUB_TOKEN is read-only — no PR comments, no check runs from here.
# - `publish` installs and runs nothing: it takes the SARIF report from
# `scan` and uploads it to GitHub code scanning, where the findings appear
# beside CodeQL's under "Security and quality" and on pull requests.
name: Qodana
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
schedule:
- cron: '0 15 * * 1' # weekly, Monday — an hour after CodeQL
permissions:
contents: read
concurrency:
group: qodana-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
scan:
name: Qodana for JS
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
outputs:
ran: ${{ steps.token.outputs.present }}
steps:
# Dependabot and fork pull requests get no repository secrets: skip with
# a notice instead of failing, before installing anything.
- name: Check for QODANA_TOKEN
id: token
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
run: |
if [ -n "$QODANA_TOKEN" ]; then
echo "present=true" >> "$GITHUB_OUTPUT"
else
echo "present=false" >> "$GITHUB_OUTPUT"
echo "::notice::Qodana skipped — QODANA_TOKEN is not available to this run (Dependabot or fork PR)."
fi
# The default ref — on a pull request, its merge commit — which is the
# commit code scanning attributes an upload from this run to.
- uses: actions/checkout@v7
if: steps.token.outputs.present == 'true'
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v7
if: steps.token.outputs.present == 'true'
with:
node-version-file: .nvmrc
cache: npm
# --ignore-scripts: no dependency runs code at install time (docs/12 §2).
- if: steps.token.outputs.present == 'true'
run: npm ci --ignore-scripts
- if: steps.token.outputs.present == 'true'
run: npx --no-install wxt prepare
- name: Qodana scan
if: steps.token.outputs.present == 'true'
# Pinned to a commit, not the moving `v2026.2` branch the vendor's
# snippet uses: this step holds a token. v2026.2.2 rather than the
# newest tag, which is younger than the repo's 7-day cooldown.
uses: JetBrains/qodana-action@3e8d76ff0e0241618abd808682f426afe84bab3f # v2026.2.2
with:
# Whole project every time — it is small, and a PR that touches only
# docs would otherwise scan nothing.
pr-mode: false
# Both need write permissions this job deliberately does not have;
# `publish` reports the findings through code scanning instead.
post-pr-comment: false
use-annotations: false
# The SARIF report as the `qodana-report` artifact.
upload-result: true
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
QODANA_ENDPOINT: 'https://qodana.cloud'
publish:
name: Findings to code scanning
needs: scan
# !cancelled(), not the implicit success(): with failureConditions in
# qodana.yaml, a scan that FINDS something fails — and those are exactly
# the findings that must reach code scanning and the pull request.
if: ${{ !cancelled() && needs.scan.outputs.ran == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
security-events: write
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: qodana-report
path: qodana-report
# The artifact holds one zip, qodana-report.zip, whose entries carry
# absolute names ("/qodana.sarif.json"). Take only the report, by its
# exact name, to a fixed path — nothing else is unpacked.
- name: Extract the SARIF report
run: |
set -euo pipefail
unzip -p qodana-report/qodana-report.zip /qodana.sarif.json > qodana.sarif.json
test -s qodana.sarif.json || { echo "::error::no qodana.sarif.json in the report"; exit 1; }
- uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
with:
sarif_file: qodana.sarif.json
category: qodana
+184 -39
View File
@@ -5,11 +5,16 @@
# (required by docs/09 §5), performs no store submission, and exposes no
# `outputs:`, so a caller cannot reference the zip it built.
#
# Three jobs, least privilege first. `build` installs, runs every gate and
# packages with a READ-ONLY token; only `publish`, which installs nothing and
# runs no repository code, ever holds `contents: write`. Before this split one
# job ran `npm ci` — every dependency's install script plus our own tests —
# while holding a write token that checkout had also left in .git/config.
# Least privilege first. `build` installs, runs every gate and packages with a
# READ-ONLY token; only `publish`, which installs nothing and runs no
# repository code, ever holds `contents: write`. Before the split one job ran
# `npm ci` — every dependency's install script plus our own tests — while
# holding a write token that checkout had also left in .git/config.
#
# Since v1.3.0 there are three release files: the Chromium package (the Chrome
# Web Store AND Edge Add-ons take it), the Firefox package, and the sources
# archive AMO reviews (docs/08 §9, docs/13 §1c). And three store jobs, one per
# store, each off until its repo variable says otherwise (docs/12 §3).
name: Release
on:
@@ -44,35 +49,43 @@ jobs:
- run: npm run knip
- run: npm run coverage
- run: npm run guard
- run: npm run check:licenses
- run: npm audit --omit=dev --audit-level=low
- run: npm run zip # wxt zip → .output/<name>-<version>-chrome.zip
- run: npm run zip # → .output/<name>-<version>-chrome.zip (Chrome Web Store, Edge Add-ons)
- run: npm run zip:firefox # → …-firefox.zip and …-sources.zip (Firefox Add-ons)
# Gate the artifact, not just the config it was built from. A tag is the
# last point at which an unintended permission can still be stopped.
# Gate the artifacts, not just the config they were built from. A tag is
# the last point at which an unintended permission can still be stopped.
- run: npm run check:manifest
- run: npm run check:manifest -- --browser firefox
- name: Verify tag matches manifest version
- name: Verify tag matches both manifests
run: |
set -euo pipefail
MANIFEST_VERSION=$(jq -r '.version' .output/chrome-mv3/manifest.json)
TAG_VERSION="${GITHUB_REF_NAME#v}"
test "$MANIFEST_VERSION" = "$TAG_VERSION" \
|| { echo "::error::tag $TAG_VERSION != manifest $MANIFEST_VERSION"; exit 1; }
- name: SHA256SUMS
working-directory: .output
run: sha256sum *-chrome.zip > SHA256SUMS.txt
for target in chrome firefox; do
MANIFEST_VERSION=$(jq -r '.version' ".output/${target}-mv3/manifest.json")
test "$MANIFEST_VERSION" = "$TAG_VERSION" \
|| { echo "::error::tag $TAG_VERSION != $target manifest $MANIFEST_VERSION"; exit 1; }
done
# Staged in a plain directory: upload-artifact skips hidden paths by
# default, and `.output` is one. Left there, the upload found nothing and
# the first v1.1.0 tag run failed before any Release existed — the split
# into build and publish jobs had never run on a tag until then.
# default, and `.output` is one. Each file by its exact name: a glob would
# pass with one of the three missing.
- name: Stage the release files
run: |
set -euo pipefail
VERSION="${GITHUB_REF_NAME#v}"
mkdir dist
cp .output/*-chrome.zip .output/SHA256SUMS.txt dist/
for file in "bookmarkmagic-${VERSION}-chrome.zip" \
"bookmarkmagic-${VERSION}-firefox.zip" \
"bookmarkmagic-${VERSION}-sources.zip"; do
test -f ".output/$file" || { echo "::error::missing release file $file"; exit 1; }
cp ".output/$file" dist/
done
(cd dist && sha256sum bookmarkmagic-*.zip > SHA256SUMS.txt)
cat dist/SHA256SUMS.txt
- uses: actions/upload-artifact@v7
with:
@@ -100,9 +113,9 @@ jobs:
run: sha256sum -c SHA256SUMS.txt
# Idempotent on purpose. `gh release create` fails outright if a Release
# for the tag already exists, so any failure AFTER this step — realistically
# the store job below, once CWS_AUTOPUBLISH is on — used to strand the tag:
# re-running could not get past this line (docs/13 §7).
# for the tag already exists, so any failure AFTER this step — a store
# job, realistically — used to strand the tag: re-running could not get
# past this line (docs/13 §7).
- name: Create or update the Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -111,45 +124,177 @@ jobs:
set -euo pipefail
if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
echo "Release $GITHUB_REF_NAME exists — re-uploading assets."
gh release upload "$GITHUB_REF_NAME" dist/*-chrome.zip dist/SHA256SUMS.txt --clobber
gh release upload "$GITHUB_REF_NAME" dist/*.zip dist/SHA256SUMS.txt --clobber
else
gh release create "$GITHUB_REF_NAME" dist/*-chrome.zip dist/SHA256SUMS.txt \
gh release create "$GITHUB_REF_NAME" dist/*.zip dist/SHA256SUMS.txt \
--verify-tag --generate-notes
fi
store:
# v1.0.x/v1.1.x are published by hand (docs/12 §3). Flipping the repo
# variable CWS_AUTOPUBLISH to 'true' turns this on once the four CHROME_*
# secrets exist. A variable, not a secret: only variables are allowed here.
# --- Stores (docs/12 §3) -------------------------------------------------
#
# One job per store, so a store's credentials never share a runner with
# another's and one store refusing an upload does not stop the others. Each
# runs in a GitHub Environment that holds only its own secrets (give it the
# owner as required reviewer), is off until its repo VARIABLE is 'true' (a
# secret is not allowed in a job-level `if:`), and installs only
# tools/publish — publish-browser-extension and its three dependencies, from
# their own lockfile, scripts off — not the dev toolchain: a job's secrets
# are readable by everything on its runner. Never re-run a store job that
# succeeded: every store refuses a version number it has already seen.
# A sparse checkout of tools/publish still brings the repository's root files
# (cone mode), .nvmrc among them.
store-chrome:
name: Publish to Chrome Web Store
needs: publish
if: vars.CWS_AUTOPUBLISH == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
environment: chrome-web-store
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
sparse-checkout: tools/publish
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci --ignore-scripts
- run: npm ci --ignore-scripts --prefix tools/publish
- uses: actions/download-artifact@v8
with:
name: release-${{ github.ref_name }}
path: dist
- name: Submit the Release asset
# Against the SHA256SUMS.txt of the published Release — not the copy that
# travelled in the same artifact — and by exact name, so a missing file
# fails here rather than passing a check that skipped it.
- name: Check against the published checksums
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
VERSION="${GITHUB_REF_NAME#v}"
gh release download "$GITHUB_REF_NAME" --pattern SHA256SUMS.txt --dir published
cd dist
for file in "bookmarkmagic-${VERSION}-chrome.zip"; do
grep -F " $file" ../published/SHA256SUMS.txt | sha256sum -c -
done
- name: Submit
env:
# API v2: v1.1 was shut down on 2026-10-15. Set explicitly — the tool
# still defaults to v1.1.
CHROME_API_VERSION: v2
CHROME_PUBLISHER_ID: ${{ secrets.CHROME_PUBLISHER_ID }}
CHROME_EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
# The locally installed wxt, never `npx wxt`: npx may fetch and run an
# unpinned package with these four secrets in its environment.
run: ./node_modules/.bin/wxt submit --chrome-zip dist/*-chrome.zip
CHROME_SERVICE_ACCOUNT_CLIENT_EMAIL: ${{ secrets.CHROME_SERVICE_ACCOUNT_CLIENT_EMAIL }}
CHROME_SERVICE_ACCOUNT_PRIVATE_KEY: ${{ secrets.CHROME_SERVICE_ACCOUNT_PRIVATE_KEY }}
run: |
set -euo pipefail
./tools/publish/node_modules/.bin/publish-extension \
--chrome-zip "dist/bookmarkmagic-${GITHUB_REF_NAME#v}-chrome.zip"
store-firefox:
name: Publish to Firefox Add-ons
needs: publish
if: vars.AMO_AUTOPUBLISH == 'true'
runs-on: ubuntu-latest
timeout-minutes: 30
environment: firefox-add-ons
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
sparse-checkout: tools/publish
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
- run: npm ci --ignore-scripts --prefix tools/publish
- uses: actions/download-artifact@v8
with:
name: release-${{ github.ref_name }}
path: dist
# Against the SHA256SUMS.txt of the published Release — not the copy that
# travelled in the same artifact — and by exact name, so a missing file
# fails here rather than passing a check that skipped it.
- name: Check against the published checksums
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
VERSION="${GITHUB_REF_NAME#v}"
gh release download "$GITHUB_REF_NAME" --pattern SHA256SUMS.txt --dir published
cd dist
for file in "bookmarkmagic-${VERSION}-firefox.zip" "bookmarkmagic-${VERSION}-sources.zip"; do
grep -F " $file" ../published/SHA256SUMS.txt | sha256sum -c -
done
- name: Submit
env:
FIREFOX_EXTENSION_ID: ${{ secrets.FIREFOX_EXTENSION_ID }}
FIREFOX_JWT_ISSUER: ${{ secrets.FIREFOX_JWT_ISSUER }}
FIREFOX_JWT_SECRET: ${{ secrets.FIREFOX_JWT_SECRET }}
FIREFOX_CHANNEL: listed
# Desktop only: Firefox for Android has no bookmarks API (docs/08 §9).
FIREFOX_COMPATIBILITY: firefox
run: |
set -euo pipefail
VERSION="${GITHUB_REF_NAME#v}"
./tools/publish/node_modules/.bin/publish-extension \
--firefox-zip "dist/bookmarkmagic-${VERSION}-firefox.zip" \
--firefox-sources-zip "dist/bookmarkmagic-${VERSION}-sources.zip"
store-edge:
name: Publish to Microsoft Edge Add-ons
needs: publish
if: vars.EDGE_AUTOPUBLISH == 'true'
runs-on: ubuntu-latest
timeout-minutes: 30
environment: edge-add-ons
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
sparse-checkout: tools/publish
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
- run: npm ci --ignore-scripts --prefix tools/publish
- uses: actions/download-artifact@v8
with:
name: release-${{ github.ref_name }}
path: dist
# Against the SHA256SUMS.txt of the published Release — not the copy that
# travelled in the same artifact — and by exact name, so a missing file
# fails here rather than passing a check that skipped it.
- name: Check against the published checksums
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
VERSION="${GITHUB_REF_NAME#v}"
gh release download "$GITHUB_REF_NAME" --pattern SHA256SUMS.txt --dir published
cd dist
for file in "bookmarkmagic-${VERSION}-chrome.zip"; do
grep -F " $file" ../published/SHA256SUMS.txt | sha256sum -c -
done
- name: Submit
env:
# API v1.1 keys expire every 72 days (docs/12 §3).
EDGE_PRODUCT_ID: ${{ secrets.EDGE_PRODUCT_ID }}
EDGE_CLIENT_ID: ${{ secrets.EDGE_CLIENT_ID }}
EDGE_API_KEY: ${{ secrets.EDGE_API_KEY }}
run: |
set -euo pipefail
# Edge Add-ons takes the Chromium package unchanged (docs/08 §10).
./tools/publish/node_modules/.bin/publish-extension \
--edge-zip "dist/bookmarkmagic-${GITHUB_REF_NAME#v}-chrome.zip"
# A job INSIDE this workflow, not an `on: release: [published]` caller.
# A Release created by `gh release create` under the default GITHUB_TOKEN
@@ -171,7 +316,7 @@ jobs:
# `on: push: tags` — so without this the job exits 1 and never announces.
tag_override: ${{ github.ref_name }}
# Named, not `inherit`: the reusable is pinned to a moving branch, so it gets
# only the two webhooks it reads — never the CHROME_* or SONAR secrets. The
# only the two webhooks it reads — never the store or SONAR secrets. The
# names also differ: this repo stores RELEASES_WEBHOOK / REPO_WEBHOOK, while
# the reusable reads DISCORD_* — with `inherit` it received neither and would
# have failed on "No webhooks configured" the day DISCORD_ANNOUNCE was set.
+1 -1
View File
@@ -107,7 +107,7 @@ jobs:
if: steps.token.outputs.present == 'true'
# Pinned to a commit, not a moving tag: this step holds a token. Dependabot
# proposes updates (with the repo's 7-day cooldown).
uses: SonarSource/sonarqube-scan-action@4d1dc0c91ee400dcf8a6dddf2f705ac36542e304 # v8.4.0
uses: SonarSource/sonarqube-scan-action@e805d875275f728fac1885b413934be6d7c63f65 # v8.4.1
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
+94
View File
@@ -0,0 +1,94 @@
# Maintenance-mode triage — MAINTENANCE.md, docs/12 §2.6.
#
# scripts/triage.mjs decides (a pure, unit-tested function of the event); this
# file only carries the decision out with the `gh` CLI the runner ships. No
# third-party action holds the write token.
#
# Security, because `pull_request_target` runs with a write token even for a
# pull request from a fork:
# - the checkout is the DEFAULT BRANCH (what pull_request_target checks out
# unless told otherwise) — never the pull request's head, and nothing from
# the pull request is executed;
# - the payload reaches the script as the runner's event FILE; no title, body
# or label is ever interpolated into a shell line with `${{ }}`;
# - the decision the shell reads back is constants: an action from a fixed
# set, an integer, a label from a fixed list, a comment the script wrote.
name: Triage
on:
issues:
types: [opened, labeled]
pull_request_target:
types: [opened]
permissions: {}
# A new issue from the feature form fires `opened` and `labeled` together; one
# at a time per number, and the second re-reads the live state before acting.
concurrency:
group: triage-${{ github.event.issue.number || github.event.pull_request.number }}
cancel-in-progress: false
jobs:
triage:
name: Maintenance-mode triage
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
issues: write
pull-requests: write
steps:
# Pinned to commits, unlike the other workflows: these two run with a
# write token on events anyone can trigger, fork pull requests included.
# No `cache:` on setup-node — a cache written here could be read back by
# a job that trusts it.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
- name: Decide
run: node scripts/triage.mjs > "$RUNNER_TEMP/decision.json"
- name: Act
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
decision="$RUNNER_TEMP/decision.json"
action=$(jq -r '.action' "$decision")
echo "triage: $action — $(jq -r '.reason' "$decision")"
[ "$action" = none ] && exit 0
kind=$(jq -r '.kind' "$decision")
number=$(jq -r '.number' "$decision")
label=$(jq -r '.label' "$decision")
case "$kind" in issue|pr) ;; *) echo "::error::unexpected kind"; exit 1 ;; esac
[[ "$number" =~ ^[0-9]+$ ]] || { echo "::error::unexpected number"; exit 1; }
# Re-read the live state: the second of two events for one issue
# finds the first one's label and does nothing.
live=$(gh "$kind" view "$number" --json state,labels \
--jq '[.state] + [.labels[].name] | join(" ")')
case " $live " in
*" maintenance-mode "*|*" needs-triage "*|*" roadmap "*)
echo "already triaged: $live"; exit 0 ;;
esac
case "$live" in OPEN*) ;; *) echo "not open: $live"; exit 0 ;; esac
# Comment and close FIRST, label last: the label is what a re-run
# reads as "done", so it must not exist before the work it stands for.
if [ "$action" = close ]; then
jq -r '.comment' "$decision" > "$RUNNER_TEMP/comment.md"
gh "$kind" comment "$number" --body-file "$RUNNER_TEMP/comment.md"
if [ "$kind" = issue ]; then
gh issue close "$number" --reason "not planned"
else
gh pr close "$number"
fi
fi
gh "$kind" edit "$number" --add-label "$label"
+14 -7
View File
@@ -6,7 +6,7 @@ page zoomed, or with animation switched off. This file says what that means
today: what the goal is, what has actually been tested, what is known not to
work well yet, and how to tell us about a barrier.
**Last reviewed:** 2026-11-10, for version 1.2.1.
**Last reviewed:** 2026-11-18, for version 1.3.0.
## The goal
@@ -34,8 +34,10 @@ The priorities, in order:
|---|---|
| Chrome 136 or later on Windows | Supported, and where the testing below was done |
| Chrome 136 or later on macOS, Linux and ChromeOS | Supported; expected to work the same, not tested for accessibility |
| Edge, Brave, Vivaldi and Opera (the same build) | Best effort — the extension runs there, and accessibility is untested |
| Edge, Brave, Vivaldi and Opera (the same package as Chrome) | Best effort — the extension runs there, and accessibility is untested |
| Firefox 140 or later on the desktop (since 1.3.0, its own package) | Best effort — the extension runs there, and accessibility is untested |
| Chrome on Android or iOS | Not applicable: Chrome there does not run extensions |
| Firefox for Android | Not applicable: it has no bookmarks API for extensions |
## What is in place
@@ -132,8 +134,8 @@ limitations below).
| What 1.2.1 changed: focus, Alt+↑/↓, button sizes | A scripted keyboard run in Chrome — no screen reader | November 2026, version 1.2.1 |
| Colour contrast of the theme colours, reduced motion, the tree's key handling | Automated tests, on every change | Continuous |
**Not tested**, so we cannot tell you how well they work: anything on macOS,
Linux or ChromeOS; NVDA, JAWS, VoiceOver, ChromeVox and Orca; voice control
**Not tested**, so we cannot tell you how well they work: anything in Firefox
or Edge; anything on macOS, Linux or ChromeOS; NVDA, JAWS, VoiceOver, ChromeVox and Orca; voice control
(Dragon, Voice Access, Voice Control); switch access; screen magnifiers; and
zoom at 200 %. Narrator has not yet been run over what 1.2.1 added.
If you use one of these, a report of what you found — good or bad — is
@@ -158,6 +160,10 @@ These are known, and none of them is by design.
- **Reordering with a pointer needs a drag.** There is a keyboard way
(Alt+↑/↓) and Sort A→Z, but no click-only way to place one item before
another.
- **Separators in Firefox are only drawn.** A line in a Firefox folder is
shown in the tree, but a screen reader is not told it is there, and the
"position n of m" counts bookmarks and folders only — so Alt+↑ or Alt+↓ past
a separator moves the row without changing the position you hear.
- **Alt+↑/↓ may not reach the page on a Chromebook**, where the system can turn
those keys into Page Up and Page Down. On a Mac there is no Menu key (use
Shift+F10), and the laptop's delete key is Backspace, which the tree does
@@ -203,7 +209,8 @@ accessibility report is treated as a defect, not a feature request.
It helps to include:
- what you were trying to do, and what happened instead;
- the BookmarkMagic version (About tab, or `chrome://extensions`);
- the BookmarkMagic version (About tab, `chrome://extensions`, or
`about:addons` in Firefox);
- your browser and operating system;
- the assistive technology you use and its version, if any — a screen reader,
a contrast theme, zoom level, voice control;
@@ -224,8 +231,8 @@ guarantees:
- A report is acknowledged within about a week.
- A **blocking** barrier is fixed ahead of other work and shipped in its own
patch release; Chrome then updates installed copies by itself, usually
within days of the store's review.
patch release; your browser then updates installed copies by itself,
usually within days of the store's review.
- Anything else is scheduled, and added to the list above until it is fixed,
so the next person can see it is known.
- If a fix is not possible or not planned, you will be told why.
+63
View File
@@ -0,0 +1,63 @@
# Building BookmarkMagic from source
How to rebuild the packages attached to each
[GitHub Release](https://github.com/poli0981/bookmarkmagic/releases) — for
Firefox Add-ons reviewers, who must be able to reproduce the submitted package
from its sources, and for anyone who wants to check that a store build matches
this repository.
## Requirements
| Tool | Version | Where |
|---|---|---|
| Node.js | **26** (the version in `.nvmrc`; tested with 26.13) | <https://nodejs.org/en/download> |
| npm | the one bundled with Node.js 26 (11.x) | ships with Node.js |
| OS | any — Windows 11, macOS and Ubuntu all build the same files | |
No other tool, account, network service or environment variable is needed
beyond what `npm ci` installs from `package-lock.json`.
> **The Firefox sources archive omits dotfiles**, so `.nvmrc` and `.npmrc` are
> not in it. Use Node.js 26: an older Node may install but is not what the
> package was built with, and `package.json` says `"engines": { "node": ">=26" }`.
## Steps
```bash
npm ci # exactly the versions in package-lock.json
npm run zip:firefox # the Firefox package (and a sources archive)
npm run zip # the Chromium package (Chrome Web Store, Edge Add-ons)
```
`npm ci` runs one install script of this project's own, `wxt prepare`, which
generates the TypeScript configuration the build reads. (CI installs with
`--ignore-scripts` and runs `npx --no-install wxt prepare` itself; the result
is the same.)
## Output
| Command | Unpacked build | Package |
|---|---|---|
| `npm run zip:firefox` | `.output/firefox-mv3/` | `.output/bookmarkmagic-<version>-firefox.zip` |
| `npm run zip` | `.output/chrome-mv3/` | `.output/bookmarkmagic-<version>-chrome.zip` |
Compare the **files inside** the package with the submitted one, not the
archives themselves: a zip records file times, so two builds of the same
commit hash differently while every entry is identical (`docs/09 §5`).
## What the build does
- [WXT](https://wxt.dev) bundles `src/` with Vite into plain JavaScript, CSS
and HTML. The code is **minified, not obfuscated**.
- The only third-party code compiled in is the Svelte runtime, its `clsx`
helper and WXT's one-line browser shim, all MIT
([`legal/THIRD_PARTY_NOTICES.md`](legal/THIRD_PARTY_NOTICES.md)); the build
fails if anything else would ship.
- Nothing is downloaded at build time beyond `npm ci`, and the built extension
makes no network requests at all — its content security policy forbids them
([`docs/08_MV3_COMPLIANCE.md`](docs/08_MV3_COMPLIANCE.md) §3).
To check a build the way CI does: `npm run check:manifest` (Chromium) and
`npm run check:manifest -- --browser firefox` (Firefox) verify the manifest,
the permissions, the CSP, the file inventory and that no network API is in the
bundle.
+67 -2
View File
@@ -12,7 +12,71 @@ 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
Firefox and Microsoft Edge, and maintenance mode. Permissions are unchanged
(`bookmarks` and `storage`), nothing is asked of you again, and on Chrome
there is nothing to do — your browser updates itself. This version also
carries everything listed under 1.2.1, which never reached the Chrome Web
Store on its own.
### Added
- **Firefox** (desktop, 140 or later), with a package of its own for Firefox
Add-ons — listing to come. The same features, the same two permissions and
the same no-network policy, which Firefox enforces just as Chrome does.
Firefox's **Bookmarks Menu** is a root like the others: Merge and Replace put
entries back where they came from. Whatever a file leaves loose at its top
level goes into the menu, as Firefox's own import does — the menu itself in
a Firefox export, but also Other's and Mobile's contents in Chrome's own
HTML export, which Chrome writes loose. BookmarkMagic's exports and backups
name every root and are not affected.
- **Microsoft Edge Add-ons** — the Chrome package, unchanged; listing to come.
Until then Edge installs from the Chrome Web Store.
- **Firefox separators** show in the Edit tab as lines. Nothing acts on them:
they are not focused, searched, counted, sorted across, or offered as
duplicates of each other. Sort A→Z sorts each run between two separators on
its own.
- Replace on Firefox says how many separators it will delete — no file
BookmarkMagic writes can keep one, so they do not come back with the backup.
- An import says how many separators the file held, and on Firefox skips — and
counts — any address longer than the 65,536 characters Firefox accepts,
before anything is written.
### Changed
- The About tab's store link is now **"Store listing"** and opens the store
your copy came from: the Chrome Web Store for the Chrome Web Store's copy,
Firefox Add-ons in Firefox, and otherwise the README's list of stores.
- Sentences that blamed Chrome for what every browser does now say "the
browser" — "The browser does not let an extension set a bookmark's original
date" — in all five languages; the note about skipped Firefox smart
bookmarks no longer calls them dead links.
- Copy diagnostics names the browser and its version (`"browser": "Firefox
160"`) instead of only Chrome's.
- The project is in **maintenance mode** ([`MAINTENANCE.md`](MAINTENANCE.md)):
fixes, accessibility, translations, security and dependency updates, and
features that are already on the roadmap.
### Fixed
- Since 1.1.0, in a Chrome signed in with account bookmarks (Chrome 134 or
later), Replace's confirmation counted the account's own bar, Other and
Mobile among what it would delete. Replace has never touched them; the count
now covers exactly what it deletes.
### Packages
Each GitHub Release now carries three files: `…-chrome.zip` (the Chrome Web
Store and Edge Add-ons), `…-firefox.zip` and `…-sources.zip` (what Firefox
Add-ons reviews), with `SHA256SUMS.txt` over all three. [`BUILD.md`](BUILD.md)
explains how to rebuild them.
## [1.2.1] — 2026-11-10
@@ -293,7 +357,8 @@ from 2026-08-03.
- Parsing is bounded: 25 MB per file, 100 000 nodes, 200 levels of nesting.
- No network access of any kind at runtime, enforced by a grep gate in CI.
[Unreleased]: https://github.com/poli0981/bookmarkmagic/compare/v1.2.1...HEAD
[Unreleased]: https://github.com/poli0981/bookmarkmagic/compare/v1.3.0...HEAD
[1.3.0]: https://github.com/poli0981/bookmarkmagic/compare/v1.2.1...v1.3.0
[1.2.1]: https://github.com/poli0981/bookmarkmagic/compare/v1.2.0...v1.2.1
[1.2.0]: https://github.com/poli0981/bookmarkmagic/compare/v1.1.0...v1.2.0
[1.1.0]: https://github.com/poli0981/bookmarkmagic/compare/v1.0.1...v1.1.0
+51 -7
View File
@@ -1,6 +1,7 @@
# CLAUDE.md — Build Instructions (BookmarkMagic)
A Chrome MV3 extension: offline bookmark import/export/edit.
A Chrome MV3 extension — and since v1.3.0 a Firefox one, and on Edge Add-ons —
for offline bookmark import/export/edit.
This file is the entry point; the `docs/` suite is the specification.
**When code and docs disagree, docs win — or stop and ask.**
@@ -9,12 +10,19 @@ This file is the entry point; the `docs/` suite is the specification.
> **BookmarkMagic is published on the Chrome Web Store and has real users**
> (v1.0.0 live by 2026-08-03; v1.0.1 live, confirmed on the listing
> 2026-10-28; v1.1.0 live, confirmed on the listing 2026-11-06; v1.2.0 live,
> confirmed on the listing 2026-11-10; v1.2.1 prepared 2026-11-10, ⚠️ not yet
> submitted).
> Phases 0–8 are complete and Phase 9 (v1.2.1) is prepared; the project is in
> **maintenance**.
> confirmed on the listing 2026-11-10; v1.2.1 released on GitHub 2026-11-10,
> never submitted on its own; v1.3.0 — Firefox and Edge, 1.2.1 included —
> released on GitHub and submitted to all three stores 2026-11-18, **live on
> Edge Add-ons 2026-11-19**, ⚠️ in review on the Chrome Web Store and Firefox
> Add-ons).
> Phases 0–9 are complete; since 2026-11-18 the project is in **maintenance
> mode** — `/MAINTENANCE.md` is the policy (Phase 10 below).
> That changes the rules of the game:
>
> - **New work must fit `/MAINTENANCE.md`**: dependency and security updates,
> major platform upgrades, bug/UI/UX/accessibility/translation fixes, and
> features only when they are on `docs/15`'s roadmap or genuinely needed. A
> feature that is not on the roadmap needs a decision-log row before code.
> - Every change now reaches installed users through a store review. It needs a
> semver bump, a `CHANGELOG.md` entry and an update submission — `13 §1b`.
> - Breaking something is no longer a local cost. The 1.0.0 → 1.0.x **upgrade
@@ -37,7 +45,7 @@ This file is the entry point; the `docs/` suite is the specification.
| docs/05_ALGORITHMS.md | Parser walk, normalize, dedupe, diff, write queue |
| docs/06_UI.md | Tokens, layouts per tab, component inventory, a11y (§5 is the spec behind `/ACCESSIBILITY.md`) |
| docs/07_I18N.md | chrome.i18n vs runtime store split, EN/VI/JA rules |
| docs/08_MV3_COMPLIANCE.md | Manifest, permissions (bookmarks+storage ONLY), CWS rules |
| docs/08_MV3_COMPLIANCE.md | Manifest, permissions (bookmarks+storage ONLY), CWS rules; Firefox §9, Edge §10 |
| docs/09_SECURITY_PRIVACY.md | Threat model T1–T8, secure-coding bans |
| docs/10_CODING_STANDARDS.md | Size limits, tsconfig, biome.json, knip.json, conventions |
| docs/11_TESTING.md | Coverage gates, fixtures, suites, manual QA |
@@ -194,11 +202,47 @@ goal is WCAG 2.2 AA **as a goal** — never write "conforms" or "compliant"
without an audit to cite. The review found the first draft of the statement
overclaiming in nine places ("every clickable target", "nothing times out"):
check each sentence of it against the source, not against the intention.
**Exit:** v1.2.1 prepared 2026-11-10. Human-only ⚠️: the `11 §5` pass with the
A third: **code moved out of a component starts counting.** SonarCloud's
new-code gate (80 %) failed the first push because the live-sync wiring left
`EditTab` for a `.ts` module with no test. Extracting to stay under a size
limit is half the job; the test is the other half.
**Exit:** ✔ v1.2.1 tagged and released 2026-11-10 (signed tag on `d61318a`,
checksum-verified zip). Human-only ⚠️: the `11 §5` pass with the
**1.2.0 → 1.2.1 upgrade over an existing profile**, a real Windows contrast
theme and a screen-reader pass over Alt+↑/↓, the zip upload, and the native
review of the two new strings.
### Phase 10 — maintenance mode; Firefox and Edge → v1.3.0
The owner put the project into maintenance mode and asked for the last
roadmap item, the other two stores. In order: Dependabot #39–#41 and the
hand sync they always need → the `picomatch` advisory recorded (no fix
exists) → a licence gate over the lockfile (`check:licenses`) → the policy
(`/MAINTENANCE.md`, a feature form that asks which kind of change it is, and
`triage.yml`, which closes requests for something new) → Qodana (`qodana-js`,
Ultimate) beside SonarCloud → then Firefox (AMO) and Edge: the docs first,
then the port, then CI, review and 1.3.0.
One thing to carry forward: **`triage.yml` runs on `pull_request_target`,
with a write token, for pull requests from forks.** It checks out the base
branch and only compares event text with constants. Never add a checkout of
the pull request's head, a step that runs its code, or a `${{ }}` of a title
or body inside a `run:` line to that file.
Two more, from the port. **There is no Firefox in CI**: the fake's Firefox
flavour (`11 §4`) is a reading of Firefox's source, not evidence, so a change
to roots, separators or move indices needs a real Firefox before an AMO
upload. And **every change now ships in two packages**: `verify:full` builds
and checks both (`build:firefox`, `check:manifest -- --browser firefox`), and a
string that names Chrome is false in one of them.
**Exit:** ✔ v1.3.0 tagged and released 2026-11-18 (signed tag on `80c7190`,
three checksum-verified packages; PR #44 merged at the reviewed head).
Human-only ⚠️ (`00 §10` items 19–26): the `11 §5` passes — Chrome with the
**1.2.0 → 1.3.0 upgrade over an existing profile**, a real Firefox 140+, Edge
signed in with sync on — then the Chrome Web Store upload of 1.3.0 in place
of 1.2.1, the first Firefox Add-ons version and the first Edge submission by
hand, the store environments if automation is wanted, and native review.
The three uploads went up 2026-11-18; Edge approved 2026-11-19, the other two
are in review. **An Edge copy's About link is chosen by its CRX ID**
(`links.ts`), so the listing ids in `00 §9` are code, not trivia.
## Working style
- Small commits per module; tests land with (or before) implementation.
+12 -1
View File
@@ -7,6 +7,16 @@ stop reading here — the forms ask for what is needed.
Security problems go through [`SECURITY.md`](SECURITY.md), never a public issue.
**The project is in maintenance mode** ([`MAINTENANCE.md`](MAINTENANCE.md)).
What it takes: bug, UI/UX and accessibility fixes; translation fixes (wording
wrong for a language or region, misleading spelling); dependency and security
updates; major platform upgrades; and features that are already on the
roadmap or genuinely needed. A feature request for something new, or a pull
request titled `feat…` from outside the project, is closed automatically and
labelled `maintenance-mode` — read, not deleted, and reopened if it fits.
Ideas belong in
[Discussions › Ideas](https://github.com/poli0981/bookmarkmagic/discussions/categories/ideas).
If something is hard or impossible to use — with a keyboard, a screen reader, a
contrast theme, zoom — that is a defect, and it has its own form.
[`ACCESSIBILITY.md`](ACCESSIBILITY.md) says what is already known and how a
@@ -86,7 +96,8 @@ which does not exist until it has run.
Then `npm run dev` and load `.output/chrome-mv3` at `chrome://extensions` with
Developer mode on.
`npm run verify` runs lint, type-check, knip, the grep gate and the tests. It
`npm run verify` runs lint, type-check, knip, the grep gate, the licence gate
(`npm run check:licenses`) and the tests. It
must be green before every commit. For anything release-bearing use
`npm run verify:full`, which additionally runs coverage, the build, and the gate
that inspects the *built* manifest — `verify` alone is weaker than what CI and a
+89
View File
@@ -0,0 +1,89 @@
# Maintenance
**Status: maintenance mode, since 2026-11-18.**
BookmarkMagic does what it set out to do: import, export and edit bookmarks
between browsers — offline, with two permissions and no network access. From
here the project is **maintained, not extended**. That is not abandonment: it
means keeping the extension correct, safe and current matters more than adding
to it, and every change still reaches people through a store review.
This file is the policy. The reasoning behind it is in the decision log of
[`docs/15_ROADMAP.md`](docs/15_ROADMAP.md).
## What is still done
1. **Dependencies, on a schedule.** Dependabot proposes updates weekly, for npm
and for the GitHub Actions the workflows use, and only for releases that
have been public for at least seven days. Each is merged after CI and the
follow-up the docs ask for ([`docs/01 §6`](docs/01_TECH_STACK.md)).
2. **Security, urgently.** An advisory rated **high or critical** against any
dependency — or a serious security problem in the toolchain itself, Node.js
for example — is fixed as soon as a fixed version exists. While none exists,
[`docs/09 §3.1`](docs/09_SECURITY_PRIVACY.md) records the advisory and why it
cannot reach a user, until the fix lands. To report a vulnerability, follow
[`SECURITY.md`](SECURITY.md).
3. **Major upgrades of the platform.** A new major of the language, runtime or
framework — Node.js 24 → 26, TypeScript 6 → 7, a major of WXT or Svelte — is
adopted on purpose, in its own pull request, with the docs updated first.
4. **Defects.** Bugs, UI/UX defects and accessibility barriers
([`ACCESSIBILITY.md`](ACCESSIBILITY.md)). A bookmark file that will not
import is the most useful report there is
([`CONTRIBUTING.md`](CONTRIBUTING.md)).
5. **Language.** Translation fixes: wording that is wrong for a language, or
for a region's culture or usage, and spelling mistakes that could mislead
someone. The translation form is the way in.
6. **Roadmap features, and necessary ones.** A feature that is already on the
roadmap ([`docs/15`](docs/15_ROADMAP.md)) can still land, and so can a change
that is genuinely needed — to fix a defect, to remove a barrier, or to keep
the extension working in a browser it is published for.
## What is not
**New features outside the roadmap.** Requests for them are closed
automatically, by [`.github/workflows/triage.yml`](.github/workflows/triage.yml):
- An issue opened with the **Suggest a feature** form whose first answer is
"Something new — not on the roadmap" is labelled `maintenance-mode`, gets a
comment that links here, and is closed as *not planned*. The form's other two
answers — on the roadmap, or needed for a fix — keep the issue open, labelled
`needs-triage`, for the maintainer to read.
- A pull request from outside the project whose title starts with `feat`
(Conventional Commits) is labelled and closed the same way. Open a feature
request first.
- The maintainer can label any issue `enhancement` to close it the same way.
Nothing is deleted. Every closed request is read, and one that fits this
policy is reopened and labelled `roadmap`, which the automation leaves alone.
**Ideas** are welcome in
[Discussions › Ideas](https://github.com/poli0981/bookmarkmagic/discussions/categories/ideas),
where they can be talked through without an issue that has to be accepted or
refused.
Out of scope permanently, maintenance mode or not: cloud sync, accounts,
analytics of any kind, and anything that would need a new browser permission —
the never list in [`docs/15`](docs/15_ROADMAP.md).
## Releases
A **patch** ships when there is something to fix: a file that will not import,
a data-integrity defect or a dead end, an accessibility barrier, a batch of
translation fixes, or a security problem that reaches what ships. (The
extension has no runtime dependencies, so an advisory against the build tools
is fixed in the repository and needs no release unless it changed the
built extension.) A **minor** carries a roadmap
feature, a new UI language or a change to the permissions
([`docs/12 §4`](docs/12_CI_CD.md)). There is no fixed schedule.
Your browser updates the extension by itself once a new version passes store
review; there is nothing to do.
## Supported versions
The latest version published on each store. See [`SECURITY.md`](SECURITY.md).
## Changing this policy
Through a pull request like any other, recorded in `docs/15`'s decision log
and announced in Discussions.
+56 -24
View File
@@ -1,18 +1,30 @@
# BookmarkMagic
[![Status: maintenance mode](https://img.shields.io/badge/status-maintenance%20mode-yellow.svg)](MAINTENANCE.md)
[![License: GPL-3.0-or-later](https://img.shields.io/badge/license-GPL--3.0--or--later-blue.svg)](LICENSE)
[![CI](https://github.com/poli0981/bookmarkmagic/actions/workflows/ci.yml/badge.svg)](https://github.com/poli0981/bookmarkmagic/actions/workflows/ci.yml)
[![CodeQL](https://github.com/poli0981/bookmarkmagic/actions/workflows/codeql.yml/badge.svg)](https://github.com/poli0981/bookmarkmagic/actions/workflows/codeql.yml)
[![Qodana](https://github.com/poli0981/bookmarkmagic/actions/workflows/qodana.yml/badge.svg)](https://github.com/poli0981/bookmarkmagic/actions/workflows/qodana.yml)
[![Quality gate](https://sonarcloud.io/api/project_badges/measure?project=poli0981_bookmarkmagic&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=poli0981_bookmarkmagic)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=poli0981_bookmarkmagic&metric=coverage)](https://sonarcloud.io/summary/new_code?id=poli0981_bookmarkmagic)
[![Chrome Web Store](https://img.shields.io/chrome-web-store/v/eghnciphhegekmnofffpgbdfefckdhmg?label=Chrome%20Web%20Store)](https://chromewebstore.google.com/detail/bookmarkmagic/eghnciphhegekmnofffpgbdfefckdhmg)
[![Edge Add-ons](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fmicrosoftedge.microsoft.com%2Faddons%2Fgetproductdetailsbycrxid%2Fnchfchjnlihbifggooggpmmacighmdjg&query=%24.version&prefix=v&label=Edge%20Add-ons)](https://microsoftedge.microsoft.com/addons/detail/nchfchjnlihbifggooggpmmacighmdjg)
[![Runtime dependencies: 0](https://img.shields.io/badge/runtime%20dependencies-0-brightgreen.svg)](#privacy)
Move your bookmarks between browsers the simple way: with a file. No account,
no cloud sync, 100% offline.
A Chrome (MV3) extension for importing, exporting and editing bookmarks and
folder trees. English · Tiếng Việt · 日本語 · 简体中文 · Română.
A browser extension (Manifest V3) for importing, exporting and editing
bookmarks and folder trees — for Chrome and the other Chromium browsers, and,
since 1.3.0, for Firefox. English · Tiếng Việt · 日本語 · 简体中文 · Română.
## Project status
**Maintenance mode** since 2026-11-18 — see [`MAINTENANCE.md`](MAINTENANCE.md).
Bug, UI/UX, accessibility and translation fixes, dependency and security
updates, and features already on the roadmap still land; requests for new
features beyond that are closed automatically. Ideas are welcome in
[Discussions › Ideas](https://github.com/poli0981/bookmarkmagic/discussions/categories/ideas).
## Screenshots
@@ -62,11 +74,11 @@ This is the whole point of the project, so it is worth being precise.
- **No network access at all.** Not analytics, not telemetry, not update pings.
There is no server, and the code makes no network calls. The browser backs
that up: the extension's content security policy makes Chrome refuse fetch,
XHR, WebSocket, EventSource and beacon requests, and remote images, fonts,
media and frames. On top of that, `npm run check:manifest` scans the shipped
bundle for network APIs (WebRTC included, which no CSP directive covers) and
`npm run guard` scans the source.
that up: the extension's content security policy — the same in Chrome, Edge
and Firefox — makes the browser refuse fetch, XHR, WebSocket, EventSource and
beacon requests, and remote images, fonts, media and frames. On top of that,
`npm run check:manifest` scans both shipped packages for network APIs (WebRTC
included, which no CSP directive covers) and `npm run guard` scans the source.
- **Exactly two permissions**: `bookmarks` and `storage`. No host permissions,
no content scripts, no background worker. Two gates enforce it: a unit test
over `wxt.config.ts`, and `npm run check:manifest`, which CI runs against the
@@ -88,28 +100,45 @@ Full policy: [`legal/PRIVACY.md`](legal/PRIVACY.md).
## Honest limitations
- Favicons cannot be imported — the bookmarks API has no favicon field.
- Imported bookmarks get today's date. Chrome does not let an extension set a
- Imported bookmarks get today's date. Browsers do not let an extension set a
bookmark's original creation date. Your **exported** files keep the real ones.
- **Firefox separators are not kept.** They show in the Edit tab as lines, but
no file BookmarkMagic writes can hold one: exports and backups leave them out,
imports skip the ones a file holds and say how many, and Replace — which
deletes them with everything else — tells you so before it starts.
- Firefox refuses bookmark addresses longer than 65,536 characters (they are
skipped, and counted) and shortens titles longer than 4,096.
- On Firefox, entries a file leaves loose at its top level go into the
**Bookmarks Menu**, where Firefox's own import puts them. For an HTML file
exported by Chrome itself, that means Chrome's Other and Mobile bookmarks;
BookmarkMagic's own exports name every root and land where they came from.
- CSV is a flattened view: empty folders and "which folder is the toolbar" are
not preserved. Use HTML or JSON for a faithful backup.
- Markdown is share-only — BookmarkMagic cannot read it back.
## Install
From the Chrome Web Store: [here](https://chromewebstore.google.com/detail/bookmarkmagic/eghnciphhegekmnofffpgbdfefckdhmg)
| Browser | Where | Requires |
|---|---|---|
| Chrome, Brave, Vivaldi, Opera | [Chrome Web Store](https://chromewebstore.google.com/detail/bookmarkmagic/eghnciphhegekmnofffpgbdfefckdhmg) | Chrome 136 or later (April 2025), or a Chromium browser of the same vintage |
| Microsoft Edge | [Edge Add-ons](https://microsoftedge.microsoft.com/addons/detail/nchfchjnlihbifggooggpmmacighmdjg) | Edge 136 or later |
| Firefox (desktop) | Firefox Add-ons — **not listed yet**; the link will be here when it is | Firefox 140 or later. Firefox for Android has no bookmarks API for extensions |
Requires Chrome 136 or later (April 2025), or any Chromium browser of the same
vintage — Edge, Brave, Vivaldi, Opera. On an older browser the store keeps the
version you already have and simply stops updating it.
On an older browser the store keeps the version you already have and simply
stops updating it.
From source (Node.js 26):
Each [GitHub Release](https://github.com/poli0981/bookmarkmagic/releases) carries
the exact packages sent to the stores, with `SHA256SUMS.txt`. Firefox only
installs add-ons Mozilla has signed, so its `-firefox.zip` there is for
checking the store build, not for installing.
From source (Node.js 26) — [`BUILD.md`](BUILD.md) has the details:
```bash
npm ci && npm run build
npm ci && npm run build # Chromium: load .output/chrome-mv3/ at chrome://extensions (Developer mode)
npm run build:firefox # Firefox: about:debugging → Load Temporary Add-on → .output/firefox-mv3/manifest.json
```
Then load `.output/chrome-mv3/` at `chrome://extensions` with Developer mode on.
## Development
```bash
@@ -117,8 +146,8 @@ npm run dev
```
`npm run verify` is the gate everything else answers to — lint, type-check
(svelte-check on the TypeScript 6 API, then `tsc` 7), knip, the grep gate and
the test suite, in that order. It must be green before every commit;
(svelte-check on the TypeScript 6 API, then `tsc` 7), knip, the grep gate, the
licence gate and the test suite, in that order. It must be green before every commit;
`npm run verify:full` adds coverage, the build and the built-manifest check,
and must be green before anything release-bearing.
@@ -134,7 +163,9 @@ code and docs disagree, the docs win. Start with [`CLAUDE.md`](CLAUDE.md), then
Bug reports and translation fixes are welcome —
[the issue forms](https://github.com/poli0981/bookmarkmagic/issues/new/choose)
ask for what is needed, and none of them requires you to write code.
ask for what is needed, and none of them requires you to write code. The
project is in maintenance mode, so a request for a feature that is not on the
roadmap is closed automatically ([`MAINTENANCE.md`](MAINTENANCE.md)).
If a bookmark file will not import, that is the most useful report there is,
because the sample becomes a permanent test. Sanitize it first:
@@ -167,9 +198,10 @@ a public issue.
| Contributing and code of conduct | code@poli0981.dev |
| Sponsorship · collaboration · press | sponsor@ · collab@ · press@poli0981.dev |
Bugs and feature ideas are best as
[issues](https://github.com/poli0981/bookmarkmagic/issues) — they help the next
person too. The extension itself never shows or uses any of these addresses.
Bugs are best as
[issues](https://github.com/poli0981/bookmarkmagic/issues) and ideas as
[Discussions](https://github.com/poli0981/bookmarkmagic/discussions/categories/ideas)
— they help the next person too. The extension itself never shows or uses any of these addresses.
## Support development
@@ -192,5 +224,5 @@ questions: copyright@poli0981.dev.
The BookmarkMagic name and icon identify this project. The GPL lets anyone fork
the code; it does not let a fork present itself as this project.
Not affiliated with or endorsed by Google, Chrome, Mozilla, Firefox or any
browser vendor. Browser names are trademarks of their respective owners.
Not affiliated with or endorsed by Google, Chrome, Mozilla, Firefox,
Microsoft, Edge or any browser vendor. Browser names are trademarks of their respective owners.
+4 -4
View File
@@ -4,13 +4,13 @@
| Version | Supported |
|---|---|
| The latest version published on the Chrome Web Store | ✅ |
| The latest version published on the Chrome Web Store, Firefox Add-ons or Microsoft Edge Add-ons | ✅ |
| Anything older | ❌ |
There is no back-porting, and there is nothing for you to do to stay current:
Chrome auto-updates extensions once a new version passes store review. You can
see which version you are running in the extension's **About** tab, or on
`chrome://extensions`.
your browser updates extensions once a new version passes store review. You
can see which version you are running in the extension's **About** tab, on
`chrome://extensions`, or on `about:addons` in Firefox.
## Reporting a vulnerability
+1 -1
View File
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.6.4/schema.json",
"$schema": "https://biomejs.dev/schemas/2.6.6/schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"files": {
"ignoreUnknown": true,
+80 -8
View File
@@ -1,7 +1,9 @@
# 00 — Project Overview
> **Project:** BookmarkMagic
> **Type:** Chrome/Chromium MV3 browser extension (open source, Chrome Web Store)
> **Type:** MV3 browser extension for Chromium browsers and, since v1.3.0,
> Firefox (open source; Chrome Web Store and, since 2026-11-19, Microsoft Edge
> Add-ons — Firefox Add-ons pending its first review)
> **Owner:** poli0981 (GitHub) / SkullMute
> **Repo:** `poli0981/bookmarkmagic` ✔
> **License:** GPL-3.0-or-later
@@ -26,16 +28,33 @@
> `e2f36bc`); the listing was observed showing **version 1.2.0** (`Updated:
> November 7, 2026`, 5 languages) on 2026-11-10. Installed users are on 1.2.0.
>
> **v1.2.1 — accessibility — is prepared, not yet released.** An accessibility
> statement (`/ACCESSIBILITY.md`) and the fixes an audit found (`06 §5`).
> ⚠️ It needs the owner's manual pass, including the 1.2.0 → 1.2.1 upgrade
> over an existing profile, and a hand upload to the store (`13 §1b`).
> **v1.2.1 — accessibility — is RELEASED on GitHub, never on a store on its
> own.** Tagged and released 2026-11-10 (signed tag on `d61318a`,
> checksum-verified zip): an accessibility statement (`/ACCESSIBILITY.md`) and
> the fixes an audit found (`06 §5`). 1.3.0 carries all of it and went to the
> Chrome Web Store in its place (submitted 2026-11-18); until that clears
> review, Chrome users stay on 1.2.0.
>
> **v1.3.0 — Firefox and Edge — is RELEASED, and LIVE on Edge Add-ons.**
> Tagged and released 2026-11-18 (signed tag on `80c7190`, three
> checksum-verified packages): a Firefox package (desktop, 140 or later), and
> the Chrome package for Edge Add-ons as well, with 1.2.1 inside. The owner
> submitted it to all three stores on 2026-11-18. **Edge Add-ons approved it
> on 2026-11-19** — the first Edge version, live in five languages (§9 has the
> listing). ⚠️ The Chrome Web Store update (in place of 1.2.1) and the first
> Firefox Add-ons version are still in review (§10 items 20–21).
>
> The project is now in **maintenance**, not construction: every change from
> here reaches installed users through a store review, so it needs a version
> bump, a CHANGELOG entry and an update submission (`13 §1b`). Sequencing lives
> in `/CLAUDE.md`; what is still open is in §10 below.
> **Doc suite version:** 1.10 (2026-11-10 — v1.2.0 live; v1.2.1 accessibility)
>
> **Since 2026-11-18 that is a written policy: maintenance mode**
> (`/MAINTENANCE.md`). Dependency and security updates, major platform
> upgrades, bug/UI/UX/accessibility/translation fixes, and features only when
> they are on `15`'s roadmap or genuinely needed; requests for anything else
> are closed by `triage.yml` (`12 §2.6`).
> **Doc suite version:** 1.13 (2026-11-18 — Firefox and Edge, v1.3.0)
---
@@ -118,6 +137,12 @@ v1.0's scope):
- A redesigned UI with a self-drawn icon set, all motion behind
`prefers-reduced-motion` (`06`).
**v1.3.0 adds** two stores: **Firefox Add-ons** (its own package from the same
source — the Bookmarks Menu as a fourth root, separators shown and protected,
Firefox's own move-index rule, `02 §4`, `03`) and **Microsoft Edge Add-ons**
(the Chromium package, unchanged). Release automation for all three stores,
each off until its owner switches it on (`12 §3`).
**v1.2.0 adds** two UI languages, chosen from the CWS dashboard's install and
usage figures: **Simplified Chinese (`zh-CN`) and Romanian (`ro`)** — in the
app, in the manifest and in the store listing (`07`). Traditional Chinese is
@@ -130,6 +155,8 @@ not shipped; a Traditional Chinese browser on "Automatic" gets English.
`ICON` attributes are tolerated on parse and dropped — documented limitation).
- ❌ Dead-link checking (requires host permissions — deferred, see Roadmap).
- ❌ Firefox/Safari *store* releases (WXT keeps the door open; see Roadmap).
*Firefox and Edge became goals on 2026-11-18 (v1.3, `15`); Safari stays
out.*
- ❌ Editing browser-native root folders themselves (Bookmarks Bar / Other
Bookmarks cannot be deleted/renamed — enforced by API anyway).
@@ -167,6 +194,9 @@ Derived identifiers (canonical across docs and code):
| Safety-backup filename | `bookmarkmagic-backup-YYYYMMDD-HHmm.json` |
| Chrome Web Store item id | `eghnciphhegekmnofffpgbdfefckdhmg` (also the value `CHROME_EXTENSION_ID` needs — `12 §3`) |
| Store listing URL | `https://chromewebstore.google.com/detail/bookmarkmagic/eghnciphhegekmnofffpgbdfefckdhmg` |
| Edge Add-ons item id ("CRX ID") | `nchfchjnlihbifggooggpmmacighmdjg` — the `runtime.id` of an install from Edge Add-ons, mapped in `links.ts` (`06 §3.5`) |
| Edge Add-ons Product ID | `3bf2e086-99ee-4f8b-a8db-e13827f04ca1` (the value `EDGE_PRODUCT_ID` needs — `12 §3`) · Store ID `0RDCKC9LZ41P` |
| Edge Add-ons listing URL | `https://microsoftedge.microsoft.com/addons/detail/nchfchjnlihbifggooggpmmacighmdjg` (live 2026-11-19) |
## 10. Manual action items (human-only) ⚠️
@@ -212,7 +242,10 @@ Derived identifiers (canonical across docs and code):
the four is already known — `CHROME_EXTENSION_ID` is the item id in §9. The
other three come from `npx wxt submit init` (`12 §3`). Note there is no
dry-run: the first time that step executes it makes a real submission.
7. **Untested:** `npm run dev:firefox`. No gate exercises it (Firefox is a
7. ~~**Untested:** `npm run dev:firefox`.~~ Since v1.3.0 the Firefox package is
built and checked by CI and the release (`12 §2.1`, `12 §2.3`) and its logic
is tested against a Firefox-shaped fake (`11 §4`). Still ⚠️: nothing has run
it in a real Firefox until the owner's `11 §5` pass. Historical text: No gate exercises it (Firefox is a
non-goal, §7). The `overrides` block that used to threaten it is gone
(`09 §3.1`), but do not assume it works.
8. **Unmeasured:** the 2 s parse budget on a real browser (`11 §6`). The
@@ -254,7 +287,8 @@ Derived identifiers (canonical across docs and code):
### v1.2.1 (added 2026-11-10)
15. ⚠️ **v1.2.1 to the store.** The usual `11 §5` pass plus the **1.2.0 →
15. ⚠️ **v1.2.1 to the store.** The GitHub Release exists and is verified
(`15`'s progress table). The usual `11 §5` pass plus the **1.2.0 →
1.2.1 upgrade over an existing profile**, then the Release zip uploaded in
the dashboard. No listing change: a patch (`13 §5`).
16. ⚠️ **The accessibility checks no script can run** (`11 §5`): a Windows
@@ -268,6 +302,44 @@ Derived identifiers (canonical across docs and code):
18. ⚠️ **Native review of the new strings** — the About link label and the
spoken position — in JA, ZH-CN and RO, with the passes in items 9 and 13.
### v1.3.0 — maintenance mode, Firefox and Edge (added 2026-11-18)
19. ⚠️ **Pin the maintenance announcement** (Discussions #43) — the API cannot.
20. ⚠️ **v1.3.0 to the Chrome Web Store** instead of 1.2.1, which never went
up — **submitted 2026-11-18, in review**. The `11 §5` pass with the
**1.2.0 → 1.3.0 upgrade over an existing profile**, then the Chrome
package from the Release (`13 §1b`). The CWS
listing text may keep its Chrome wording; it is the Chrome store.
21. ⚠️ **The first Firefox Add-ons version, by hand** (`13 §8`) — **submitted
2026-11-18, in review**. The `11 §5` Firefox section on a real Firefox
140+, then the Developer Hub upload of
the Firefox package **and** the sources archive, desktop only, with
`BUILD.md` in the notes to reviewers. AMO's upload validator report is the
first outside check of the package.
22. ✔ **The first Edge Add-ons submission, by hand** (`13 §9`) — submitted
2026-11-18, **approved and live 2026-11-19** (§9). Partner Center flagged
the first description for naming another browser; the Edge copy now names
none (PR #47, `08 §10`). ⚠️ Still open: the `11 §5` Edge items have no
recorded result — above all a profile **signed in with sync on**
(`08 §10`, unverified). An Edge user who meets `NO_WRITABLE_ROOTS` would be
the first sign.
23. ⚠️ **Store automation, when wanted** (`12 §3`): the three environments,
each with a required reviewer, deployments limited to `v*` tags, and its
secrets (Chrome: API v2 service
account; AMO: JWT pair; Edge: API key + Client ID, renewed every 72 days),
then the `*_AUTOPUBLISH` variables.
24. ⚠️ **After the listings go live**: their URLs for the README and the
About link (`06 §3.5` — Edge's needs its listing id), and the AMO/Edge
badges. **Edge ✔ 2026-11-19**: README install table and badge, and the
About link's mapping (ships with the next release — CHANGELOG
`[Unreleased]`). AMO still to come: its About link is already the gecko-id
URL, so only the README row and a badge remain.
25. ⚠️ **Evidence for the Firefox fake** (`11 §4`): a sanitized `getTree()`
dump from a real Firefox 140+ profile, committed as a fixture the fake is
checked against; and a Firefox column in `11 §6`'s parse timing.
26. ⚠️ **Native review** of the strings 1.3.0 added or changed (`07`) in JA,
ZH-CN and RO, and of the store-listing blocks for AMO and Edge.
## 11. Reading order
For humans: this file → `15_ROADMAP.md` → the rest as needed.
+12 -8
View File
@@ -1,6 +1,6 @@
# 01 — Tech Stack
> Versions verified against npm/official sources on **2026-11-10** (first pass
> Versions verified against npm/official sources on **2026-11-18** (first pass
> 2026-07-25).
> Rule: latest stable or LTS only, with any deliberate exception stated inline.
> Re-verify minor/patch at scaffold time (`npm outdated`), but do NOT jump
@@ -10,7 +10,8 @@
| Item | Choice | Rationale |
|---|---|---|
| Browser | Chrome / Chromium, **Manifest V3** | MV2 is fully retired. Edge/Brave/Vivaldi/Opera work from the same build. |
| Browser | Chrome / Chromium, **Manifest V3** — and since v1.3.0 **Firefox**, MV3 too | MV2 is fully retired. Edge/Brave/Vivaldi/Opera run the Chromium package; Edge Add-ons publishes that same package (`08 §10`). Firefox gets its own package from the same source (`wxt build -b firefox`, MV3 forced by `manifestVersion: 3`, `08 §9`). |
| Min Firefox | `strict_min_version: "140.0"` (since v1.3.0) | The first Firefox that accepts `data_collection_permissions`, which AMO requires of new extensions; every ES2025 built-in is older (134). Vite targets `firefox140` for that package. Desktop only — Firefox for Android has no `bookmarks` API. |
| Min Chrome | `minimum_chrome_version: "136"` (was `"120"` through v1.0.1) | The ES2025 floor: 136 is the first Chrome with every ES2025 built-in (`RegExp.escape` 136, `Float16Array` 135, `Promise.try` 128, iterator helpers and Set methods 122). The manifest floor, Vite's `build.target` (`chrome136`) and tsconfig's `lib: ["ES2025", …]` are one number stated three times — `wxt.config.ts` derives two of them from `CHROME_FLOOR`, and `tests/unit/manifest.test.ts` pins all three. Users on Chrome 120–135 keep the version they have and stop receiving updates; nothing is uninstalled. `scheduler.yield()` (129+) is now always present, though the write queue keeps its fallback because the test environment has no `scheduler`. |
| Runtime deps | **0 (zero)** | `DOMParser`, `Blob`, `URL`, `showSaveFilePicker` and `navigator.clipboard` cover all needs. "Zero" means no npm `dependencies`: the compiled Svelte runtime still ships inside the bundle — see `legal/THIRD_PARTY_NOTICES.md`. |
@@ -25,11 +26,11 @@
| **Svelte** | **^5.57.3** | UI, runes mode only (`$state`, `$derived`, `$effect`, `$props`). The compiled runtime ships in the bundle (MIT — `legal/THIRD_PARTY_NOTICES.md`). |
| @sveltejs/vite-plugin-svelte | ^7.3.1 | Compiles `.svelte` and the runes in `.svelte.ts` stores for Vitest (`vitest.config.ts`). Its `deepmerge` dependency carries the one advisory with no fix (`09 §3.1`). |
| @wxt-dev/module-svelte | ^2.0.5 | WXT ↔ Svelte integration. |
| **Biome** | **2.6.4 (pinned exact)** | Lint + format (replaces ESLint + Prettier). Install with `npm i -D -E @biomejs/biome` per Biome guidance. 2.6 started formatting Markdown and YAML; both are excluded in `biome.json` so docs and workflows keep their hand layout (`10 §3`). The `$schema` URL in `biome.json` names the same version and moves with the pin — Dependabot bumps the package and leaves the URL behind. |
| **Biome** | **2.6.6 (pinned exact)** | Lint + format (replaces ESLint + Prettier). Install with `npm i -D -E @biomejs/biome` per Biome guidance. 2.6 started formatting Markdown and YAML; both are excluded in `biome.json` so docs and workflows keep their hand layout (`10 §3`). The `$schema` URL in `biome.json` names the same version and moves with the pin — Dependabot bumps the package and leaves the URL behind. |
| svelte-check | ^4.7.8 | Type/template authority for `.svelte` files. Runs on the TS 6 API (see TypeScript above). |
| **@types/node** | **^26** (matches the Node major) | Types for `node:fs`, `node:path`, `node:child_process` and `process`, which the test suite and `scripts/*.mjs` genuinely use. **Declared explicitly since 2026-08-03** — it used to arrive transitively, and WXT 0.21 stopped providing it. Types only: erased at build, so hard rule 2 (zero *runtime* dependencies) is untouched. |
| jsdom | **^30.1** (was ^29 through v1.0.0) | Test DOM. Not interchangeable — `02 §3` picks jsdom over happy-dom because the Netscape walk depends on parse5's implied-end-tag behaviour. A major bump runs `tests/unit/dom-environment.test.ts` first; if that canary fails, pin rather than loosen the test. |
| **Knip** | **^6** (6.44.1 as of 2026-11) | Dead code: unused files, exports, dependencies. Requires Node ≥ 20.19. v6 swapped the TypeScript backend for oxc-parser — confirm `compilers.svelte` is still the supported `.svelte` hook before scaffold (`10 §4`). |
| jsdom | **^31.0** (was ^30 through v1.2.1, ^29 through v1.0.0) | Test DOM. Not interchangeable — `02 §3` picks jsdom over happy-dom because the Netscape walk depends on parse5's implied-end-tag behaviour. A major bump runs `tests/unit/dom-environment.test.ts` first; if that canary fails, pin rather than loosen the test. |
| **Knip** | **^6** (6.45.1 as of 2026-11-18) | Dead code: unused files, exports, dependencies. Requires Node ≥ 20.19. v6 swapped the TypeScript backend for oxc-parser — confirm `compilers.svelte` is still the supported `.svelte` hook before scaffold (`10 §4`). |
| **Vitest** | **^5.1.0** (was ^4 through v1.0.1) | Unit tests. 5.0 changed `clearMocks` to default `true`, requires `vi.mock` at top level and fails unawaited async assertions; the suite needed no changes. Requires Node ≥ 22.12. |
| @vitest/coverage-v8 | match Vitest | Coverage reporting (`text` + `lcov` for SonarCloud, `12 §2.5`). |
@@ -60,7 +61,9 @@
"scripts": {
"postinstall": "wxt prepare", // generates .wxt/tsconfig.json — 10 §2 extends it
"dev": "wxt",
"dev:firefox": "wxt -b firefox", // build sanity only, no store release
"dev:firefox": "wxt -b firefox", // MV3 since v1.3.0 (manifestVersion: 3)
"build:firefox": "wxt build -b firefox", // .output/firefox-mv3
"zip:firefox": "wxt zip -b firefox", // the AMO package + its sources archive
"build": "wxt build",
"zip": "wxt zip",
"check": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings && tsc --noEmit && tsc -p tsconfig.scripts.json",
@@ -70,12 +73,13 @@
"knip": "knip",
"guard": "node scripts/guard.mjs", // the source gate, 08 §3
"check:manifest": "node scripts/check-manifest.mjs", // the built-artifact gate, 08 §3
"check:licenses": "node scripts/check-licenses.mjs", // every lockfile licence, 09 §3.2
"icons": "node scripts/gen-icons.mjs", // regenerates the shipped icons (source of truth)
"test": "vitest run",
"test:watch": "vitest",
"coverage": "vitest run --coverage",
"verify": "npm run lint && npm run check && npm run knip && npm run guard && npm run test",
"verify:full": "npm run verify && npm run coverage && npm run build && npm run check:manifest"
"verify": "npm run lint && npm run check && npm run knip && npm run guard && npm run check:licenses && npm run test",
"verify:full": "npm run verify && npm run coverage && npm run build && npm run check:manifest && npm run build:firefox && npm run check:manifest -- --browser firefox"
}
}
```
+31 -4
View File
@@ -103,6 +103,8 @@ bookmarkmagic/
│ │ │ └── limits.ts # MAX_FILE_BYTES, MAX_NODES, MAX_DEPTH, LEGAL_VERSION
│ │ ├── browser/
│ │ │ ├── bookmarks.ts # getTree/create/move/update/remove wrappers
│ │ │ ├── roots.ts # getRoots: which live folders are the roots (§4)
│ │ │ ├── live-tree.ts # live → file model; separators, counts, move index (§4)
│ │ │ ├── write-queue.ts # sequential tree writer + progress + abort
│ │ │ ├── storage.ts # typed settings/legal accessors
│ │ │ ├── download.ts # Blob → <a download>
@@ -174,7 +176,7 @@ export interface BookmarkNode {
addDate?: number; // epoch SECONDS (normalized, see timestamps.ts)
lastModified?: number; // epoch SECONDS
toolbar?: boolean; // Netscape PERSONAL_TOOLBAR_FOLDER
root?: 'other' | 'mobile'; // folder IS that browser root (since v1.1.0; toolbar wins)
root?: 'other' | 'mobile' | 'menu'; // folder IS that browser root (since v1.1.0; 'menu' since v1.3.0; toolbar wins)
children?: BookmarkNode[];
}
@@ -220,7 +222,7 @@ Segment construction per mode — spelled out so it is not left to interpretatio
| Mode | Segments |
|---|---|
| `new-folder` | Exactly one. `parentId` = Other Bookmarks; `nodes` = the single `Imported <date>` wrapper folder containing the whole parsed tree, root folders included. Markers are informational only (`03 §1`). |
| `merge` | Top-level nodes are routed first (`core/route.ts`, `03 §1` step 7): a `toolbar` folder's children → the bar; a `root: "other"` folder's children → Other, in its place in the order; a `root: "mobile"` folder's children → Mobile (an ordinary folder under Other when the profile has no Mobile root); everything else → Other. Each root's list is then matched against that root's live children (`core/merge.ts`, `05 §5`): a folder with the exact title of a writable live child folder is **reused** — not created — and its children are matched one level down; everything else becomes a node in the segment of the live folder it lands in. One segment per live folder that receives anything, in first-use order. |
| `merge` | Top-level nodes are routed first (`core/route.ts`, `03 §1` step 7): a `toolbar` folder's children → the bar; a `root: "other"` folder's children → Other, in its place in the order; a `root: "mobile"` folder's children → Mobile (an ordinary folder under Other when the profile has no Mobile root); a `root: "menu"` folder's children → the Bookmarks Menu (an ordinary folder under Other where there is none — every Chromium browser); everything else → the Bookmarks Menu where the browser has one (Firefox — what Firefox's own HTML import does with loose entries), else Other. Each root's list is then matched against that root's live children (`core/merge.ts`, `05 §5`): a folder with the exact title of a writable live child folder is **reused** — not created — and its children are matched one level down; everything else becomes a node in the segment of the live folder it lands in. One segment per live folder that receives anything, in first-use order. |
| `replace` | As `merge`, but planned against **emptied** roots, so nothing matches and every node is created. |
A root nothing is bound for gets no segment. `stats.toCreate` is the total
@@ -229,7 +231,23 @@ one `done` counter for the whole import (`05 §6`). Every node is accounted for:
`toCreate + reusedFolders + unwrapped root folders` equals the deduped tree
(asserted over 200 random trees in `merge.test.ts`).
Chrome root mapping: `browser/bookmarks.ts` `getRoots()` resolves the three
**Firefox (since v1.3.0).** Firefox has no `folderType`, its roots are GUIDs —
`menu________`, `toolbar_____`, `unfiled_____`, `mobile______`, in that order —
and it has a fourth root Chromium lacks, the **Bookmarks Menu**. `getRoots()`
tries those GUIDs after the Chromium ids and before position, so the position
fallback (which on Firefox would take the Menu for the bar) is never reached,
and returns the Menu as a fourth destination that Replace also empties. The
position fallback itself never takes the Menu either: it is left out of the
candidates, so roots with unknown ids still map the bar, Other and Mobile
(tested with hand-built roots in `bookmarks.test.ts` — neither fake reaches
that path).
**Separators** exist only in Firefox's live tree: `type: "separator"` and, for
historical reasons, `url: "data:"`. They are recognised by `type`, never by
the url; `toBookmarkNodes` drops them, so the file model never holds one, and
`#edit` shows them as lines no command can touch (`03 §3`). Counting helpers
in `browser/live-tree.ts` keep them out of every bookmark count.
Chrome root mapping: `browser/roots.ts` `getRoots()` resolves the three
destinations by `folderType` (`bookmarks-bar`, `other`, `mobile`, Chrome
134+), among this device's roots only — a signed-in account's own roots
(`syncing: true`, Chrome 134+) are listed but never written to or emptied.
@@ -240,6 +258,11 @@ that fails do Mobile-marked folders land under Other. Segment `parentId`s
always come from that resolution or from live folders found in the same read,
never a literal — but tests may rely on the ids.
**Address length inside the browser.** Firefox refuses an address longer than
65 536 characters (and shortens titles past 4 096). The import drops such
addresses before planning, as `URL_TOO_LONG`, using a limit the browser layer
passes in — Chromium has none, so nothing changes there (`03 §1`).
**Depth inside the browser** is capped separately from the parse cap:
`MAX_WRITE_DEPTH` (90 levels below a root). Chrome stores its bookmarks as JSON
it reads back with a 200-level nesting limit, two levels per folder, so a tree
@@ -318,7 +341,11 @@ the hash for a new tab, or via the broadcast for an open one.
`NEWER_VERSION`, `EMPTY_TITLE`, and since v1.1.0 `INVALID_URL` (an address
`chrome.bookmarks.create` would reject), `PLACE_QUERIES_SKIPPED` (Firefox smart
bookmarks), `EXTRA_ROOTS_SKIPPED` (vendor roots in a browser JSON file) and
`UNREADABLE_ENTRIES` (a `<DT>` with no readable `<A>` or `<H3>`).
`UNREADABLE_ENTRIES` (a `<DT>` with no readable `<A>` or `<H3>`), and since
v1.3.0 `SEPARATORS_SKIPPED` (separators an HTML file or a Firefox backup
holds — no format keeps one) and `URL_TOO_LONG` (an address longer than the
browser accepts, 65 536 characters in Firefox — added by the import from
the browser layer's limit, not by a parser).
- `browser/` adds `BmBackupError { code }` for the forced safety backup
(`03 §1` step 6b) — `BACKUP_SERIALIZE_FAILED`, `BACKUP_EXCEEDS_LIMITS` (since
v1.1.0: the backup would be refused by the import's own caps, so it is no
+47 -4
View File
@@ -45,7 +45,15 @@
- Steps 1–7 touch nothing in the browser. The first write happens at step 8.
- Replace = delete children of Bookmarks Bar + Other Bookmarks (+ Mobile if
present), then write. Roots themselves are never deleted (API forbids it).
present, + the Bookmarks Menu on Firefox), then write. Roots themselves are
never deleted (API forbids it). On Firefox the deletion includes the
**separators** in those roots, and nothing restores them — no format
BookmarkMagic writes keeps one — so the confirmation says how many will go
(`import.replaceSeparators`, shown only when there are any). The counts in
that confirmation never include separators among the bookmarks, and they
cover exactly what Replace deletes: the roots it empties, never a signed-in
Chrome account's own roots (`syncing: true`, `02 §4`), which it leaves
alone (fixed in v1.3.0 — they used to be counted).
- **Root routing** (`core/route.ts`), top-level nodes only — deeper, markers
are data. A folder that *is* a browser root is **unwrapped**: its children go
into that root and the folder itself is never written.
@@ -55,7 +63,18 @@
the order;
- `root: "mobile"` folder → its children into Mobile Bookmarks; a profile
with no Mobile root keeps it as an ordinary folder under Other;
- everything else → Other Bookmarks.
- `root: "menu"` folder (since v1.3.0) → its children into Firefox's
Bookmarks Menu; every Chromium browser, which has no menu root, keeps it
as an ordinary folder under Other;
- everything else → the **Bookmarks Menu on Firefox**, Other Bookmarks
everywhere else. Firefox's own HTML export leaves the menu's contents loose
at the top level, and Firefox's own import puts loose entries back into
the menu; doing the same is what makes a Firefox file round-trip in
Firefox. It also means a **Chrome** HTML export's Other and Mobile
contents, which Chrome writes loose (`04 §1.2`), land in the Menu in
Firefox — as they do with Firefox's own import. BookmarkMagic's exports
mark every root, so they are not affected. New-folder mode is not routing and stays the same on every
browser: `Other Bookmarks/Imported <date>/…`.
The markers come from our own exports and backups (`04 §1.1`, §2), from
Firefox's HTML export (`UNFILED_BOOKMARKS_FOLDER`), and from the two browser
@@ -65,6 +84,13 @@
the whole tree, root folders included, goes under
`Other Bookmarks/Imported <date>/…` (markers recorded in the preview as
informational).
- **What Firefox refuses is dropped before planning** (since v1.3.0): an
address longer than 65 536 characters (`URL_TOO_LONG`, counted; the limit
comes from the browser layer, and Chromium has none). Firefox also shortens
titles past 4 096 characters on its own; that is a documented limit, not a
warning. Separators a file holds — `<HR>` in HTML, separator entries in a
Firefox JSON backup — are counted as `SEPARATORS_SKIPPED`: the file model has
no separator, on any browser.
- **Merge reuses folders** (`core/merge.ts`, `05 §5`). Below each destination
root, a file folder with the exact, case-sensitive title of a writable child
folder of the live folder its parent matched is reused — never created,
@@ -193,14 +219,31 @@ tree key was ignored.
| Move | drag & drop onto a row — before, after or into (`planDrop`, `05 §10`) → `bookmarks.move(id, { parentId, index })`, or `{ parentId }` alone into a folder; "Move to…" (row button, menu key / Shift+F10) → modal folder list with a filter → `bookmarks.move(id, { parentId })`, appended; **Alt+↑ / Alt+↓** on the tree (since v1.2.1) → `nudgeTarget` picks the sibling shown above or below, then the same `planDrop` (before / after) and the same `moveTo` as a drag — no second write path. One move at a time. The command reports the row's new place among the siblings on screen — the same "n of m" as its `aria-posinset` — which the tab speaks (`06 §5`) |
| Delete | Del or the row button → confirm dialog (folder shows descendant count) → `removeTree` / `remove`; when the deleted row had focus, focus moves to the next row, else the previous. A copy deleted from the duplicate panel leaves the tree's focus where it was |
| New folder | toolbar button → `bookmarks.create({ parentId, title })` in the focused folder, beside a focused bookmark, else in the first writable root → inserted at once unless its live event got there first (Chrome fires `onCreated` before `create` resolves, so either may win), a search that would hide it cleared, and every folder above it opened as the user's own — so clearing the search cannot close them again → inline rename |
| Sort A→Z | toolbar (the focused folder, or the focused bookmark's folder) or a folder row's button → `planSort` (`05 §10`) → confirm stating how many items move → one awaited `bookmarks.move(id, { parentId, index })` per planned move, yielding every 25, under the write lock (§5). Refused part-way → "moved d of t" and a re-read: there is no undo |
| Sort A→Z | toolbar (the focused folder, or the focused bookmark's folder) or a folder row's button → `planSort` (`05 §10`; on Firefox each run between two separators is sorted on its own, and separators stay where they are) → confirm stating how many items move → one awaited `bookmarks.move(id, { parentId, index })` per planned move, yielding every 25, under the write lock (§5). Refused part-way → "moved d of t" and a re-read: there is no undo |
| Open bookmark | Enter, double-click, or the row's Open button → `tabs.create({ url })` for `http:`/`https:` only (`09` T3); anything else is refused with a toast |
| Copy link | the row button, or Ctrl/⌘+C on the focused row → `navigator.clipboard.writeText` (`09` T8) |
| Duplicate finder | toolbar toggles the panel → groups by normalized URL, computed **only while the panel or its confirmation is showing**, policy-managed copies left out (the browser refuses to delete them) → per-copy delete, or "keep first in each group" (confirm with the exact count) under the write lock; stopped part-way → "deleted d of t" and a re-read |
**Separators (Firefox, since v1.3.0)** are rows of their own in the tree: a
line at the depth of its siblings, outside the accessibility tree
(`aria-hidden`), never focused, matched, counted, opened, renamed, deleted,
dragged or dropped into — and never offered as a duplicate of each other,
which their shared `data:` address would otherwise make them. They are still
siblings, so positions stay the browser's: a drag lands where it was dropped,
and Alt+↑ above a separator moves the row past it, one place.
**The move index is the browser's own rule.** `planDrop` computes a target
twice (`05 §10`): Chromium's `bookmarks.move` counts a move to the right as if
the node were still in place (`position.api`), Firefox's counts after removing
it (`position.local`). The adapter sends the one its browser expects, and the
move's own reply (the node's new `index`) is checked against `position.local`:
a mismatch re-reads the tree rather than leave it disagreeing with the browser.
**Live sync** (`edit/live-sync.ts`, `05 §11`). `#edit` subscribes on enter and
unsubscribes on leave: `bookmarks.onCreated/onRemoved/onChanged/onMoved`, plus
`onChildrenReordered` and Chrome's own importer's `onImportBegan/onImportEnded`.
`onChildrenReordered` and Chrome's own importer's `onImportBegan/onImportEnded`
where the browser has them (Firefox has neither; its own sort and import send
one `onMoved`/`onCreated` per node, which the burst rule below absorbs).
Events are queued and applied together **once per animation frame**, in arrival
order. An import running in another tab sends one `onCreated` per node — 1.0.x
patched the tree, and rescanned it for duplicates, on every one — so past 500
+29 -7
View File
@@ -84,6 +84,19 @@ winning:
| Bookmarks Bar | `PERSONAL_TOOLBAR_FOLDER="true"` | every browser |
| Other Bookmarks | `UNFILED_BOOKMARKS_FOLDER="true"` | Firefox (its own exporter writes it), and us |
| Mobile Bookmarks | `MOBILE_BOOKMARKS_FOLDER="true"` | us — importers ignore attributes they do not know |
| Bookmarks Menu (Firefox) | *none* — its contents are written **loose at the top level** | every browser, the way Firefox's own exporter writes it (since v1.3.0) |
The Bookmarks Menu has no attribute of its own in Firefox's format: Firefox
exports the menu's entries as the file's top level and imports loose
top-level entries back into the menu. A BM JSON `root: "menu"` folder (§2)
is therefore written to HTML by unwrapping it — its children appear at the
top level, before the marked roots — and reading that file in Firefox puts
them back where they were (`03 §1`). Chromium has no menu root, so in Chrome
or Edge those entries land in Other Bookmarks, as they do from Firefox's own
export. The other way round, Chrome's own export writes Other's and Mobile's
contents loose (§1.2), so in Firefox they land in the Bookmarks Menu, exactly
as Firefox's own import places them; our exports mark both roots and land
where they came from.
### 1.2 Parse tolerance (import)
@@ -116,7 +129,11 @@ Must accept, with a warning where noted:
space in the host) → skipped, `INVALID_URL`, because `chrome.bookmarks.create`
rejects it mid-write, after a Replace has already cleared the tree; Firefox
`place:` smart bookmarks → skipped, `PLACE_QUERIES_SKIPPED` (Chrome's own
importer drops them too; in Chrome they are dead links). `javascript:`,
importer drops them too; in Chrome they are dead links, and on Firefox
BookmarkMagic still does not write them — the notice says "skipped", not
"dead", since v1.3.0). On Firefox, an address longer than 65 536 characters
→ skipped before planning, `URL_TOO_LONG` (applied after parsing, with the
limit the browser layer passes in, so every format is covered by one rule). `javascript:`,
`data:` and `file:` addresses are kept verbatim (`09` T3). Fixture:
`weird/invalid-urls.html`.
- **Empty titles are kept empty** (since v1.1.0), counted as `EMPTY_TITLE`.
@@ -146,8 +163,11 @@ Must accept, with a warning where noted:
The older `chrome-131-export.html` wraps them in an `Other bookmarks` folder
that Chrome itself never writes; it is kept as a third-party shape, not as a
record of Chrome.
- `<HR>` separator elements (Firefox) → skipped, no warning. These are
*elements*, so "unknown attributes ignored" does not cover them.
- `<HR>` separator elements (Firefox) → skipped and **counted**,
`SEPARATORS_SKIPPED` (no warning until v1.3.0; once Firefox users could
import, a silent loss stopped being acceptable). These are *elements*, so
"unknown attributes ignored" does not cover them. The file model has no
separator: none of the four formats BookmarkMagic writes carries one.
- Empty folders → preserved.
- **Root list selection.** Do **not** pick a single root `<DL>` —
`document.querySelector('dl')` and "the outermost `<DL>`" are both lossy.
@@ -214,9 +234,9 @@ not an anomaly, and must not raise a warning (`05 §4`).
omit `children` (⇒ empty). Unknown extra keys are ignored on import
(forward compatibility); `version > 1` → warning "newer file, best-effort";
an absent `version` is read as 1.
- `"root": "other" | "mobile"` (since v1.1.0, folders only, never beside
`"toolbar"`) marks a folder that IS that browser root — the JSON form of
§1.1's markers. Additive: v1 readers ignore unknown keys, so the version stays
- `"root": "other" | "mobile" | "menu"` (since v1.1.0; `"menu"`, Firefox's
Bookmarks Menu, since v1.3.0; folders only, never beside `"toolbar"`) marks a
folder that IS that browser root — the JSON form of §1.1's markers. Additive: v1 readers ignore unknown keys, so the version stays
1, and a 1.0.x reader simply nests as before.
- **Legacy backups.** A 1.0.x safety backup has exactly the shape of a Chromium
profile — `generator` `BookmarkMagic 1.0.x`, no `root` keys, three top-level
@@ -309,7 +329,9 @@ item — `15`). One line of `JSON.stringify` output:
```
- Nodes: `type` `text/x-moz-place` (bookmark: `title`, `uri`), `…-container`
(folder: `title`, `children`), `…-separator` (skipped silently, as `<HR>` is).
(folder: `title`, `children`), `…-separator` (skipped and counted,
`SEPARATORS_SKIPPED`, as `<HR>` is — so a backup and its HTML twin still
give the same result, which the parity rule requires).
A node with no `type` falls back to `typeCode` 1/2/3. Dates are **PRTime** —
integer microseconds since the Unix epoch — converted explicitly and
truncated, as Firefox's own HTML export does (`microsToSeconds`).
+20 -6
View File
@@ -335,11 +335,23 @@ froze the tab.
## 10. Reordering — `edit/sort.ts`, `edit/move-target.ts`
Both write through `chrome.bookmarks.move`, whose index has one trap: **within
one parent, a move to the right counts the target index as if the node were
still in place**, while `onMoved` — and `patch-tree`'s `moveNode` — count after
its removal. Moving `a` after `c` in `[a, b, c]` is `move(a, { index: 3 })`, and
`onMoved` then reports index 2. A move to the left needs no adjustment.
Both write through `bookmarks.move`, whose index has one trap, and it is not
the same trap in every browser. **Chromium**: within one parent, a move to the
right counts the target index as if the node were still in place, while
`onMoved` — and `patch-tree`'s `moveNode` — count after its removal. Moving `a`
after `c` in `[a, b, c]` is `move(a, { index: 3 })`, and `onMoved` then reports
index 2. **Firefox** (since v1.3.0) counts after removal in the call too —
`move(a, { index: 2 })` — as Places stores the final position. A move to the
left is the same number in both. `planDrop` returns both numbers; the adapter
(`browser/bookmarks.ts` `move`, through `moveIndexFor` in `live-tree.ts`)
sends `api` to Chromium and `local` to Firefox and returns the index the
browser reports; `moveTo` in `stores/edit-commands.svelte.ts` compares it with
`local` and re-reads the tree on a mismatch (`03 §3`).
**Separators** (Firefox) are children like any other here: they occupy
indices, `planDrop` may place a node before or after one, and Alt+↑/↓ steps
past one as a single place. They are never a drop target *into*, and Sort A→Z
leaves them where they are and sorts each run between them on its own.
**Sort A→Z** (`planSort`), planned before anything moves so the confirmation
can state the number:
@@ -347,7 +359,9 @@ can state the number:
```
sortedOrder(children, locale):
collator = Intl.Collator(locale, { numeric: true, sensitivity: 'base' })
stable sort: folders before bookmarks, then collator.compare(key), then current position
split children into runs at each separator (Firefox; Chromium has none — one run)
each run: stable sort, folders before bookmarks, then collator.compare(key), then current position
result = run₀ sorted, separator₀, run₁ sorted, separator₁, … — every separator keeps its index
key(node) = node.title — or the URL, for a bookmark whose title is blank (as Chrome shows it)
planSort(children, locale):
+23 -5
View File
@@ -276,7 +276,8 @@ disabled while a bulk command runs.
fixed-height scroller, mounted 500 rows at a time with a "Show more" row
(`05 §9`); the roots start open. A row: disclosure chevron · glyph (folder,
open folder, link — a lock for a policy-managed node) · title (an untitled
bookmark shows its address, muted, in mono) · host · a child count on folders ·
bookmark shows its address, muted, in mono) · host · a child count on folders
(bookmarks and folders — a Firefox separator is not counted) ·
⚠ on an address Open refuses (`09` T3) · action buttons, shown on hover and on
the focused row: **Open** and **Copy link** (bookmarks), **Sort A→Z**
(sortable folders), **Rename**, **Move to…**, **Delete** (editable nodes only —
@@ -363,7 +364,7 @@ behind a `<ConfirmDialog>` (six preferences is enough to be worth a confirm).
`<AboutCard>`: logo, name, version (from manifest at runtime), tagline;
links: **GitHub repo ↗** · Report an issue ↗ · Changelog ↗ · Accessibility ↗ ·
Chrome Web Store ↗;
Store listing ↗;
**Third-party code:** no runtime dependencies are installed, and the two
MIT-licensed pieces the build compiles in are named — the Svelte runtime and
WXT's one-line browser shim — with their notices shipped in the package as
@@ -392,9 +393,17 @@ use a screen has no other route from inside the product to either, and the
tree's keys are shown nowhere in the UI. The same test pins its URL and the
file's existence.
"Chrome Web Store" points at the published listing (item id in `00 §9`), added
once the item went public. It is the only route a user has from inside the
product to rate or review it, which `13 §6` depends on.
"Store listing" points at the listing the running copy came from — it is the
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 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
@@ -485,6 +494,15 @@ held failures at the head of the one queue instead, and every later toast —
the panel's close button, the delete buttons having gone with the copies.
After a confirmed **Sort A→Z** from the toolbar — whose button is disabled
while the sort runs, which is what dropped it — focus goes to the tree.
- **Separators (Firefox, since v1.3.0)** render as a line inside an
`aria-hidden` list item between the `treeitem`s — outside the accessibility
tree, so the tree still owns only tree items, and with no `role`, which a
hidden element does not need. They take no focus, so ↑/↓, Home/End and
type-ahead pass over them, and `aria-posinset`/`aria-setsize` count the
items around them, not the separators. Alt+↑/↓ does step past one, one place
at a time, as a drag would — and since the separator is not counted, the
spoken "position n of m" does not change on that step. A known limitation
(`ACCESSIBILITY.md`): a screen reader is not told where the separators are.
- **The tree says what Alt+↑/↓ did.** One always-present polite live region in
the tab speaks "<title>: position n of m" after each move — n and m being
the row's own `aria-posinset` and `aria-setsize`, so under a search they
+19
View File
@@ -229,6 +229,25 @@ stay raw.
(`00 §10`), and translation reports arrive through
`.github/ISSUE_TEMPLATE/translation.yml`.
### Browser-neutral wording (since v1.3.0)
Since the same strings run in Chrome, Edge and Firefox, a sentence may name a
browser only when it is about that browser's own thing — "Chrome's Bookmarks
file", "Firefox JSON backups", "Firefox smart bookmarks". A sentence about what
"the browser" does or allows says "the browser". v1.3.0 reworded the three
that were not true everywhere, in all five languages:
| Key | Was | Is |
|---|---|---|
| `import.dateNotice` | "Chrome does not let an extension set…" | "The browser does not let an extension set…" |
| `about.store` | "Chrome Web Store listing" | "Store listing" (the URL follows the install, `06 §3.5`) |
| `warnings.PLACE_QUERIES_SKIPPED` | "…skipped — here they would be dead links." | "…skipped." (on Firefox they are not dead links; BookmarkMagic still does not write them) |
and added, with Romanian's `few` form where a count is involved (§5):
`warnings.URL_TOO_LONG`, `warnings.SEPARATORS_SKIPPED`,
`import.replaceSeparators` and `import.target.menu`. The JA, ZH-CN and RO versions are best-effort and
carry the usual `TODO(review-…)` marker.
## 5. Locale-sensitive edge cases
- **Pluralization.** A plural key is an object of CLDR plural forms. Every
+97 -3
View File
@@ -1,6 +1,9 @@
# 08 — Manifest V3 & Chrome Web Store Compliance
# 08 — Manifest V3 & Store Compliance
Goal: pass review fast and stay listed. Every item here is a hard requirement.
Goal: pass review fast and stay listed — on the Chrome Web Store, Firefox
Add-ons (AMO) and Microsoft Edge Add-ons. Every item here is a hard
requirement. §1–§8 were written for Chrome and still hold for every store;
§9 (Firefox) and §10 (Edge) add what differs.
## 1. Manifest (generated by WXT from `wxt.config.ts`)
@@ -20,6 +23,18 @@ export default defineConfig({
});
```
Since v1.3.0 the manifest is a function of the target browser (`wxt.config.ts`,
`manifestVersion: 3` for every target — WXT would otherwise build Firefox as
MV2). Two packages are built from one source:
| Package | For | Differs from the above |
|---|---|---|
| `bookmarkmagic-X.Y.Z-chrome.zip` (`.output/chrome-mv3`) | Chrome Web Store **and Microsoft Edge Add-ons** | nothing — this is the manifest above (§10) |
| `bookmarkmagic-X.Y.Z-firefox.zip` (`.output/firefox-mv3`) + `…-sources.zip` | Firefox Add-ons | no `minimum_chrome_version`; adds `browser_specific_settings.gecko` (§9) |
Permissions, CSP, pages and icons are **identical** in both; `check:manifest`
holds each package to its own exact key set (§3, layer 2).
## 2. Permissions — justification table (paste into CWS review notes)
| Permission | Justification (single purpose) |
@@ -97,7 +112,8 @@ governed by a page CSP and is not a request the extension makes (`09 §1`).
#### Layer 2 — the built-artifact gate
`npm run check:manifest` (`scripts/check-manifest.mjs`) scans every `.js` file
in `.output/chrome-mv3` for the network identifiers the source gate bans, as
in `.output/chrome-mv3` — and, with `--browser firefox`, in `.output/firefox-mv3`
(since v1.3.0, each against its own key set, §1) — for the network identifiers the source gate bans, as
bare words — including code that arrived through a dependency, which no source
gate can see — and pins the manifest: MV3, the permission list, the exact key
set, the Chrome floor, the exact CSP, that every file the manifest and the
@@ -205,3 +221,81 @@ any of them changes (`09 §4`).
- [ ] Privacy tab answers unchanged, or updated + re-certified.
- [ ] Store listing screenshots regenerated if the UI changed
(`scripts/screenshots.mjs --shoot` — `13 §2`).
- [ ] Firefox: `check:manifest --browser firefox` passes; the gecko id is
still `bookmarkmagic@poli0981.dev`; the sources zip and `BUILD.md`
rebuild the package (§9).
- [ ] Edge: the package uploaded is the Chrome Release asset (§10).
## 9. Firefox Add-ons (AMO) — since v1.3.0
```ts
browser_specific_settings: {
gecko: {
id: 'bookmarkmagic@poli0981.dev', // permanent after the first AMO upload
strict_min_version: '140.0',
data_collection_permissions: { required: ['none'] },
},
},
```
- **The id is permanent.** AMO requires one for MV3 and never lets it change;
every installed copy and every update is tied to it. It is an id, not a
mailbox, and no page of the extension shows it (`15`, 2026-11-18).
- **`data_collection_permissions: { required: ['none'] }`** is Firefox's own
consent system, mandatory for new extensions since 2025-11-03. "None" is the
accurate answer for the same reason §5's privacy answers are "No": nothing is
collected or transmitted. Changing it is the Firefox equivalent of changing
the CWS privacy tab — a minor-version event (`09 §4`).
- **Floor: Firefox 140** — the first release that understands
`data_collection_permissions` (older ones reject the key), and above every
ES2025 built-in the code relies on (`RegExp.escape` and `Promise.try` are
134). Vite's `build.target` for this package is `firefox140`, the
counterpart of `chrome136`. Like the Chrome floor, never raise it in a patch.
- **Desktop only.** Firefox for Android has no `bookmarks` API, so the
manifest declares no `gecko_android` and the listing and every API upload
declare Firefox desktop compatibility only.
- **The extension-page CSP is the same string**, in MV3's object form, and
Firefox enforces it the same way; `check:manifest` pins it in both packages.
- **No background script** on Firefox either, so Firefox's MV3 event-page
model never comes into it.
- **Options can open a second Manager tab.** Chrome reuses an open Manager
for `options_ui` whatever its route, ignoring the `#settings` fragment
(`02 §5`); Firefox matches the whole address, fragment included (its
about:addons and `open_in_tab` code never pass `ignoreFragment`), so with a
Manager open on `#edit` it opens another one on `#settings`. Cosmetic: both
tabs work, and the write lock keeps them from writing at once (`03 §5`).
- **Source code is part of every submission.** The bundle is minified, so AMO
requires the sources and instructions that rebuild the same files. `wxt zip
-b firefox` writes `…-sources.zip` beside the package (dotfiles excluded —
`.nvmrc` among them, so the instructions state Node 26 explicitly), and
`/BUILD.md` is those instructions. AMO's reviewers build on their own
machine and diff the result against the uploaded package.
- **Obfuscation is prohibited** on AMO too; minification is allowed.
- What the code does differently on Firefox — the roots, the separators, the
move index — is `02 §4`, `03 §1` and `05 §10`; none of it is a manifest
matter.
## 10. Microsoft Edge Add-ons — since v1.3.0
- **The Chrome package, unchanged.** Edge accepts Chrome's MV3 manifest keys,
`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.
- **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
writable root (`NO_WRITABLE_ROOTS`) — is **unverified**; `11 §5` checks it
on a real Edge with sync on before the first submission.
- Privacy answers in Partner Center are §5's.
+43 -4
View File
@@ -114,12 +114,19 @@ four of them sat under, and Vite 8 bundles with rolldown rather than esbuild.
None of the six packages was in the lockfile — and a stale override is worse
than none, because the day the package returns it silently pins it.
State after the v1.1.0 toolchain pass (Node 26, Vitest 5, Vite 8.3, WXT 0.21.4):
State on 2026-11-18 (Node 26, Vitest 5.1, Vite 8.3, WXT 0.21.5):
| Check | Result |
|---|---|
| `npm audit --omit=dev` | **0** — nothing third-party is a runtime dependency (CI runs this, `12 §2.1`) |
| `npm audit` (dev included) | 3 low, one root cause: **`deepmerge`** (GHSA-gcqx-w48m-w2h4, prototype poisoning in `mergeObject`), reached through `@sveltejs/vite-plugin-svelte`. **No fixed version exists.** It merges the build's own plugin options at dev/build time — never user data, never in the shipped extension — so it is accepted and recorded rather than overridden. Re-check when the plugin drops or bumps it. |
| `npm audit` (dev included) | **14 high, one root cause: `picomatch`** — GHSA-fc5q-39xc-vjpf (CVE-2026-112366), a ReDoS through single-branch repeated extglobs. **Every version up to 4.0.7 is affected and no fixed version exists**, so there is nothing to upgrade or override to. It is the glob engine of the whole toolchain (WXT, Vite, Vitest, knip, svelte-check, unplugin, tinyglobby, fdir — the other 13 entries are those parents), and it matches patterns this repository writes into its own config files, at build and test time only: never user data, never in the shipped extension. Recorded rather than worked around. Dependabot opens a security PR the day a fixed release exists, and `MAINTENANCE.md` makes that PR urgent. |
| Retired | The `deepmerge` advisory recorded here until v1.2.1 (GHSA-gcqx-w48m-w2h4, low, via `@sveltejs/vite-plugin-svelte`) was **withdrawn** by GitHub on 2026-11-16. `deepmerge` 4.3.1 is still in the tree; nothing else needs doing. |
The maintenance policy's rule for advisories (`MAINTENANCE.md`): a **high or
critical** one is fixed as soon as a fixed version exists — through the
Dependabot security PR, or a lockfile update when a parent's range already
allows the fix. When no fix exists, the advisory goes in the table above with
why it cannot reach a user, and the row stays until the fix lands.
How new advisories are kept out:
@@ -132,6 +139,33 @@ How new advisories are kept out:
- Dependabot *security* PRs bypass `cooldown`; one for a version younger than
a week may fail to resolve until it ages. That is the intended trade-off.
### 3.2 Licence gate — `npm run check:licenses`
Added 2026-11-18. `scripts/check-licenses.mjs` reads every entry of
`package-lock.json` (lockfile v3 records each package's `license` field, and every
entry carries one) and fails the run on any licence outside two lists:
| Packages | Accepted | Why |
|---|---|---|
| What the build compiles into the extension — `CREDITED_PACKAGES` in `scripts/credited-packages.mjs`, the same list the build gate and the notices test read (`14 §5`) | `MIT`, `ISC`, `BSD-2-Clause`, `BSD-3-Clause`, `Apache-2.0`, `0BSD`, `MIT-0` | This code travels inside a GPL-3.0-or-later extension; only permissive licences that combine with it cleanly |
| Everything else — all of it build and test tooling, since there are no runtime dependencies | the above, plus `MPL-2.0`, `BlueOak-1.0.0`, `CC0-1.0`, `CC-BY-4.0`, `Python-2.0`, `Unlicense`, `Zlib` | Tools never ship. File-level copyleft (MPL-2.0 — `lightningcss`, under Vite) is fine for a tool; network copyleft, source-available terms and missing or custom licences are not |
SPDX expressions are evaluated (`OR` needs either side, `AND` both). An entry
with no `license`, `UNLICENSED` or `SEE LICENSE IN …` fails. A new licence
enters the tree through a reviewed change to the lists — or one `EXCEPTIONS`
entry with its reason and a `15` decision-log row — never unnoticed inside a
Dependabot bump. The gate trusts each package's own declaration, as any
lockfile-based check must, and needs neither `node_modules` nor the network.
It runs in `verify`, in CI's `quality` job and in the release build, over the
root lockfile and, since v1.3.0, `tools/publish/package-lock.json` — the
store-upload tool, which ships nothing, so it is held to the toolchain list
(`12 §3`).
Considered and not used: `actions/dependency-review-action`. It sees only
what a pull request changes, reads licences from ClearlyDefined rather than
the lockfile, checks only runtime-scoped packages unless told otherwise, and
cannot run locally — a second, weaker opinion beside this one.
## 4. Permissions posture
`bookmarks` + `storage`, nothing else (justifications in `08 §2`). Any PR
@@ -146,8 +180,13 @@ a **minor-version** event at minimum.
CRC32. The archives' SHA-256 hashes still differ, because `wxt zip` records
file mtimes and nothing normalizes them (there is no `SOURCE_DATE_EPOCH`
support). Do not claim byte-identical rebuilds.
- GitHub Releases attach the exact zip uploaded to CWS + `SHA256SUMS.txt`
so users can verify store build ↔ source correspondence. That works on the
- GitHub Releases attach the exact zips uploaded to the stores + `SHA256SUMS.txt`
(since v1.3.0: the Chrome package, which is also what Edge Add-ons receives,
the Firefox package and its sources archive) so users can verify store build
↔ source correspondence. The stores re-sign or repackage what they receive
(Chrome and Edge into a signed CRX, AMO signs the XPI), so a file installed
from a store does not hash like the Release asset; the checksum vouches for
what was uploaded. That works on the
released artifact itself, which is the same file in both places — it is not a
claim that a third party can rebuild the same hash.
- Tags are signed (GPG) — consistent with the tracker-repo signing practice.
+1 -1
View File
@@ -50,7 +50,7 @@ rather than assign `undefined`. Build nodes with conditional spreads
```jsonc
{
"$schema": "https://biomejs.dev/schemas/2.6.4/schema.json",
"$schema": "https://biomejs.dev/schemas/2.6.6/schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
// Svelte, CSS, Markdown and YAML are excluded on purpose — see the notes below.
"files": {
+81 -9
View File
@@ -189,6 +189,28 @@ Also in `tests/unit/browser/` (v1.1.0):
code with its URL-bearing detail absent; crash hooks record names only, and
stop after teardown.
**Firefox flavour (since v1.3.0).** There is no Firefox in CI, so
`tests/helpers/fake-bookmarks.ts` takes `{ flavour: 'firefox' }` and then
behaves the way Firefox's source says its API does
(`browser/components/extensions/parent/ext-bookmarks.js`, Places'
`Bookmarks.sys.mjs`): GUID roots in the order Menu, Toolbar, Other, Mobile,
all four always present; no `folderType`; separators as
`{ type: 'separator', url: 'data:' }`; a same-folder `move` that takes the
final position; no `onChildrenReordered` or `onImport*`; `get('3')`
rejected; addresses over 65 536 characters refused. Firefox has suites of its own rather than
a second pass of the Chromium ones: `firefox-import.test.ts` (roots by GUID;
Merge, New-folder and Replace — all four roots emptied, the backup restored
twice; export), `edit-firefox.test.ts` (the edit model, keyboard positions,
Sort A→Z around separators, drops and Alt+↑/↓ at Firefox's index, the re-read
when the browser reports another landing place), `live-tree.test.ts`
(separators, counts, the Menu marker, each browser's move index) and the pure
`firefox-menu.test.ts`. The position fallback in `getRoots`, which neither
fake reaches — both have known ids — is tested in `bookmarks.test.ts` with
hand-built roots of unknown ids, including a Menu listed first. ⚠️ The fake is built from reading Firefox's source;
a sanitized `getTree()` dump from a real Firefox 140+ profile, committed as a
fixture the fake is checked against, would turn that reading into evidence
(`00 §10`).
### #edit logic, stores, styles and scripts
The components have no test framework (§1), so everything that can move out of
@@ -256,11 +278,21 @@ 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
browser JSON formats and the audit's HTML leaks, beside the older
`sanitize-bookmarks.test.ts` — `09 §6`).
`sanitize-bookmarks.test.ts` — `09 §6`). New in Phase 10:
`check-licenses.test.ts` (SPDX expressions, the shipped list held stricter
than the toolchain's, a missing or custom licence refused, the repository's
own lockfile passing — `09 §3.2`) and `triage.test.ts` (every branch of the
maintenance-mode decision, the feature form's dropdown wording, and no event
text interpolated into the workflow's shell — `12 §2.6`).
## 5. Manual QA checklist (run before every store submission)
@@ -440,6 +472,42 @@ failure mode that would hit every installed user at once.
smoke it. This is the only check that the artifact users receive is the
artifact that was tested (`13 §1b` step 10).
### Firefox and Edge (since v1.3.0) — before the first submission to each
Firefox (140 or later; about:debugging → Load Temporary Add-on →
`.output/firefox-mv3/manifest.json`, on a profile you can afford to lose):
- [ ] The four roots are where they belong: an import in Merge mode of a
BookmarkMagic HTML export puts the bar's entries in the **Bookmarks
Toolbar**, Other's in **Other Bookmarks**, loose entries in the
**Bookmarks Menu**; New-folder mode puts `Imported <date>` under Other
Bookmarks.
- [ ] **Replace, then restore the safety backup with Replace twice**: menu,
toolbar, Other and Mobile come back in their own roots, never nested; the
confirmation counted the separators it was about to delete and said they
would not come back.
- [ ] Export all four formats: no `data:` entry where a separator was; HTML
re-imports into Firefox with the menu restored; an import of Firefox's
own HTML export reports the separators it skipped.
- [ ] #edit: separators are lines that ↑/↓ and type-ahead skip; Alt+↑/↓ steps
past one; a drag before/after a row lands exactly there (the move-index
rule, `05 §10`); Sort A→Z leaves separators where they are; the
duplicate panel never lists separators.
- [ ] Replace's backup on Firefox goes through the **anchor download and the
"I have the backup" confirmation** (no `showSaveFilePicker`).
- [ ] About → "Store listing" opens the AMO listing; right-click → Options
lands on #settings (a second Manager tab here is expected, `08 §9`).
- [ ] The Manager in every language; Firefox's own locale fallback.
Edge (the Chrome package, Load unpacked from `.output/chrome-mv3`):
- [ ] **Signed in with sync on**: #edit loads and Merge writes — no
`NO_WRITABLE_ROOTS` (`08 §10`, unverified until this item is done).
- [ ] The Chrome items above that touch roots: Favorites bar / Other
favorites receive what Bookmarks bar / Other bookmarks would.
- [ ] About → "Store listing" opens the README's install section (the Edge
listing's address is not known until it exists).
## 6. Performance budgets (checked manually in v1)
- Parse 25 MB / 100k HTML file: < 2 s.
@@ -450,15 +518,19 @@ failure mode that would hit every installed user at once.
### Measured 2026-07-26 — Phase 5
A generated 100 000-node Netscape file (11.2 MB, 99 000 bookmarks in 1 000
folders), timed **under jsdom 29**:
folders), timed under jsdom — one column per jsdom major, never overwritten:
| Stage | Time |
|---|---|
| `detectFormat` | 0 ms |
| `parseNetscapeHtml` | **2 869 ms** |
| `buildUrlIndex` | 42 ms |
| `diffAgainstBrowser` | 53 ms |
| `serializeNetscapeHtml` | 72 ms |
| Stage | jsdom 29 (2026-07-26) | jsdom 31 (2026-11-18) |
|---|---|---|
| `detectFormat` (now `sniffFormat`) | 0 ms | 0 ms |
| `parseNetscapeHtml` | **2 869 ms** | **2 484 ms** (median of 3 runs, 2 416–2 733) |
| `buildUrlIndex` | 42 ms | not re-run (pure JS) |
| `diffAgainstBrowser` | 53 ms | not re-run (pure JS) |
| `serializeNetscapeHtml` | 72 ms | not re-run (pure JS) |
The jsdom 31 column: Node 26.13, Windows 11, Intel i7-14700KF, the file from
`gen-fixture.mjs --nodes 100000`. The jsdom 30 bump (2026-08-03) added no
column, so there is no jsdom 30 figure.
⚠️ **This does not settle the 2 s budget either way.** Everything except the
parse is pure JS and comfortably fast; the parse is dominated by `DOMParser`,
+150 -23
View File
@@ -66,9 +66,12 @@ Three jobs. The two whose names branch protection requires (§5) are
quality gates at all (§1). In order: `lint`, `check` (svelte-check on the
TS 6 API — failing on warnings too since v1.2.1, which is what makes Svelte's
`a11y_*` checks a gate, `10 §3` — then the TS 7 `tsc`), `knip`, `coverage` (`11 §1` thresholds),
`guard` (`08 §3`), `npm audit --omit=dev --audit-level=low` (the
zero-runtime-dependencies claim, `09 T5`), `build`, `check:manifest`. The last
two exist because the unit test over `wxt.config.ts` proves what we *asked*
`guard` (`08 §3`), `check:licenses` (every licence in the lockfile, `09 §3.2`),
`npm audit --omit=dev --audit-level=low` (the
zero-runtime-dependencies claim, `09 T5`), `build`, `check:manifest`, and since
v1.3.0 `build:firefox` + `check:manifest -- --browser firefox` — the second
package, held to its own key set (`08 §1`, `08 §9`). The build/check pairs
exist because the unit test over `wxt.config.ts` proves what we *asked*
for and only the built manifest proves what WXT *emitted* — a dev build of
the same config carries `tabs`/`scripting`/`host_permissions`.
- **`windows` — "Windows smoke (guard + unit tests)".** Not required. The owner
@@ -115,13 +118,14 @@ Standalone, **not** the ops reusable: the reusable's `release` job only does
by `09 §5`), performs no store submission, and exposes no `outputs:`, so a
caller cannot reference the zip it built.
Four jobs, least privilege first (split 2026-10-28):
Jobs, least privilege first (split 2026-10-28; the store job became three in
v1.3.0):
| Job | Token | Does |
|---|---|---|
| `build` "Gate + package" | `contents: read` | install, **every CI gate again** (a tag skips the branch triggers, and must never ship what a PR would have blocked), `zip`, `check:manifest`, the tag ↔ manifest version check, `SHA256SUMS.txt`; copies both files into a plain `dist/` and uploads that as the artifact `release-<tag>` — `upload-artifact` skips hidden paths such as `.output/` by default, which failed the first v1.1.0 tag run before any Release existed |
| `build` "Gate + package" | `contents: read` | install, **every CI gate again** (a tag skips the branch triggers, and must never ship what a PR would have blocked), `zip` and (since v1.3.0) `zip:firefox` — the Chrome/Edge package, the Firefox package and its sources archive — `check:manifest` on both packages, the tag ↔ manifest version check on both, `SHA256SUMS.txt` over all three files, each staged by its exact name so a missing one fails the run (a glob would pass with one of three); copies the three files and `SHA256SUMS.txt` into a plain `dist/` and uploads that as the artifact `release-<tag>` — `upload-artifact` skips hidden paths such as `.output/` by default, which failed the first v1.1.0 tag run before any Release existed |
| `publish` "GitHub Release" | `contents: write` | downloads the artifact, `sha256sum -c` it, creates the Release with `--verify-tag` (or re-uploads to an existing one). Installs nothing and runs no repository code — the only job that ever holds a write token |
| `store` "Publish to Chrome Web Store" | `contents: read` | only when the repo variable `CWS_AUTOPUBLISH` is `'true'`: `./node_modules/.bin/wxt submit` with the Release asset — the local binary, never `npx wxt`, which may fetch an unpinned package into an environment holding the four `CHROME_*` secrets (SonarCloud S6505/S8543) |
| `store-chrome`, `store-firefox`, `store-edge` | `contents: read` | since v1.3.0, one job per store, each only when its own repo variable is `'true'` (`CWS_AUTOPUBLISH`, `AMO_AUTOPUBLISH`, `EDGE_AUTOPUBLISH`) and each in its own GitHub **Environment** holding only that store's secrets (§3). They install `tools/publish/` — `publish-browser-extension` and its three dependencies, from their own lockfile, scripts off — instead of the whole dev toolchain, check the downloaded files by exact name against the `SHA256SUMS.txt` of the **published Release** (not the artifact's own copy), and run its `publish-extension` binary. Before v1.3.0 a single `store` job ran `wxt submit` after a full `npm ci`: four Chrome secrets shared a runner with ~320 packages |
| `announce` | `contents: read` | Discord, only when `DISCORD_ANNOUNCE` is `'true'` |
Before the split, one job ran `npm ci` — every dependency's install script plus
@@ -200,7 +204,7 @@ Added 2026-10-28, replacing SonarCloud's Automatic Analysis so the project gets
- The price of that isolation: the scan job has no `node_modules`, so Sonar's
type-aware rules resolve our own modules (through `.wxt/`) but not the
dependencies' types.
- The scan action is **pinned to a commit** (`v8.4.0`): it is the step that
- The scan action is **pinned to a commit** (`v8.4.1`): it is the step that
holds `SONAR_TOKEN`. Dependabot and fork PRs get no repository secrets, so the
scan is skipped with a notice instead of failing.
- Coverage: `vitest.config.ts` measures every `src/**/*.ts` module and reports
@@ -219,23 +223,133 @@ Added 2026-10-28, replacing SonarCloud's Automatic Analysis so the project gets
Snyk is connected only as a GitHub App (the `security/snyk (poli0981)` PR
check); there is no `SNYK_TOKEN` and no Snyk step in any workflow.
## 3. Chrome Web Store publishing automation
### 2.6 `triage.yml` — maintenance-mode triage
WXT ships publishing built-in: **`wxt submit`** (wrapping
`publish-browser-extension`). One-time local setup: `npx wxt submit init`
→ walks through creating the Google Cloud OAuth client + refresh token →
produces the four values above → store as **repo Actions secrets**.
Added 2026-11-18 with `/MAINTENANCE.md`. On `issues: [opened, labeled]` and
`pull_request_target: [opened]` it runs `scripts/triage.mjs`, which reads the
runner's event file and prints a decision, then carries it out with the `gh`
CLI the runner ships — no third-party action ever holds its write token
(`issues: write`, `pull-requests: write`, `contents: read`).
**Gating policy:**
- **The decision is code with tests**, not shell: `decide()` is a pure
function (`tests/unit/scripts/triage.test.ts`) — a feature-form issue
answering "Something new" is labelled `maintenance-mode`, commented and
closed *not planned*; the two in-policy answers get `needs-triage`; an
`enhancement` label the owner adds by hand closes the issue the same way; an outside
pull request titled `feat…` is closed. The owner's own issues, members,
collaborators, bots and anything labelled `roadmap` are exempt. The test also
pins the dropdown's wording against `feature_request.yml`, which is the only
thing the decision parses.
- ⚠️ **`pull_request_target` holds a write token for fork pull requests.** The
checkout is the base branch — the event's default — and nothing from the
pull request runs. Titles and bodies reach the script as the event file and
are only compared with constants; the shell reads back an action from a fixed
set, an integer, a label from a fixed list and a comment the script wrote, and
validates the first two before using them.
- **Idempotent.** The feature form fires `opened` and `labeled` for one new
issue. `concurrency` runs them one at a time per number and the second
re-reads the live labels and state before acting.
- The labels must exist (`§5`); `gh … --add-label` fails on a missing one.
- **Order: comment and close first, label last.** The label is what a re-run
reads as "done", so it must not exist before the work it stands for.
- **A hand label closes only when the owner adds it.** An `enhancement` issue
with no answer to the form's question is the owner's one-touch close when
the owner labelled it; from anyone else, or on `opened`, it goes to
`needs-triage` instead of being closed on a guess.
- `actions/checkout` and `actions/setup-node` are **pinned to commits here**,
unlike the other workflows, because this one runs them with a write token
on events anyone can trigger; and setup-node has no `cache:`.
### 2.7 `qodana.yml` — Qodana for JS
Added 2026-11-18. `qodana-js` (JetBrains' JavaScript/TypeScript linter,
which needs the Ultimate licence `QODANA_TOKEN` carries) on push to `main`,
pull requests, a weekly schedule and `workflow_dispatch`. Configuration is
`qodana.yaml`: native mode (`withinDocker: false`), profile
`qodana.recommended`, fixtures and generated output excluded.
- **Its own workflow, never required**, for the reason Sonar has one (§2.5).
- **Two jobs.** `scan` has a read-only `GITHUB_TOKEN`, installs the dev
dependencies (install scripts off) because `qodana-js` resolves types
through `node_modules`, runs the action with PR comments and annotations
off, and keeps the SARIF report as the `qodana-report` artifact.
`publish` installs and runs nothing: it uploads that SARIF to code
scanning (`category: qodana`), so the findings sit beside CodeQL's under
Security and quality and on pull requests.
- ⚠️ **The documented exception to §2.5.** Sonar's token never shares a
runner with dependency code; Qodana's cannot avoid it, since the analysis
needs the dependencies. The token only uploads reports to one Qodana
Cloud project. If a dependency is ever found compromised, rotate it in
qodana.cloud.
- The action is **pinned to the commit of v2026.2.2**, not the vendor's
moving `v2026.2` branch: it holds a token, and the newest tag was younger
than the 7-day cooldown when it was added. Dependabot proposes updates.
- `pr-mode: false`: the whole project every time. It is small, and a pull
request that touches only docs would otherwise scan nothing.
- Dependabot and fork pull requests have no secrets; the scan is skipped
with a notice and `publish` does not run.
- The report artifact is a zip inside the artifact, with absolute entry
names; `publish` extracts the one entry `/qodana.sarif.json` by name. A
glob for the file found nothing on the first run.
- **First run (2026-11-18): 27 findings, none a defect.** Three regular
expressions that could be simpler — fixed — and 24 that contradict a rule
of this repository, switched off in `qodana.yaml` with the reason beside
each: JSDoc completeness (doc comments here are prose, `10 §6`), bitwise
operators in the PNG CRC-32 of `gen-icons.mjs`, and the deliberately
doubled dark palette in `tokens.css`. A finding is fixed when it is a
defect and switched off, with its reason, when it is a convention; it is
never left standing to be ignored.
## 3. Store publishing automation (Chrome Web Store, Firefox Add-ons, Edge Add-ons)
Since v1.3.0 the release workflow can submit to all three stores, each step
**off until its owner switches it on** with a repo variable. Uploaded builds
still go through each store's review; automation removes the clicking, not the
review.
| Job | Gate (repo variable) | Environment | Secrets in that environment | Uploads |
|---|---|---|---|---|
| `store-chrome` | `CWS_AUTOPUBLISH=true` | `chrome-web-store` | `CHROME_PUBLISHER_ID`, `CHROME_EXTENSION_ID` (= the item id, `00 §9`), `CHROME_SERVICE_ACCOUNT_CLIENT_EMAIL`, `CHROME_SERVICE_ACCOUNT_PRIVATE_KEY` | the Chrome package |
| `store-firefox` | `AMO_AUTOPUBLISH=true` | `firefox-add-ons` | `FIREFOX_EXTENSION_ID` (= the gecko id), `FIREFOX_JWT_ISSUER`, `FIREFOX_JWT_SECRET` | the Firefox package and its sources, `listed`, Firefox desktop only |
| `store-edge` | `EDGE_AUTOPUBLISH=true` | `edge-add-ons` | `EDGE_PRODUCT_ID`, `EDGE_CLIENT_ID`, `EDGE_API_KEY` | the Chrome package |
- **The tool is `publish-browser-extension`** (6.2.0 — what `wxt submit`
wraps), installed from `tools/publish/`'s own lockfile: four packages, not
the dev toolchain. A job's secrets are readable by everything on its runner
for the whole job (§2.5), and these can push an update to every user.
- **One job per store**, so a store's credentials never share a runner with
another's, and one store refusing an upload does not stop the others.
- **Environments** carry the secrets, not the repository, so nothing else in
any workflow can read them. Give each one a required reviewer (the owner) to
approve every upload, **and** restrict its deployment branches and tags to
the tag pattern `v*`: an environment GitHub creates on first use has no
rule at all, so any branch with a workflow that names it — a pushed branch,
not only a release — could reach its secrets. The reviewer is the second
lock, not the only one.
- **Chrome Web Store API v2.** v1.1 — what the old `store` job's
client-id/secret/refresh-token secrets used — was shut down on 2026-10-15;
that job would have failed the day `CWS_AUTOPUBLISH` was set. v2 takes a
publisher id and a Google Cloud **service account** (`CHROME_API_VERSION=v2`
is set by the job, never left to the tool's default).
- **AMO: the first version must be created by hand.** The API (and the tool)
can add a version to an add-on that exists, not create one; `13 §8`. AMO
JWT credentials come from addons.mozilla.org/developers/addon/api/key/.
- **Edge: the first submission is made in Partner Center**, by hand (`13 §9`).
API keys (v1.1, with a Client ID) **expire every 72 days** — a scheduled
chore, not an incident; until rotated, `store-edge` fails and the others do
not.
- **No re-run of a store job that succeeded**: every store refuses a version
number it has seen. Re-run only the failed job (`13 §7`).
| Version | Method |
|---|---|
| v1.0.x | **Manual**, per the `13 §1b` runbook: download the zip from the GitHub Release (not the CI artifact — the Release asset is the one `SHA256SUMS.txt` covers) → Dashboard → Package → upload new package → submit. The original rationale was "first reviews often ask questions"; in the event the first review asked nothing. It stays manual because none of the four `CHROME_*` secrets exists yet and `CWS_AUTOPUBLISH` is unset. |
| v1.1+ | **Automated**: the `Publish to Chrome Web Store` step in §2.3 runs after the Release succeeds, gated on the repo variable `CWS_AUTOPUBLISH=true` so it can be flipped off instantly if a review dispute is ongoing. |
| v1.0.x–v1.2.x | Chrome Web Store by hand (`13 §1b`) — the `CHROME_*` secrets never existed. |
| v1.3.0 | The first AMO and Edge versions **must** be uploaded by hand (`13 §8`, `13 §9`); the Chrome one by hand until the owner sets up §3's environment. |
| later | Each store automated once its environment has its secrets and its variable is `true`; switch a variable off to stop submitting there instantly (a review dispute, a rollout to watch). |
Notes: uploaded builds still go through CWS review before rollout (automation
removes the clicking, not the review). Consider Dashboard "staged rollout"
manually for risky releases.
Consider a staged (percentage) rollout on the Chrome Web Store for anything
touching the write paths — `CHROME_DEPLOY_PERCENTAGE` for the automated job,
the dashboard otherwise.
## 4. Branch/version flow
@@ -281,20 +395,28 @@ means "unknown", not "not done".
- [x] CodeQL **Default setup DISABLED** (Settings → Advanced Security) —
confirmed 2026-07-26; `codeql.yml` uploads SARIF cleanly, which is only
possible with it off (§2.2).
- [ ] ⚠️ Actions secrets: the four `CHROME_*` values (after `wxt submit init`).
`CHROME_EXTENSION_ID` is already known — it is the published item id in
`00 §9`. Required before `CWS_AUTOPUBLISH` can be flipped for v1.1.
- [ ] ⚠️ Store environments (§3), each with the owner as required reviewer,
deployments limited to tags matching `v*`, and only its own secrets: `chrome-web-store` (the four API v2 values;
`CHROME_EXTENSION_ID` is the item id in `00 §9`), `firefox-add-ons`
(`FIREFOX_EXTENSION_ID` = `bookmarkmagic@poli0981.dev` and the AMO JWT
pair), `edge-add-ons` (product id, Client ID, API key — rotate every 72
days). GitHub creates an environment the first time a job names it, with
no protection; add the reviewer, the `v*` tag rule and the secrets in
Settings → Environments.
- [x] Actions secrets for Discord notifications — **present as of 2026-10-28:**
`DISCORD_CI_WEBHOOK`, `RELEASES_WEBHOOK`, `REPO_WEBHOOK` (the last two under
names the reusable does not read; `release.yml` maps them, §2.3).
`DISCORD_PING_ROLE_ID` is optional and unset.
- [x] `SONAR_TOKEN` — set 2026-10-28, used only by `sonarcloud.yml` (§2.5).
- [x] `QODANA_TOKEN` — set by the owner 2026-11-18 (the Qodana Cloud project
token, Ultimate), used only by `qodana.yml`'s `scan` job (§2.7).
- [ ] ⚠️ SonarCloud **Automatic Analysis OFF** (SonarCloud → bookmarkmagic →
Administration → Analysis Method). Required for §2.5; with it on, the CI
scan errors out. The owner agreed to switch it off on 2026-10-28.
- [x] Private vulnerability reporting **enabled** (verified 2026-10-28 via the
API) — `SECURITY.md` and the issue chooser send reporters there first.
- [ ] ⚠️ Repo variable `CWS_AUTOPUBLISH=false` initially. Note that when the
- [ ] ⚠️ Repo variables `CWS_AUTOPUBLISH`, `AMO_AUTOPUBLISH`,
`EDGE_AUTOPUBLISH` — unset, so no store job runs. Note that when a
variable does not exist the expression is simply false, so "not configured"
and "configured off" are indistinguishable from a run's output.
- [ ] ⚠️ Repo variables `DISCORD_ANNOUNCE` and `DISCORD_CI_NOTIFY` — both still
@@ -303,10 +425,15 @@ means "unknown", not "not done".
posts. Unset means skipped; a reusable-workflow caller cannot use
`continue-on-error` to absorb a failure (§2.3).
- [x] Dependabot: npm weekly, grouped dev minor+patch, `github-actions` too —
`.github/dependabot.yml`. Both ecosystems have a 7-day `cooldown`
`.github/dependabot.yml` — and since v1.3.0 `tools/publish/` (the
store-upload tool's own lockfile, §3) as a third ecosystem entry. Both ecosystems have a 7-day `cooldown`
(matching `.npmrc` `min-release-age=7`, `09 §3.1`); WXT is excluded from
the group so every WXT bump arrives alone and gets its built-manifest
diff; majors of the TypeScript pair and `@types/node` are ignored.
- [x] Labels the forms and `triage.yml` apply — `maintenance-mode`,
`needs-triage`, `roadmap` (new with `MAINTENANCE.md`) and `parser`, `i18n`
(named by the parser and translation forms since 2026-08-03, and missing
until 2026-11-18: a form silently drops a label that does not exist).
- [x] Issue templates: `.github/ISSUE_TEMPLATE/` — bug, parser report (requires
a sanitized sample), translation, feature, plus a `config.yml` chooser.
Landed 2026-08-03; `13 §6` had asserted they existed since before launch.
+102 -3
View File
@@ -1,6 +1,9 @@
# 13 — Release & Store Publishing
Developer account: registered & fee paid ✔.
Chrome Web Store developer account: registered & fee paid ✔. Since v1.3.0
there are two more stores — Firefox Add-ons (§8) and Microsoft Edge Add-ons
(§9) — and §1b is still the procedure for every release; §8 and §9 add what
is different there.
## 1. First-submission runbook (v1.0.0) — ✔ completed 2026-07-26
@@ -62,7 +65,9 @@ privacy and distribution tabs are already filled; you are replacing the package.
`release.yml` re-runs every gate, builds, zips, verifies tag↔manifest, writes
`SHA256SUMS.txt`, and creates the GitHub Release.
5. Download the **Release asset**, not the CI artifact — `SHA256SUMS.txt` covers
the Release asset only (`12 §3`). Verify with `sha256sum -c`.
the Release assets only (`12 §3`). Verify with `sha256sum -c --ignore-missing
SHA256SUMS.txt` (since v1.3.0 it lists three files; `--ignore-missing` lets
you check only the one you downloaded).
6. Dashboard → the existing item → **Package → Upload new package** → the zip.
Do *not* create a new item.
7. Fill the "why this update" / what-changed note. Listing text and the privacy
@@ -81,6 +86,19 @@ Chrome auto-updates installed extensions once the new version passes review;
users do nothing and, notably, get no prompt. That is why the upgrade test
matters more than any other single check here.
## 1c. Which file goes where (since v1.3.0)
| Store | Upload | Notes |
|---|---|---|
| Chrome Web Store | `bookmarkmagic-X.Y.Z-chrome.zip` | §1b |
| Microsoft Edge Add-ons | the **same** `…-chrome.zip` | §9 |
| Firefox Add-ons | `bookmarkmagic-X.Y.Z-firefox.zip` **and** `…-sources.zip` | §8 |
A store that re-signs or repackages what it receives (all three do, in some
form) serves users a file whose hash is not the Release asset's. What
`SHA256SUMS.txt` vouches for is that the uploaded file is the Release asset
(`09 §5`).
## 2. Asset checklist ⚠️
### Store assets (submitted — source of truth is the CWS dashboard)
@@ -189,7 +207,11 @@ actually shows and correct the files, not the dashboard.
that is not fixed at once goes into its Known limitations.
- Discord servers (`#support` in the OSS server) — pin an FAQ post.
⚠️ The invite URL is not recorded anywhere in the repo.
- Review flow for feature requests: label → roadmap doc PR → milestone.
- Feature requests, in maintenance mode (`/MAINTENANCE.md`): `triage.yml`
closes a request for something new and labels the two in-policy answers
`needs-triage` (`12 §2.6`). Read every `needs-triage` issue and every closed
one; one that fits goes into `15` by pull request and gets the `roadmap`
label, which the automation leaves alone. Ideas live in Discussions › Ideas.
The three recurring questions are already answered in prose and make the FAQ
seed: favicons cannot be imported; imported bookmarks carry today's date (the
@@ -238,6 +260,15 @@ superseding version has to pass review too.
answers must agree with the code exactly. `npm run guard` and
`npm run check:manifest` are the evidence that they do.
### A store job failed after the Release was published (since v1.3.0)
Re-run **only the failed job** from the run page. Every store refuses a
version number it has already accepted, so re-running the whole workflow would
turn the stores that succeeded red; and nothing before the store jobs needs
redoing — the Release and its checksums are already published. The usual
causes: an expired Edge API key (72 days, `12 §3`), a review hold, a token
revoked in a store dashboard.
### A tag was pushed and the release run failed
`release.yml` runs `gh release create` with no existence check, so a failure
@@ -251,3 +282,71 @@ on) leaves a published Release that a re-run cannot recreate.
`git push --delete origin vX.Y.Z`, then re-tag. Only safe while nothing has
consumed the assets.
- Never move a tag that has already been announced or submitted.
## 8. Firefox Add-ons (AMO) — runbook (since v1.3.0)
**First version — by hand, once** (the API and `publish-browser-extension`
can only add versions to an add-on that exists):
1. The `11 §5` pass on a **real Firefox** (140 or later): about:debugging →
This Firefox → Load Temporary Add-on → `.output/firefox-mv3/manifest.json`
(or the Release's `…-firefox.zip`). Its Firefox section covers the
Bookmarks Menu, separators and Alt+↑/↓.
2. addons.mozilla.org/developers → **Submit a New Add-on** → *On this site*
(listed) → upload `bookmarkmagic-X.Y.Z-firefox.zip` from the Release.
3. **Compatibility: Firefox only** — untick Firefox for Android (no
`bookmarks` API there, `08 §9`).
4. **Source code: yes** → upload `bookmarkmagic-X.Y.Z-sources.zip` from the same
Release. In *Notes to reviewer* paste the short version of `/BUILD.md`:
Node.js 26 and npm 11 (the sources archive drops `.nvmrc`), `npm ci`,
`npm run zip:firefox`, the package lands in `.output/`. Reviewers diff their
build against the upload, file by file.
Checked 2026-11-18: the sources archive, unpacked into an empty folder,
`npm ci --ignore-scripts`, `wxt prepare`, `npm run build:firefox`, rebuilt
every one of the package's 19 files byte for byte.
5. Listing: from `store/listing.<lang>.md`'s **AMO** block — name, summary
(≤ 250 characters), description, category *Bookmarks*, licence *GNU General
Public License v3.0* (the code is GPL-3.0-or-later), privacy policy
`https://github.com/poli0981/bookmarkmagic/blob/main/legal/PRIVACY.md`,
homepage the repository, support site the repository's issues. No support
email (`09 §6`).
6. Submit, and record the review's outcome in `15`. The add-on's page is
`https://addons.mozilla.org/firefox/addon/bookmarkmagic@poli0981.dev/`
(AMO resolves the gecko id; the slug it picks works too).
**Later versions:** by hand, the same way (*Upload New Version*), or
automatically from `release.yml`'s `store-firefox` job once
`firefox-add-ons` has its secrets and `AMO_AUTOPUBLISH` is `true`
(`12 §3`) — the job uploads the package and the sources together.
**Rollback:** AMO can disable a version in the Developer Hub, which sends
users back to the previous approved one — a recall Chrome does not offer.
Still ship the fix forward.
## 9. Microsoft Edge Add-ons — runbook (since v1.3.0)
**First submission — by hand, once:**
1. A Partner Center developer account (no fee) — ⚠️ owner.
2. The `11 §5` pass on a real **Edge**, including a profile **signed in with
sync on** — the case `08 §10` could not verify (`NO_WRITABLE_ROOTS` if
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 **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`). The About link
matches the **CRX ID** (the `runtime.id` an install reports), not the
Product ID.
Done for 1.3.0: submitted 2026-11-18, live 2026-11-19 — ids and listing
in `00 §9`.
**Later versions:** by hand (*Update* → upload the new package), or from
`release.yml`'s `store-edge` job once `edge-add-ons` has its secrets and
`EDGE_AUTOPUBLISH` is `true`. The API key expires every **72 days**; put the
renewal in a calendar.
+14 -2
View File
@@ -89,12 +89,22 @@ its `clsx` helper and WXT's browser shim, which the build always compiled in. **
every change clarifies or corrects a description of what was already true, or
removes an obligation; none adds one or a data flow.
**Precedent (2026-11-18, v1.3.0):** Firefox Add-ons and Microsoft Edge Add-ons
become distribution channels. EULA clause 5 says updates come "through the
store you installed the Extension from"; PRIVACY names all three stores and
Firefox's data-consent declaration ("none"), and calls the settings store by
both browsers' names; DISCLAIMER's note on dates no longer blames Chrome alone,
and the non-affiliation line adds Microsoft and Edge. THIRD_PARTY_NOTICES (same
day, Phase 10) corrected its description of the build tooling's licences.
**Not a bump:** a new channel to receive the same software is not a new data
flow from the Extension, and nothing asks more of the user.
**What each `LEGAL_VERSION` means** — the text a user who accepted that number
agreed to:
| `LEGAL_VERSION` | Accepted text | Notes |
|---|---|---|
| 1 | The four `legal/` files as published 2026-07-26, with the clarifications of 2026-08-03 and 2026-10-29 | The clarifications are listed above; git history has each wording |
| 1 | The four `legal/` files as published 2026-07-26, with the clarifications of 2026-08-03, 2026-10-29 and 2026-11-18 | The clarifications are listed above; git history has each wording |
### 3.2 `LICENSE`
@@ -117,7 +127,9 @@ same value in `package.json#license` (`01 §5`).
MIT-licensed pieces into the package: the Svelte runtime, `clsx` (which the
Svelte runtime imports) and WXT's one-line `browser` shim (`wxt` +
`@wxt-dev/browser`). `wxt.config.ts` fails the build when any other package
would ship (`CREDITED_PACKAGES`). Through v1.0.x the About tab said "None"
would ship (`CREDITED_PACKAGES` — since 2026-11-18 in
`scripts/credited-packages.mjs`, the one list the build gate, the notices
test and the licence gate of `09 §3.2` all read). Through v1.0.x the About tab said "None"
and THIRD_PARTY_NOTICES said "no third-party code" — both wrong, corrected in
v1.1.0. The notices ship as `THIRD_PARTY_NOTICES.txt` (from `src/public/`),
which `check:manifest` requires in every build; `legal/THIRD_PARTY_NOTICES.md`
+47 -18
View File
@@ -1,5 +1,10 @@
# 15 — Roadmap
> **Maintenance mode since 2026-11-18.** What the project still takes, and how
> requests outside that are handled, is [`/MAINTENANCE.md`](../MAINTENANCE.md) —
> the policy, not restated here. Every feature that can still land is on this
> page; anything not on it needs a decision-log row first.
## v1.0 — MVP (store launch) — ✔ SHIPPED
Everything in `00_PROJECT_OVERVIEW.md §6`. Definition of done was
@@ -34,8 +39,13 @@ Build-phase breakdown lives in `CLAUDE.md` (single source for sequencing).
| **v1.2.0 submitted** | ✔ by 2026-11-07 | uploaded to the CWS dashboard by hand, with the 简体中文 and Română listing languages (`13 §1b` step 6, `13 §4`) |
| **v1.2.0 published** | ✔ observed 2026-11-10 | the listing shows version 1.2.0 (`Updated: November 7, 2026`), 3 users, "5 languages" — English, Tiếng Việt, română, 中文(中国), 日本語. ⚠️ As for 1.0.1 and 1.1.0, `13 §1b` step 10 (clean-profile install of the published build + upgrade re-check) has no recorded result |
| 9 — v1.2.1 accessibility | ✔ 2026-11-10 | `ACCESSIBILITY.md` and its intake (issue form, PR checklist, `accessibility@`); the defects an audit of `src/` found that a keyboard-and-Narrator pass had not — an invisible focus ring on the theme control, no forced-colours support, drag-only reordering (Alt+↑/↓), focus dropped on `<body>` in three places, targets under 24 px; dependency sync after Dependabot #31/#32/#35/#36 (`06 §5`) |
| **v1.2.1 released** | ⚠️ pending | signed tag + GitHub Release once the PR is merged |
| **v1.2.1 submitted** | ⚠️ pending | owner: the `11 §5` pass incl. the **1.2.0 → 1.2.1 upgrade over an existing profile**, a Windows contrast theme and a screen-reader pass over Alt+↑/↓, then the zip upload (`13 §1b`) |
| **v1.2.1 released** | ✔ 2026-11-10 | PR #37, merged at the head that was reviewed. Signed tag on `d61318a`, GitHub Release with a `sha256sum -c`-verified zip (`4975b5df…ca13254`, 106 290 bytes). Its manifest differs from 1.2.0's only in `version`, and the file inventory is the same. SonarCloud's new-code gate failed the first push at 73.6 % — the live-sync wiring moved out of `EditTab` had no test — and passed once it had one. `announce` and store publish skipped (variables unset) |
| **v1.2.1 submitted** | skipped — 1.3.0 went up in its place on 2026-11-18 | owner: the `11 §5` pass incl. the **1.2.0 → 1.2.1 upgrade over an existing profile**, a Windows contrast theme and a screen-reader pass over Alt+↑/↓, then the zip upload (`13 §1b`). 1.3.0 contains all of 1.2.1, so uploading 1.3.0 instead is the shorter path (`00 §10` item 20) |
| 10 — maintenance mode, Firefox + Edge | ✔ 2026-11-18 | PR #42: Dependabot #39–#41 and their hand sync, the unfixable `picomatch` advisory recorded, a lockfile licence gate, `MAINTENANCE.md` with a feature form that classifies and `triage.yml` that closes out-of-policy requests, Qodana (`qodana-js`) beside SonarCloud — 27 first-run findings, none a defect. PR #44: Firefox and Edge Add-ons — Firefox's roots by GUID and the Bookmarks Menu as a fourth root, separators recognised by type, each browser's move index, Firefox's address limit, a second (Firefox) package with its own manifest gate, three store jobs in their own environments (CWS API v2), `BUILD.md` (the sources archive rebuilt the package byte for byte) |
| **v1.3.0 released** | ✔ 2026-11-18 | PR #44, merged at the head that was reviewed (`42c78ec`; `main`'s tree identical). Signed tag on `80c7190`, GitHub Release with three packages and `SHA256SUMS.txt`, each `sha256sum -c`-verified after download — chrome `89c01451…fb921561` (107 946 bytes), firefox `45db6de9…8c09ef71` (108 100 bytes), sources `76799878…5fd6a4a4` (413 081 bytes). The Chrome manifest differs from 1.2.1's in `version` alone; the Firefox one adds `browser_specific_settings.gecko` and has no `minimum_chrome_version`. The store jobs and `announce` skipped (variables unset) |
| **v1.3.0 submitted** | ✔ 2026-11-18 | by the owner, to all three stores: the Chrome Web Store (in place of 1.2.1), the first Firefox Add-ons version and the first Edge Add-ons submission. Partner Center flagged the first Edge description for naming another browser — the Edge copy now names none (PR #47). ⚠️ The `11 §5` passes (`00 §10` items 20–22) have no recorded result |
| **v1.3.0 on Edge Add-ons** | ✔ live 2026-11-19 | approved on the first submission: listing `microsoftedge.microsoft.com/addons/detail/nchfchjnlihbifggooggpmmacighmdjg`, category Productivity, public, five languages. Policy 1.5.2 (a privacy policy that refers "primarily" to Edge, `08 §10`) did not block it. README install row and badge, and the About link's mapping for the next release, followed the same day (`00 §10` item 24) |
| **v1.3.0 on the Chrome Web Store / Firefox Add-ons** | ⚠️ in review | — |
**Verified on real browsers 2026-07-25:** Chrome and Brave, unpacked build.
Until that point every phase had been tested only against a hand-rolled
@@ -139,7 +149,7 @@ patch: it is a minor (`12 §4`).
| Automated CWS publishing | Flip `CWS_AUTOPUBLISH=true`; `wxt submit` in release workflow (`12 §3`). |
| ✔ Import Chrome's internal `Bookmarks` JSON file | **Shipped in v1.1.0** (`04 §2a`). |
| ✔ Import Firefox `.json` backup | **Shipped in v1.1.0** (`04 §2b`). The compressed automatic backups (`.jsonlz4`) are a separate item: a ~80-line pure-TS LZ4 block decoder, no dependency. |
| "Export all formats as .zip" | First runtime dep decision: `fflate` (gated, `01 §4`; About/THIRD_PARTY updates per `14 §5`). |
| "Export all formats as .zip" | First runtime dep decision: `fflate` (gated, `01 §4`; About/THIRD_PARTY updates per `14 §5`). **Not planned in maintenance mode** (2026-11-18): it would end "zero runtime dependencies" for a convenience. |
| Aggressive-dedupe toggle | Optional `www.`/`utm_*` stripping in normalize (off by default). |
| ✔ Sort folder A→Z action | **Shipped in v1.1.0** — a row action and a toolbar button, planned first and confirmed with a count (`03 §3`). |
@@ -153,14 +163,14 @@ patch: it is a minor (`12 §4`).
block decoder, no dependency. Also: capture a real Chrome HTML + `Bookmarks`
pair to sit beside the hand-built `chrome-156-*` fixtures, and the JA native
review.
3. **v1.3 — the aggressive-dedupe toggle** (deferred this round), a
3. **v1.4 — the aggressive-dedupe toggle** (deferred this round), a
session-scoped import undo, Biome linting of `.svelte` files, and true
virtualization of the edit tree if 500-row chunks prove too coarse. These
were the v1.2 plan until 2026-11-06, when real installs in Chinese and
Romanian made two languages the next minor instead (see below).
4. **v1.3+ — automated CWS publishing** once the owner creates the `CHROME_*`
secrets; Edge Add-ons and Firefox AMO listings through WXT's multi-target
build (each a separate go/no-go).
Romanian made two languages the next minor instead (see below), and the
v1.3 plan until 2026-11-18, when Firefox and Edge took that number.
4. **v1.3 — Firefox (AMO) and Edge Add-ons, and automated publishing to all
three stores** — **GO 2026-11-18** (decision log; the section below).
### Backlog carried from the v1.1.0 audit
@@ -244,13 +254,21 @@ the same dashboard evidence. Russian, Polish and Arabic also need plural forms
beyond `few`; the guard test in `dictionaries.test.ts` fails first if one is
attempted.
## v1.3 — resilience (was v1.2 until 2026-11-06)
## v1.3 — Firefox and Edge (GO 2026-11-18)
- **Scheduled local snapshots**: periodic JSON backup. ⚠️ Requires `alarms`
permission + a background service worker + `downloads` (or OPFS storage)
→ permission-story change ⇒ minor version, docs 08/09 update, privacy tab
re-review. Decide deliberately; OPFS-based silent snapshots may avoid
`downloads`.
The last "reach" item, taken out of the v2.0 table below on the owner's
decision the day maintenance mode began (decision log). The roadmap's own
wording was right: it is not "the same zip" for Firefox — the bookmark roots,
separators and the move index all differ — so it is a minor, built docs-first.
Edge takes the Chromium package unchanged. Scope and status live in the
decision log and `CLAUDE.md` Phase 10.
## v1.4 — resilience (was v1.3 until 2026-11-18, v1.2 until 2026-11-06)
- ~~**Scheduled local snapshots**~~ — **not planned in maintenance mode**
(2026-11-18). It needs the `alarms` permission and a background service
worker, and `/MAINTENANCE.md` puts anything that needs a new permission out
of scope, as `CLAUDE.md` hard rule 1 always did.
- Import "undo" (session-scoped): remember created ids → one-click revert.
- Virtualized tree rendering if >100k real-world demand appears.
@@ -258,11 +276,11 @@ attempted.
| Candidate | Consideration |
|---|---|
| Firefox Add-ons (AMO) release | WXT multi-target already builds it (`wxt -b firefox`); needs AMO listing, `browser_specific_settings.gecko.id`, separate signing flow. |
| Edge Add-ons store | Same zip usually passes; Partner Center account needed. |
| ~~Firefox Add-ons (AMO) release~~ | **GO 2026-11-18 → v1.3** (above). |
| ~~Edge Add-ons store~~ | **GO 2026-11-18 → v1.3** (above). |
| Dead-link checker | Needs `host_permissions: <all_urls>` → destroys the minimal-permission story. If ever done: **separate companion extension**, not this one. |
| Duplicate auto-merge assistant | Merge metadata (keep oldest addDate) + folder-aware suggestions. |
| Bookmarklet/notes fields | Only if a lossless place exists in Chrome's model (likely not — avoid schema lies). |
| Duplicate auto-merge assistant | Merge metadata (keep oldest addDate) + folder-aware suggestions. **Not planned in maintenance mode.** |
| Bookmarklet/notes fields | Only if a lossless place exists in Chrome's model (likely not — avoid schema lies). **Not planned in maintenance mode.** |
## Explicit "never" list (re-affirm before any pivot)
@@ -271,6 +289,9 @@ attempted.
- Analytics/telemetry of any kind.
- Ads, sponsored bookmarks, affiliate link rewriting.
- Collecting or transmitting bookmark content.
- Any permission beyond `bookmarks` and `storage` (`CLAUDE.md` hard rule 1),
which is what keeps the dead-link checker a separate extension and the
scheduled snapshots off the roadmap.
## Decision log
@@ -395,3 +416,11 @@ attempted.
| 2026-11-10 | **Alt+↑ / Alt+↓ reorders, and it is a patch.** It reuses `planDrop` and `moveTo`, so a keyboard move and a drag cannot disagree about what is legal, and there is no second write path to test. One place at a time, among the siblings on screen, like a drag. It ships in a patch because it closes a barrier to something the product already did rather than adding a capability; `12 §4` now says so. Rejected: "Move up / Move down" row buttons (two more on a row that already hides up to five), and a position field in "Move to…" (a new dialog flow for the same result) — though a click-only route is still owed (WCAG 2.5.7, backlog) | 05 §10, 12 §4 |
| 2026-11-10 | **Focus after a route change goes to `<main>`, not to the tree.** "Open in Edit" removes the button that was clicked. Focusing the tree when `#edit` mounts would also have fired on every first load, highlighting a row nobody chose and changing every screenshot; a route change with focus lost is the narrower condition and covers every tab | 06 §5 |
| 2026-11-10 | **Dependabot's bumps are not the whole bump.** #31 and #36 moved Biome twice and left `biome.json`'s `$schema` behind both times, and left `vitest`'s declared range a minor behind the coverage plugin's, which must match it (the lockfile had both at 5.1.0); `01 §2` drifted with them. The sync is a human step after each Dependabot merge, and WXT still gets the built-manifest diff — 0.21.5 produced a manifest byte-identical to the 1.2.0 release asset | 01 §2, §6 |
| 2026-11-18 | **Maintenance mode, as a written policy.** The project had been "in maintenance" since launch in the loose sense; the owner made it explicit: dependency updates on a schedule, high/critical advisories fixed as soon as a fix exists, major platform upgrades, bug/UI/UX/accessibility/translation fixes, and features only when on this roadmap or genuinely needed. **`/MAINTENANCE.md` is the policy and this file does not restate it** — the lesson of `12 §2`: a copy in two places drifts. The roadmap below stays valid; it is now the whole list of features that can still land | `MAINTENANCE.md` |
| 2026-11-18 | **Out-of-policy requests are closed by a workflow, not by hand.** The feature form asks one required question (on the roadmap / needed for a fix / something new); `scripts/triage.mjs` decides, as a pure and unit-tested function, and `triage.yml` acts with `gh` only — labelled `maintenance-mode` and closed *not planned*, or labelled `needs-triage`. `pull_request_target` checks out the base branch only and never interpolates a title or body into a shell line. Outside `feat…` pull requests are closed the same way; the owner, members, collaborators, bots and anything labelled `roadmap` are exempt. Rejected: removing the feature form (requests would arrive through the bug form, where nothing can detect them) and closing every request unread (the two in-policy answers deserve a human) | `12 §2.6`, `MAINTENANCE.md` |
| 2026-11-18 | **A high advisory with no fix is recorded, not worked around.** `npm audit` reports 14 high findings, all `picomatch` GHSA-fc5q-39xc-vjpf, every version affected, nothing to upgrade to. It is the toolchain's glob engine, matching patterns this repository writes, and never ships. The `deepmerge` row left: GitHub withdrew that advisory on 2026-11-16 | `09 §3.1` |
| 2026-11-18 | **A licence gate over the whole lockfile** (`scripts/check-licenses.mjs`): shipped packages must be permissive and GPL-3.0-compatible, tooling may also be MPL-2.0 and a few other non-copyleft licences; anything else fails until a person adds it on purpose. One shared `CREDITED_PACKAGES` list (`scripts/credited-packages.mjs`) now feeds the build gate, the notices test and this gate. `dependency-review-action` was considered and not used: PR-only, ClearlyDefined rather than the lockfile, runtime scope by default, not runnable locally. `legal/THIRD_PARTY_NOTICES.md` had called the tooling all MIT/Apache-2.0/ISC; corrected, **not a `LEGAL_VERSION` bump** — it describes tooling that never ships | `09 §3.2`, `14 §3.1` |
| 2026-11-18 | **Dependabot #39–#41 merged and synced by hand**, as the 2026-11-10 row requires: `biome.json`'s `$schema` to 2.6.6, `01 §2`, the scan action's pin in `12 §2.5`, and for the jsdom 31 major a new column in `11 §6` (2 484 ms median) beside the jsdom 29 figure | `01 §2`, `11 §6` |
| 2026-11-18 | **GO for Firefox (AMO) and Microsoft Edge Add-ons, as v1.3.** The owner's decision, recorded here before any code because the maintenance announcement names it. Settled with the owner: gecko id `bookmarkmagic@poli0981.dev` — permanent after the first AMO upload, an id and not a mailbox, shown nowhere in the UI; desktop only, because Firefox for Android has no `bookmarks` API; MV3 everywhere (WXT defaults Firefox to MV2); and Firefox separators shown, protected and warned about rather than written into any file format. An audit found why it is a minor and not a CI change: Firefox's roots are GUIDs with a fourth (Bookmarks Menu) root, so `getRoots`' position fallback maps the Menu to the toolbar; separators come back as `data:` bookmarks; and a same-folder `move` counts its index after removal | `00 §7`, `15 §v1.3` |
| 2026-11-18 | **Qodana beside SonarCloud**, at the owner's request (Ultimate licence, `QODANA_TOKEN`). Its own, never-required workflow, in two jobs: `scan` installs the dev dependencies — `qodana-js` needs them — with a read-only `GITHUB_TOKEN`; `publish` installs nothing and uploads the SARIF to code scanning, instead of the PR comments and annotations the vendor's snippet asks `contents: write` for. Sharing a runner with dependency code is a recorded exception to the Sonar rule, accepted because the token can only upload reports | `12 §2.7` |
| 2026-11-18 | **The roadmap pruned to what maintenance mode allows.** Scheduled snapshots need `alarms` and are off the roadmap; the permission rule joins the never list, where the feature form had already put it. The `fflate` zip export (a runtime dependency), the duplicate auto-merge assistant and bookmarklet notes are not planned. The old v1.3 "resilience" becomes v1.4 | `15` |
+5 -5
View File
@@ -1,6 +1,6 @@
# Disclaimer — BookmarkMagic
Terms version 1 · Effective 2026-07-26 · Last updated 2026-10-29
Terms version 1 · Effective 2026-07-26 · Last updated 2026-11-18
- Provided "AS IS", without warranty of any kind (see LICENSE §15–16).
- Bookmark operations modify your browser's bookmark data. The "Replace
@@ -10,14 +10,14 @@ Terms version 1 · Effective 2026-07-26 · Last updated 2026-10-29
Extension could read back. If the browser stops part-way, what was already
deleted can be restored by importing that backup. You remain responsible for
keeping backups of data you care about.
- Imported bookmarks are created with the current date and time. Chrome's
extension API does not allow an extension to set a bookmark's original
creation date, so original dates are preserved in your exported *files* but
- Imported bookmarks are created with the current date and time. The
browsers' extension APIs do not allow an extension to set a bookmark's
original creation date, so original dates are preserved in your exported *files* but
not when writing back into the browser.
- Import files come from outside this Extension; verify you trust their source.
Bookmarked URLs are stored as-is and are not vetted by the Extension.
- This project is not affiliated with or endorsed by Google, Chrome, Mozilla,
Firefox or any browser vendor. Browser names are trademarks of their
Firefox, Microsoft, Edge or any browser vendor. Browser names are trademarks of their
respective owners.
- The BookmarkMagic name and icon identify this project, published by skullmute
(poli0981). The GPL lets anyone fork the code; it does not let a fork present
+4 -3
View File
@@ -1,6 +1,6 @@
# End User License Agreement — BookmarkMagic
Terms version 1 · Effective 2026-07-26 · Last updated 2026-10-29
Terms version 1 · Effective 2026-07-26 · Last updated 2026-11-18
Copyright © 2026 skullmute ([poli0981](https://github.com/poli0981)).
@@ -17,8 +17,9 @@ Copyright © 2026 skullmute ([poli0981](https://github.com/poli0981)).
allow one, and your rights under the GPL do not depend on it.
4. **Your data.** The software processes bookmark data locally on your device
only, and sends nothing anywhere (see PRIVACY.md).
5. **Updates.** Updates are delivered via the Chrome Web Store and may change
functionality. Material legal changes trigger re-acceptance in-app.
5. **Updates.** Updates are delivered through the store you installed the
Extension from — the Chrome Web Store, Firefox Add-ons or Microsoft Edge
Add-ons — and may change functionality. Material legal changes trigger re-acceptance in-app.
6. **Contact.** Questions about these terms: **legal@poli0981.dev**. Formal
copyright infringement (DMCA) notices: **dmca@poli0981.dev**.
+15 -8
View File
@@ -1,6 +1,6 @@
# Privacy Policy — BookmarkMagic
Terms version 1 · Effective 2026-07-26 · Last updated 2026-10-29
Terms version 1 · Effective 2026-07-26 · Last updated 2026-11-18
BookmarkMagic ("the Extension") is designed to work entirely on your device.
@@ -16,9 +16,10 @@ contains no analytics, telemetry, or crash reporting.
device.
- **Local settings** (permission: `storage`): your language, theme,
preferences, and the date you accepted these terms are stored locally via
`chrome.storage.local`. They are not transmitted anywhere and are removed by
Chrome when you uninstall the Extension. The Extension does not use
`chrome.storage.sync`, so even your settings stay off any vendor cloud.
`chrome.storage.local` (Firefox calls the same store `browser.storage.local`).
They are not transmitted anywhere and are removed by the browser when you
uninstall the Extension. The Extension does not use `storage.sync`, so even
your settings stay off any vendor cloud.
The Extension requests no other permissions. It has no host permissions, no
content scripts, and no background service worker. It contains no code that
@@ -48,10 +49,12 @@ see THIRD_PARTY_NOTICES.md) contain no network code.
Two things happen outside the Extension and are worth knowing:
- **The Chrome Web Store** (Google) distributes the Extension and its updates.
Installing and updating it are governed by Google's own privacy policy, not
this one, and Google gives the developer only aggregate counts such as the
number of users.
- **The store you install it from** — the Chrome Web Store (Google), Firefox
Add-ons (Mozilla) or Microsoft Edge Add-ons (Microsoft) — distributes the
Extension and its updates. Installing and updating it are governed by that
store's own privacy policy, not this one, and each gives the developer only
aggregate counts such as the number of users. On Firefox the Extension
declares that it collects no data, in Firefox's own data-consent system.
- **Opening a bookmark.** When you open a bookmark from the Edit tab, your
browser loads that page exactly as when you click any link: the request is
the browser's, made on your instruction, to the site you chose. The
@@ -85,6 +88,10 @@ of practice: it describes handling of material you choose to send us, which was
never part of what the Extension itself collects — which remains nothing. No
re-acceptance was requested.*
*Clarified on 2026-11-18: the Extension is also distributed through Firefox
Add-ons and Microsoft Edge Add-ons. That adds no data flow — the Extension
still collects nothing — so no re-acceptance is requested (`docs/14 §3.1`).*
*Clarified on 2026-10-29: the diagnostics log, the Chrome Web Store, opening a
bookmark, and what the build compiles in are now described, and the contact
address changed. None of it changes what the Extension collects — still
+10 -6
View File
@@ -1,6 +1,6 @@
# Third-Party Notices — BookmarkMagic
Last updated: 2026-10-29
Last updated: 2026-11-18
**No runtime dependencies are installed** — `package.json` has an empty
`dependencies` list (`docs/01 §4`). A few small MIT-licensed pieces are,
@@ -14,14 +14,18 @@ notices travel with it in `THIRD_PARTY_NOTICES.txt` at the root of the package:
| [wxt](https://github.com/wxt-dev/wxt) + [@wxt-dev/browser](https://github.com/wxt-dev/wxt) | The one-line `browser` export: `globalThis.browser` when it exists, else `globalThis.chrome` | MIT |
The build enforces this list: `wxt.config.ts` fails the build when code from any
other npm package would ship (`CREDITED_PACKAGES`), and
`tests/unit/third-party.test.ts` checks that this file and the shipped `.txt`
name every package on it. None of these contains network code; the
other npm package would ship (`CREDITED_PACKAGES`, kept in
`scripts/credited-packages.mjs`), `tests/unit/third-party.test.ts` checks that
this file and the shipped `.txt` name every package on it, and
`npm run check:licenses` holds each of them to a permissive licence. None of these contains network code; the
extension's Content-Security-Policy forbids it anyway (`docs/08 §3`).
Build-time tooling (WXT's CLI, Vite, TypeScript, Biome, Knip, Vitest,
svelte-check) is not distributed with the extension and is not listed here.
All of it is MIT/Apache-2.0/ISC licensed and compatible with GPL-3.0-or-later.
svelte-check and what they depend on) is not distributed with the extension and
is not listed here. Its licences are checked on every build by
`npm run check:licenses`: permissive (MIT, Apache-2.0, ISC, BSD, 0BSD, MIT-0,
BlueOak, CC0) or, for one CSS tool under Vite (`lightningcss`), the
file-level copyleft MPL-2.0 — none of which reaches the extension.
Licensing questions: **copyright@poli0981.dev**.
+249 -388
View File
@@ -1,23 +1,23 @@
{
"name": "bookmarkmagic",
"version": "1.2.1",
"version": "1.3.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "bookmarkmagic",
"version": "1.2.1",
"version": "1.3.0",
"hasInstallScript": true,
"license": "GPL-3.0-or-later",
"devDependencies": {
"@biomejs/biome": "2.6.4",
"@biomejs/biome": "2.6.6",
"@sveltejs/vite-plugin-svelte": "^7.3.1",
"@types/node": "^26.6.6",
"@typescript/native": "npm:typescript@~7.0.2",
"@vitest/coverage-v8": "^5.1.0",
"@wxt-dev/module-svelte": "^2.0.5",
"jsdom": "^30.1.3",
"knip": "^6.44.1",
"jsdom": "^31.0.0",
"knip": "^6.45.1",
"svelte": "^5.57.3",
"svelte-check": "^4.7.8",
"typescript": "npm:@typescript/typescript6@~6.0.2",
@@ -93,39 +93,6 @@
"dev": true,
"license": "MIT"
},
"node_modules/@asamuzakjp/css-color": {
"version": "7.1.7",
"resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-7.1.7.tgz",
"integrity": "sha512-Q7ioeear07HwixdIitIn9KS1LZi97CEDFCSjPNm9v+y8KNbsu9q4Lrd4zUQW4faED+E7qxvfeVnbNRW46wFKuw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@csstools/css-calc": "^3.4.3",
"@csstools/css-color-parser": "^4.2.6",
"@csstools/css-parser-algorithms": "^4.0.2",
"@csstools/css-tokenizer": "^4.0.2",
"lru-cache": "^11.5.3"
},
"engines": {
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
}
},
"node_modules/@asamuzakjp/dom-selector": {
"version": "10.0.4",
"resolved": "https://registry.npmjs.org/@asamuzakjp/dom-selector/-/dom-selector-10.0.4.tgz",
"integrity": "sha512-A6f1nKy99I6tyoK82U6kBHvQQZmdHmTmPzJYPY/0eaOW0r8/qPmEOwjGHs+hL/vCgOwQTupu4LT1XtXNUuDruA==",
"dev": true,
"license": "MIT",
"dependencies": {
"bidi-js": "^1.1.0",
"css-tree": "^3.2.1",
"is-potential-custom-element-name": "^1.0.1",
"lru-cache": "^11.5.3"
},
"engines": {
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
}
},
"node_modules/@babel/helper-string-parser": {
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz",
@@ -187,9 +154,9 @@
}
},
"node_modules/@biomejs/biome": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.6.4.tgz",
"integrity": "sha512-8sKKwaNW4ot22awZ3lBjwWLHnUFXgXnrBPYS2gNlBAXRbDC++7kqjK2H7dR/FgCDtPvO1xfKpgEhJkGxAKYkxA==",
"version": "2.6.6",
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.6.6.tgz",
"integrity": "sha512-NCgVJRyrU1+hsW1ILNaRqNAb9fRL4n49bwyef+wjVJQ488/bXbp0BfnNqTTExkiNQT3ugkgYKR1vK8NxsjlNSQ==",
"dev": true,
"license": "MIT OR Apache-2.0",
"bin": {
@@ -203,22 +170,22 @@
"url": "https://opencollective.com/biome"
},
"optionalDependencies": {
"@biomejs/cli-android-arm64": "2.6.4",
"@biomejs/cli-android-x64": "2.6.4",
"@biomejs/cli-darwin-arm64": "2.6.4",
"@biomejs/cli-darwin-x64": "2.6.4",
"@biomejs/cli-linux-arm64": "2.6.4",
"@biomejs/cli-linux-arm64-musl": "2.6.4",
"@biomejs/cli-linux-x64": "2.6.4",
"@biomejs/cli-linux-x64-musl": "2.6.4",
"@biomejs/cli-win32-arm64": "2.6.4",
"@biomejs/cli-win32-x64": "2.6.4"
"@biomejs/cli-android-arm64": "2.6.6",
"@biomejs/cli-android-x64": "2.6.6",
"@biomejs/cli-darwin-arm64": "2.6.6",
"@biomejs/cli-darwin-x64": "2.6.6",
"@biomejs/cli-linux-arm64": "2.6.6",
"@biomejs/cli-linux-arm64-musl": "2.6.6",
"@biomejs/cli-linux-x64": "2.6.6",
"@biomejs/cli-linux-x64-musl": "2.6.6",
"@biomejs/cli-win32-arm64": "2.6.6",
"@biomejs/cli-win32-x64": "2.6.6"
}
},
"node_modules/@biomejs/cli-android-arm64": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-android-arm64/-/cli-android-arm64-2.6.4.tgz",
"integrity": "sha512-jwrwigP4tBcHxzuV8izioX/BOUhJL/4e2rNSOE5nCjBkVC018LQAQUGiH+CNkFYvLtQ1dcZo5/xXERmaAGc7JQ==",
"version": "2.6.6",
"resolved": "https://registry.npmjs.org/@biomejs/cli-android-arm64/-/cli-android-arm64-2.6.6.tgz",
"integrity": "sha512-bicnqNNxEX7pjkDQaptYvPRIWDfgXJLl/Ok7iZjC+F1AhfReor3FSS7SgPYnOvUy/jf++5U/KYN4T8OKH5rrNA==",
"cpu": [
"arm64"
],
@@ -233,9 +200,9 @@
}
},
"node_modules/@biomejs/cli-android-x64": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-android-x64/-/cli-android-x64-2.6.4.tgz",
"integrity": "sha512-HdGInPJ4nZFwHxzvEtcp2nmSBtUyJrurmtIK43upFckuS3+ZqVM05HtsxQWnqGsuy/pxckIAjyKWlEKRlBXUyA==",
"version": "2.6.6",
"resolved": "https://registry.npmjs.org/@biomejs/cli-android-x64/-/cli-android-x64-2.6.6.tgz",
"integrity": "sha512-N443kDSElF4kDMKjarsL+ymj/ewLA5R9VAdawA7fJ7pwgN3JVDZp0K+xhKBglH8EwsKi2+K8xC6WxXSkgziFfw==",
"cpu": [
"x64"
],
@@ -250,9 +217,9 @@
}
},
"node_modules/@biomejs/cli-darwin-arm64": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.6.4.tgz",
"integrity": "sha512-0VvcUz46wbg59Q4TZ59KkIjDJrxEyu4Eoe79+F4SChxoWe+W7AEyIp6F5r72C9+p6MsB6dIovnZt1D30lGM3XA==",
"version": "2.6.6",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.6.6.tgz",
"integrity": "sha512-/vSAqWx3by3p8w5ew+HVJDgguuaTK3U6Fb5gk/oDUH21iWOopm3gOlhT6tZfy5mTaM5R4CVc3uFWkxBtEDrKyw==",
"cpu": [
"arm64"
],
@@ -267,9 +234,9 @@
}
},
"node_modules/@biomejs/cli-darwin-x64": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.6.4.tgz",
"integrity": "sha512-fxmvkF81srlS3DiMyfm+aG3J0eG+6/BjaxRyjy57KbLSafnq0PO+hHfVWmtH2ty0S7nm6yDXBRwySfFeaRJKRQ==",
"version": "2.6.6",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.6.6.tgz",
"integrity": "sha512-lLdOAJKbrAoDs+3GvTyVmMW345D9IhrIE3GgoL2eeHwO1boN4VhrSlALtFYsP0p+Jy4udUp4bTguij0qjKrH8w==",
"cpu": [
"x64"
],
@@ -284,9 +251,9 @@
}
},
"node_modules/@biomejs/cli-linux-arm64": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.6.4.tgz",
"integrity": "sha512-6+bK1Y/evmIUiJr7auertuMbiaYVicJhqA1bZyL47lCMWugv8l0gFQCqvR/gN1vZMHYm+HwoTKgeMxdNFCoQTg==",
"version": "2.6.6",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.6.6.tgz",
"integrity": "sha512-UzJdUCg9dbEGpZOuZRyehEPrnwKjx9z4Um7sWLG5x6txu7UjeWdJZuBXVGlyAdD39w2Hx0nZeK1jKC4NFUTCNQ==",
"cpu": [
"arm64"
],
@@ -304,9 +271,9 @@
}
},
"node_modules/@biomejs/cli-linux-arm64-musl": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.6.4.tgz",
"integrity": "sha512-31ZaH/MHqPX+O+evRwRrCHQ8W5/9adY+/eMytGGWZnRx1T41QsWIF09+/WujynLBhWZUxNGS5CtsWLwgOFTAyg==",
"version": "2.6.6",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.6.6.tgz",
"integrity": "sha512-rw2Vsoi/WZGDyRjMXx9KZH9zsHe79LIzkdWHkLqsIkeKZm6qiGxtiIApxn7cmJSoEPaSvHaH5pRj1FhTcyL/XA==",
"cpu": [
"arm64"
],
@@ -324,9 +291,9 @@
}
},
"node_modules/@biomejs/cli-linux-x64": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.6.4.tgz",
"integrity": "sha512-tbFZMdL6dP/ws4edXxYG9WhvaVa1ZDzL4G5DzahnWW7Psib9H+VTdyU4XXVxpJk5j/nYZroSbvSNyYlpW3yCIw==",
"version": "2.6.6",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.6.6.tgz",
"integrity": "sha512-l8/aPXc1cz8VpUyd4hb5Pm5zx+X3voQBks4aLYbp5pC8KSchuHyvqDfY5xax39qCHomI/2xn6NKEot+zebG38g==",
"cpu": [
"x64"
],
@@ -344,9 +311,9 @@
}
},
"node_modules/@biomejs/cli-linux-x64-musl": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.6.4.tgz",
"integrity": "sha512-bomSa2XdQAGGj6Cwdm4M13qE+lN9+AOlW8KtI4hdyVyRRF/Z71qPAi95T4wtdZK0QpBbkTW8hgbZZCwPi4xzIw==",
"version": "2.6.6",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.6.6.tgz",
"integrity": "sha512-DiKejs+GnFbOVQsBnukUpiB+T13tqUDFGwwjsTq51vatAsaflzFzVD0BOgjVUGRrqKgE0K0Xf+wNtkcmdN2chw==",
"cpu": [
"x64"
],
@@ -364,9 +331,9 @@
}
},
"node_modules/@biomejs/cli-win32-arm64": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.6.4.tgz",
"integrity": "sha512-eCsqt8Ma3eVap+oyJCDnJZH60SIU464B66n3y38EUTJdM1T/HfZol1FJC9vb+sHToX0ix8XzqPcwJnOzyAJz0g==",
"version": "2.6.6",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.6.6.tgz",
"integrity": "sha512-DjVXwQAQeHrO1JEZAEus54k40Tnh4glyU3VFLcDBKwoz0xnxCEnqw6TCMXoujcQMQynWd3AY8bLrbR1o0XNqow==",
"cpu": [
"arm64"
],
@@ -381,9 +348,9 @@
}
},
"node_modules/@biomejs/cli-win32-x64": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.6.4.tgz",
"integrity": "sha512-pYsMy5AThiHFOZAsngg8qN4PurM6nInKBhVX7sbj3eNpRQqo1Hb0MgCwPL7VqVMrmcEEMj9Ks3qbkallR65e8g==",
"version": "2.6.6",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.6.6.tgz",
"integrity": "sha512-B7KMG26A4I9lAuxwBGMmiVcjMGAeJRoz+pzFt9brRvOAsIrgOu8ptJld5rUWui6tM1uiJwxeJhhDPuAiZtxXdw==",
"cpu": [
"x64"
],
@@ -397,159 +364,6 @@
"node": ">=14.21.3"
}
},
"node_modules/@bramus/specificity": {
"version": "2.4.3",
"resolved": "https://registry.npmjs.org/@bramus/specificity/-/specificity-2.4.3.tgz",
"integrity": "sha512-0GEz8qJWokkUVYQYRukmkSHIFNoBH8QTreeHrAFbvz1XFYc3Y+puhMs8PQ5x8GNugiC2l5jvDBXKLbBIByeSBw==",
"dev": true,
"license": "MIT",
"dependencies": {
"css-tree": "^3.2.1"
},
"bin": {
"specificity": "bin/cli.js"
}
},
"node_modules/@csstools/color-helpers": {
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-6.1.2.tgz",
"integrity": "sha512-grhRy3OKmniaAEKXMjua5z/EODX0MSqBGjunw8+j/3HQjOnahs2AGhvEOIYVUWcU6ScApbhLhVrQTX8XqrMrow==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/csstools"
},
{
"type": "opencollective",
"url": "https://opencollective.com/csstools"
}
],
"license": "MIT-0",
"engines": {
"node": ">=20.19.0"
}
},
"node_modules/@csstools/css-calc": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-3.4.3.tgz",
"integrity": "sha512-iex20d8CHVkyvg6B7UKV7uHnI2Bqo9g+EFfT9E0y+GvTvhZ/DwONJ+9aKb1dlqm0ZiGsL5RXjp0fCoJYnkeDjA==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/csstools"
},
{
"type": "opencollective",
"url": "https://opencollective.com/csstools"
}
],
"license": "MIT",
"engines": {
"node": ">=20.19.0"
},
"peerDependencies": {
"@csstools/css-parser-algorithms": "^4.0.2",
"@csstools/css-tokenizer": "^4.0.2"
}
},
"node_modules/@csstools/css-color-parser": {
"version": "4.2.6",
"resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-4.2.6.tgz",
"integrity": "sha512-iiPQ3iRWwnJkeEn6RIu6SJPr7hYrLz6XZ9s/QZl+2/LI5KQVjpl2fdmDSZKuD4xP6GMmMPgHFFXg6k1Wkz0Trg==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/csstools"
},
{
"type": "opencollective",
"url": "https://opencollective.com/csstools"
}
],
"license": "MIT",
"dependencies": {
"@csstools/color-helpers": "^6.1.2",
"@csstools/css-calc": "^3.4.3"
},
"engines": {
"node": ">=20.19.0"
},
"peerDependencies": {
"@csstools/css-parser-algorithms": "^4.0.2",
"@csstools/css-tokenizer": "^4.0.2"
}
},
"node_modules/@csstools/css-parser-algorithms": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-4.0.2.tgz",
"integrity": "sha512-40cSKyMvK+tq4qz6Awrlye2WGuOKt3FwPgtGg6KTfbHOWNw+Rk1rzbAtZnZ6IBhsY491HLRnDXwoyBAijmmILA==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/csstools"
},
{
"type": "opencollective",
"url": "https://opencollective.com/csstools"
}
],
"license": "MIT",
"engines": {
"node": ">=20.19.0"
},
"peerDependencies": {
"@csstools/css-tokenizer": "^4.0.2"
}
},
"node_modules/@csstools/css-syntax-patches-for-csstree": {
"version": "1.1.15",
"resolved": "https://registry.npmjs.org/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.1.15.tgz",
"integrity": "sha512-J0u7HkVl2nzSlhsiTOp4AmwcUQ3D+mGEEKfBy/7To5/y7F2OHwyLrXfrhR0SMgr4p5Lo+eaMVSeai24zUcBIxA==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/csstools"
},
{
"type": "opencollective",
"url": "https://opencollective.com/csstools"
}
],
"license": "MIT-0",
"peerDependencies": {
"css-tree": "^3.2.1"
},
"peerDependenciesMeta": {
"css-tree": {
"optional": true
}
}
},
"node_modules/@csstools/css-tokenizer": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-4.0.2.tgz",
"integrity": "sha512-OoKoR0f76dCY666JlcbhmVTs2drYj1GUXZTYTcbUgJjh9Nv41aFfZ21bPQTERm5+L5cBDo466NltB2lplS5GBw==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/csstools"
},
{
"type": "opencollective",
"url": "https://opencollective.com/csstools"
}
],
"license": "MIT",
"engines": {
"node": ">=20.19.0"
}
},
"node_modules/@emnapi/core": {
"version": "1.11.2",
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.2.tgz",
@@ -675,9 +489,9 @@
}
},
"node_modules/@oxc-parser/binding-android-arm-eabi": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.155.0.tgz",
"integrity": "sha512-A6xv7hDtnTm+xlZ7utn6rRQpRMJHRhVr3gjRGqlx0RUX84mNk0pAsy6YN/wWhuOTkaZhRrrzaLxf0NfbH77j2w==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.156.0.tgz",
"integrity": "sha512-RMq7DKNzEp1T51QKNLTn0NryNEt2IYfh7mZBlIdi2Ju52ltOEDMeIXv0XBpA6dL7j7ChjlcovtGcc1Jv4qMipg==",
"cpu": [
"arm"
],
@@ -692,9 +506,9 @@
}
},
"node_modules/@oxc-parser/binding-android-arm64": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.155.0.tgz",
"integrity": "sha512-T1wWwH9/JI5g7Z4kEQwDOwhToxdDhRyOTklH+uuNpJ16m3MZFmGl+l2rKc0NHQdbVRG2LTOBsNjpW3h1BWytPA==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.156.0.tgz",
"integrity": "sha512-mwkWKhOBpmh8fWc3m4MiLsmEAtx0YuHmvyo9ff557cnb3QZ2kt2eauSz75wCGIpiZG3gUsJ4WwzEjm4R4/BHig==",
"cpu": [
"arm64"
],
@@ -709,9 +523,9 @@
}
},
"node_modules/@oxc-parser/binding-darwin-arm64": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.155.0.tgz",
"integrity": "sha512-ZoRB3qJxJ8DWA41jHja+YeB0lLfjBy4T+Kr15vnN1k65X3zbJt3rPZftEwN4Ju4tmA4K/T9dWWD7Z8ewQLnrVA==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.156.0.tgz",
"integrity": "sha512-6pGR5fUszM9M4eBBapqpGjCRJolFwuCldx8bRQjqXyM09cQysBTWVF2Ttg4UNJVxYSaw5RRINbveCOOCrsuGvA==",
"cpu": [
"arm64"
],
@@ -726,9 +540,9 @@
}
},
"node_modules/@oxc-parser/binding-darwin-x64": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.155.0.tgz",
"integrity": "sha512-vxtL86BtM+IgrpejA86nbTk5j0HKTIMeuaJ1fQciw6p9RfavPtIPjI7gN34owap0yG9txXBaAWpGdxokNwdqIw==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.156.0.tgz",
"integrity": "sha512-M9QghL7uCAqMKjYJv1rDGblfEvkeQu3QzTPd7Uwo16gG3uO7m9ikVQ9OL8FZTnKzU4vbCEby6kTlEkqN+JeEMA==",
"cpu": [
"x64"
],
@@ -743,9 +557,9 @@
}
},
"node_modules/@oxc-parser/binding-freebsd-x64": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.155.0.tgz",
"integrity": "sha512-tN6Ru5e0UVnWaIuiH8jEwnvxuxg7FvhWwSd3oe5oDhOD4ObsSr9/N6WfHLjilUWlPPj65ptwrSDH0Y7lzwTzmw==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.156.0.tgz",
"integrity": "sha512-lX0ANxSwAOrpOT7NHB+YsrBqDJ8sOVon5m7GS9eQtkuUeNzQMMGpFsJLsStawTbrdwOF5KDVxgPWcKmt/DIZUQ==",
"cpu": [
"x64"
],
@@ -760,9 +574,9 @@
}
},
"node_modules/@oxc-parser/binding-linux-arm-gnueabihf": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.155.0.tgz",
"integrity": "sha512-h4ozA5n6L6lwolsz9iwunEhKWnIVbmFRots5QxEix0H6nJ5ICpuDa7PuShuhfpIDFe3+Qvyscioyiv+9g+4Syg==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.156.0.tgz",
"integrity": "sha512-iPgYpasRcqk7X3TGncQg7B+6RotDvG8weug0UrgF+FXLf4KmaNDyT91BKONlqbHcNgK9Nryp7AEZGuQn32fP6g==",
"cpu": [
"arm"
],
@@ -777,9 +591,9 @@
}
},
"node_modules/@oxc-parser/binding-linux-arm-musleabihf": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.155.0.tgz",
"integrity": "sha512-058/+LardpfuUlsKIvBGk/CYoakEVcMgqYx8GgyUZeOxFWTojYLlCc1Gb60/y21v3esDhHidgiY/Zbq9LpBhaQ==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.156.0.tgz",
"integrity": "sha512-sJqJDEZevtkEfoxrXfaRTkSt6Itckr549cIfBbs11UgXv8bFyqQsXTQa6iKm8mTiWYmCDDFJf7TLnqxcbqzPOw==",
"cpu": [
"arm"
],
@@ -794,9 +608,9 @@
}
},
"node_modules/@oxc-parser/binding-linux-arm64-gnu": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.155.0.tgz",
"integrity": "sha512-nrOt2Y3xIAzu+lSPzH0864ieO+iCCXgoo9qFlGANE8Xh0cQ+RP8Wstfp+/wXN2YCyb98cAGzX0VruKYw7it/jw==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.156.0.tgz",
"integrity": "sha512-mrQs5OdRiqKskRuWEORPKT6YGIFhrpVvCvL9hqVaIh60EzgR4qjPvSsV6hWZcOfyWHBTbdEvfnDJPh/eQlxPRQ==",
"cpu": [
"arm64"
],
@@ -814,9 +628,9 @@
}
},
"node_modules/@oxc-parser/binding-linux-arm64-musl": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.155.0.tgz",
"integrity": "sha512-KYAayyN5hQbJPtGKtRxlyc8XYmyntOplyXSQzTDrmbz7l/GCrzQbSswvyJFBTH1LGtsZrbXOAfN52i/Kz6kLKg==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.156.0.tgz",
"integrity": "sha512-ZtPqgCU3+wpU7dvX7YbaEiw71r0UdguzuPhcx4PIEZSs4XFqc6F5wXCtNdb6M7m3DMErlxrwosryoXrzYOY/Gg==",
"cpu": [
"arm64"
],
@@ -834,9 +648,9 @@
}
},
"node_modules/@oxc-parser/binding-linux-ppc64-gnu": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.155.0.tgz",
"integrity": "sha512-CSuSY5hfjtsBnHXydOj8jiNfS1qHbdPZuPz1YL1cSgK7VmNYP+QlZIbG0BBYYBgX/vYEgZwbG9mBdW4YairZ5w==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.156.0.tgz",
"integrity": "sha512-ZuGRT/adReZZJn3PYNneb1HQIOH0iIZ2fzFgC1/XJYpMQ5KsRKmWIEzy3wEFsUwIOTomCmnmTZ/zbFYo9z9VeA==",
"cpu": [
"ppc64"
],
@@ -854,9 +668,9 @@
}
},
"node_modules/@oxc-parser/binding-linux-riscv64-gnu": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.155.0.tgz",
"integrity": "sha512-7KCfOQm+Nz2N8trAXbQkal4TQ5756WVEmhm35y816YHvyFnEfVsICsiV5k0pEszNf/fRm4cm2i6i18SJ6/iCWg==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.156.0.tgz",
"integrity": "sha512-T+iWCeAOoEAJpHqr6/pogHIv98g9p8Ctccysm/h962hG4ayX5OL2c0Ih4oYe+JuFndLXy/OASvwMlTPe76sIiw==",
"cpu": [
"riscv64"
],
@@ -874,9 +688,9 @@
}
},
"node_modules/@oxc-parser/binding-linux-riscv64-musl": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.155.0.tgz",
"integrity": "sha512-JSlhgoK+/g1TGJI5NuADx2+6syhxnQNLCWLXyO5QLFyetomcr/vIxSdiNlmyAv963YXUzCuwAwRG6npZ5xyJ1A==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.156.0.tgz",
"integrity": "sha512-wL55bI2kVKfwdxScbw60zVgzAqbQbmE5zpSPWPZoZ9RSG8egm6ITE/UWE5mDWlglxz1QElJCcUbpaJCtHD11BQ==",
"cpu": [
"riscv64"
],
@@ -894,9 +708,9 @@
}
},
"node_modules/@oxc-parser/binding-linux-s390x-gnu": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.155.0.tgz",
"integrity": "sha512-WFIX+dPokWp64mi434Md3U3lJaTwNxAphvGjpltoyQjGUsdXavOIRrnp9dOS34Hd75HOAwDxAI+YwWOwqmJbtg==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.156.0.tgz",
"integrity": "sha512-+D+JilhLqwrDLODYEl4qtovVwgxKALb23FkAWBiPvgmUWYgjCV83KKuwwxZJM8GCdKlNA1vt3iKtow8HUFjXtg==",
"cpu": [
"s390x"
],
@@ -914,9 +728,9 @@
}
},
"node_modules/@oxc-parser/binding-linux-x64-gnu": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.155.0.tgz",
"integrity": "sha512-g6xSDC/JpbnVOz5uafMGyK3txBVRFMQTx8opv/yHXGxqV3ZMVl3bf7W8XrSnF68dmy3gM4dgReNryuE53+WkeQ==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.156.0.tgz",
"integrity": "sha512-jRfwpN4xKrsEpC+SgrUPY5k0mINYZn7aLrt22I3uQFoumiSgHgsLYgS9f84ntbkvSydH4HiwGuDa2b1XCHaJzw==",
"cpu": [
"x64"
],
@@ -934,9 +748,9 @@
}
},
"node_modules/@oxc-parser/binding-linux-x64-musl": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.155.0.tgz",
"integrity": "sha512-6/4xlxKlZJWrQ0uwDFPc0H9+xLu7068CKhX3vIDW3SbvP/lVgnVuT5v6dyugeWskWpuxqF/WJ4WKwhxjU3pG2w==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.156.0.tgz",
"integrity": "sha512-P/ajnypgLmxmuRRyCIZcp2o4lOwmCaXYH5+eqDTcCW+MCTI+csKSw/Zc6GB67jZoVa4ey3q1jXEt7S60adBEMQ==",
"cpu": [
"x64"
],
@@ -954,9 +768,9 @@
}
},
"node_modules/@oxc-parser/binding-openharmony-arm64": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-openharmony-arm64/-/binding-openharmony-arm64-0.155.0.tgz",
"integrity": "sha512-tltklL0J0XjDxIRTBXWOBhvc2mitcmES45pIxhwDWfxRyqz7Vkeu0NekTZEIxGE4f/lXgq3vZcjjffteQOVorg==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-openharmony-arm64/-/binding-openharmony-arm64-0.156.0.tgz",
"integrity": "sha512-WSN6rQZZc9KqgZ4lMfjVDvqKhVOCjey/YEZIPisGXmwBqwgWOzru207dyiH50LHcf1n9LO2oceGk/id6RL9v0g==",
"cpu": [
"arm64"
],
@@ -971,9 +785,9 @@
}
},
"node_modules/@oxc-parser/binding-win32-arm64-msvc": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.155.0.tgz",
"integrity": "sha512-alAb9TzjatUEsOeoncAziUnfdTDxfyswhalFZ9sC6plUgATIUx2NIZ0+bMn6aJ28AduS1OpG/OAisr/YISn4Ig==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.156.0.tgz",
"integrity": "sha512-l21Tz6tjraGBC3JefVeJZ9pojD0fCiB62PydAv+i9nrqJX7z/pDmyDNYLamDr/PRcQ4UQbFwkSnz7NKBB9UMLw==",
"cpu": [
"arm64"
],
@@ -988,9 +802,9 @@
}
},
"node_modules/@oxc-parser/binding-win32-ia32-msvc": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.155.0.tgz",
"integrity": "sha512-yc5cbSfcGmRv/KpxDFuyk8adEBaWd/9HilWvBbQ4bFbus1V2PUh2mGB2Cfq9rqZTqLeiMT8x0skV+LKp9hOMgQ==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.156.0.tgz",
"integrity": "sha512-CUq0ZFl/RODqPiIgfNNSamkpTj5x8AjBTkR/y1DNVIQiTGnmWqjHcn3o08ZW3q/LgkI4g9G9g6UirmmQFvuOZw==",
"cpu": [
"ia32"
],
@@ -1005,9 +819,9 @@
}
},
"node_modules/@oxc-parser/binding-win32-x64-msvc": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.155.0.tgz",
"integrity": "sha512-8heq6jGq+rfpTDRDjoQiBHw0maQZf3IXkS99pdHQZPoTL5kyF5qyPS0RidUlSdnWDIqxXb5nux7GBD9cT+imUw==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.156.0.tgz",
"integrity": "sha512-dcpx5Y1x2v/cs7U/q3SZMvmxfyXjVvqC86jMuw2ZZUbHDd7W2cW7uSMQfg3GLVaE68Su3H9xd/Pc4v6QNyeSRg==",
"cpu": [
"x64"
],
@@ -1027,6 +841,7 @@
"integrity": "sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==",
"dev": true,
"license": "MIT",
"peer": true,
"funding": {
"url": "https://github.com/sponsors/oxc-project"
}
@@ -2397,14 +2212,31 @@
"node": ">= 0.4"
}
},
"node_modules/bidi-js": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.1.0.tgz",
"integrity": "sha512-fX1Onk0tdVPC7obPWB5EbJ1z7NVhLq4m2xZLq2YXBkxzMXIGRpNMU88n0EPgWseKl12J7zXs7qrDxPK4sRs2fg==",
"node_modules/bcp-47": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/bcp-47/-/bcp-47-2.1.2.tgz",
"integrity": "sha512-wsv86UuNFuPnVieKLyECTT+CP1WSAHeoIg5P3xu2kA9Z+7fVPoKt7dxzSeEhtJel0AI+NW3fIW3KtTKQKUCngg==",
"dev": true,
"license": "MIT",
"dependencies": {
"require-from-string": "^2.0.2"
"is-alphabetical": "^2.0.0",
"is-alphanumerical": "^2.0.0",
"is-decimal": "^2.0.0"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/bcp-47-match": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/bcp-47-match/-/bcp-47-match-2.0.3.tgz",
"integrity": "sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ==",
"dev": true,
"license": "MIT",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/boolbase": {
@@ -2606,20 +2438,6 @@
"url": "https://github.com/sponsors/fb55"
}
},
"node_modules/css-tree": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.2.1.tgz",
"integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==",
"dev": true,
"license": "MIT",
"dependencies": {
"mdn-data": "2.27.1",
"source-map-js": "^1.2.1"
},
"engines": {
"node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
}
},
"node_modules/css-what": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/css-what/-/css-what-8.0.0.tgz",
@@ -3129,6 +2947,43 @@
"url": "https://github.com/fb55/entities?sponsor=1"
}
},
"node_modules/is-alphabetical": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz",
"integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==",
"dev": true,
"license": "MIT",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/is-alphanumerical": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz",
"integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==",
"dev": true,
"license": "MIT",
"dependencies": {
"is-alphabetical": "^2.0.0",
"is-decimal": "^2.0.0"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/is-decimal": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz",
"integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==",
"dev": true,
"license": "MIT",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/is-docker": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
@@ -3203,41 +3058,39 @@
"license": "MIT"
},
"node_modules/jsdom": {
"version": "30.1.3",
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-30.1.3.tgz",
"integrity": "sha512-hQMUPvRgN7KxsfIytDQji7bimuJeRQa6Qo5+iuiZQk5CafeRxLIA10/cG5YCBFNpD9RO3oqIiN4CO1Y44kxqXg==",
"version": "31.0.0",
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-31.0.0.tgz",
"integrity": "sha512-xAkhD9z1eyFC5+QUi9K24CaZJgdCQ2GOGLW1GdVDoQvkp/AxEH9TQ0pAplPOlIiV92hfcgnFOADZypbjgbBT6Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"@asamuzakjp/css-color": "^7.1.3",
"@asamuzakjp/dom-selector": "^10.0.3",
"@bramus/specificity": "^2.4.2",
"@csstools/css-syntax-patches-for-csstree": "^1.1.15",
"@exodus/bytes": "^1.16.0",
"css-tree": "^3.2.1",
"bcp-47": "^2.1.2",
"bcp-47-match": "^2.0.3",
"data-urls": "^8.0.0",
"decimal.js": "^10.6.0",
"html-encoding-sniffer": "^7.0.0",
"is-potential-custom-element-name": "^1.0.1",
"lru-cache": "^11.5.3",
"parse5": "^8.0.1",
"parse5": "^8.1.0",
"parse5-parser-stream": "^8.1.0",
"saxes": "^6.0.0",
"tough-cookie": "^6.0.2",
"undici": "^8.12.1",
"undici": "^8.12.3",
"w3c-xmlserializer": "^6.0.0",
"webidl-conversions": "^8.0.1",
"whatwg-mimetype": "^5.0.0",
"whatwg-url": "^17.2.0",
"whatwg-url": "^17.3.0",
"xml-name-validator": "^5.0.0"
},
"engines": {
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
},
"peerDependencies": {
"canvas": "^3.2.3"
"@napi-rs/canvas": "^1.0.13"
},
"peerDependenciesMeta": {
"canvas": {
"@napi-rs/canvas": {
"optional": true
}
}
@@ -3256,9 +3109,9 @@
}
},
"node_modules/knip": {
"version": "6.44.1",
"resolved": "https://registry.npmjs.org/knip/-/knip-6.44.1.tgz",
"integrity": "sha512-Hbd8nvkIsNgFfXgC7Jsb5LHv7jj6VwA3tmfHd53XPX2z9Vc9RnAZqV0BIiP4OrtYqKwCoLseFHQZerb1bNlbSw==",
"version": "6.45.1",
"resolved": "https://registry.npmjs.org/knip/-/knip-6.45.1.tgz",
"integrity": "sha512-zp3zXKy2cZWiIttdlWU5fisKxVQaLSU6471ej0KGz1GdHdaHxpzTAO/LIyFNc3gU3v1W7LJaqvYumoO3l/u+6A==",
"dev": true,
"funding": [
{
@@ -3275,15 +3128,14 @@
"formatly": "^0.11.4",
"get-tsconfig": "4.14.3",
"jiti": "^2.7.0",
"oxc-parser": "^0.155.0",
"oxc-parser": "^0.156.0",
"oxc-resolver": "11.24.2",
"picomatch": "^4.0.7",
"smol-toml": "^1.9.0",
"smol-toml": "^1.9.1",
"strip-json-comments": "5.0.3",
"tinyglobby": "^0.2.17",
"unbash": "^6.0.1",
"yaml": "^2.9.1",
"zod": "^4.6.5"
"unbash": "^6.0.4",
"yaml": "^2.9.1"
},
"bin": {
"knip": "bin/knip.js",
@@ -3680,13 +3532,6 @@
"url": "https://github.com/sponsors/fregante"
}
},
"node_modules/mdn-data": {
"version": "2.27.1",
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.27.1.tgz",
"integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==",
"dev": true,
"license": "CC0-1.0"
},
"node_modules/mlly": {
"version": "1.8.2",
"resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.2.tgz",
@@ -3824,13 +3669,13 @@
}
},
"node_modules/oxc-parser": {
"version": "0.155.0",
"resolved": "https://registry.npmjs.org/oxc-parser/-/oxc-parser-0.155.0.tgz",
"integrity": "sha512-C/ReSf1JUFukK/zvk6jhcNibSssvas5+ktIzK7fbKVd3CedWe59C3QwHEOrEZj/4Rt9+xg0Jeis/Jv1F/KM1mw==",
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/oxc-parser/-/oxc-parser-0.156.0.tgz",
"integrity": "sha512-7JhjgOfZjrIFJH5TlHrpRua864Si5GvwrPr5+eIRCY2sszhKXo6pyhP0HQKOGTtfO4UowwZ72XTGba0+lZphOQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@oxc-project/types": "^0.155.0"
"@oxc-project/types": "^0.156.0"
},
"engines": {
"node": "^20.19.0 || >=22.12.0"
@@ -3839,25 +3684,35 @@
"url": "https://github.com/sponsors/oxc-project"
},
"optionalDependencies": {
"@oxc-parser/binding-android-arm-eabi": "0.155.0",
"@oxc-parser/binding-android-arm64": "0.155.0",
"@oxc-parser/binding-darwin-arm64": "0.155.0",
"@oxc-parser/binding-darwin-x64": "0.155.0",
"@oxc-parser/binding-freebsd-x64": "0.155.0",
"@oxc-parser/binding-linux-arm-gnueabihf": "0.155.0",
"@oxc-parser/binding-linux-arm-musleabihf": "0.155.0",
"@oxc-parser/binding-linux-arm64-gnu": "0.155.0",
"@oxc-parser/binding-linux-arm64-musl": "0.155.0",
"@oxc-parser/binding-linux-ppc64-gnu": "0.155.0",
"@oxc-parser/binding-linux-riscv64-gnu": "0.155.0",
"@oxc-parser/binding-linux-riscv64-musl": "0.155.0",
"@oxc-parser/binding-linux-s390x-gnu": "0.155.0",
"@oxc-parser/binding-linux-x64-gnu": "0.155.0",
"@oxc-parser/binding-linux-x64-musl": "0.155.0",
"@oxc-parser/binding-openharmony-arm64": "0.155.0",
"@oxc-parser/binding-win32-arm64-msvc": "0.155.0",
"@oxc-parser/binding-win32-ia32-msvc": "0.155.0",
"@oxc-parser/binding-win32-x64-msvc": "0.155.0"
"@oxc-parser/binding-android-arm-eabi": "0.156.0",
"@oxc-parser/binding-android-arm64": "0.156.0",
"@oxc-parser/binding-darwin-arm64": "0.156.0",
"@oxc-parser/binding-darwin-x64": "0.156.0",
"@oxc-parser/binding-freebsd-x64": "0.156.0",
"@oxc-parser/binding-linux-arm-gnueabihf": "0.156.0",
"@oxc-parser/binding-linux-arm-musleabihf": "0.156.0",
"@oxc-parser/binding-linux-arm64-gnu": "0.156.0",
"@oxc-parser/binding-linux-arm64-musl": "0.156.0",
"@oxc-parser/binding-linux-ppc64-gnu": "0.156.0",
"@oxc-parser/binding-linux-riscv64-gnu": "0.156.0",
"@oxc-parser/binding-linux-riscv64-musl": "0.156.0",
"@oxc-parser/binding-linux-s390x-gnu": "0.156.0",
"@oxc-parser/binding-linux-x64-gnu": "0.156.0",
"@oxc-parser/binding-linux-x64-musl": "0.156.0",
"@oxc-parser/binding-openharmony-arm64": "0.156.0",
"@oxc-parser/binding-win32-arm64-msvc": "0.156.0",
"@oxc-parser/binding-win32-ia32-msvc": "0.156.0",
"@oxc-parser/binding-win32-x64-msvc": "0.156.0"
}
},
"node_modules/oxc-parser/node_modules/@oxc-project/types": {
"version": "0.156.0",
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.156.0.tgz",
"integrity": "sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==",
"dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/oxc-project"
}
},
"node_modules/oxc-resolver": {
@@ -3899,18 +3754,44 @@
"license": "MIT"
},
"node_modules/parse5": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-8.0.1.tgz",
"integrity": "sha512-z1e/HMG90obSGeidlli3hj7cbocou0/wa5HacvI3ASx34PecNjNQeaHNo5WIZpWofN9kgkqV1q5YvXe3F0FoPw==",
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-8.1.1.tgz",
"integrity": "sha512-EcR/6WDcU7b2N3vQSxKALCk9lXGtUMQxXio008OEMBE0kavu/7JLfBEeFPzi43nMqVDSbEn3QCK+BMCc9zO//w==",
"dev": true,
"license": "MIT",
"dependencies": {
"entities": "^8.0.0"
"entities": "^9.0.0"
},
"funding": {
"url": "https://github.com/inikulin/parse5?sponsor=1"
}
},
"node_modules/parse5-parser-stream": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-8.1.1.tgz",
"integrity": "sha512-hMcVbbUJcQmP8rURWUdYrT1flRiBiBVjq/RYGguJpDUgIXSqdYKlE0CxthmdMWoSlBAuL5bUBa73g0pttSy7Hw==",
"dev": true,
"license": "MIT",
"dependencies": {
"parse5": "^8.1.1"
},
"funding": {
"url": "https://github.com/inikulin/parse5?sponsor=1"
}
},
"node_modules/parse5/node_modules/entities": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-9.0.0.tgz",
"integrity": "sha512-oJFNDJg3kTPwAD1cNn2+WmUq4wFoo09npc3Ydf1D7ED4smRiWrsKnaLxykrTWgyGEcusc87P5dxlAleol9kpkg==",
"dev": true,
"license": "BSD-2-Clause",
"engines": {
"node": ">=20.19.0"
},
"funding": {
"url": "https://github.com/fb55/entities?sponsor=1"
}
},
"node_modules/pathe": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
@@ -4074,16 +3955,6 @@
"node": ">=0.10.0"
}
},
"node_modules/require-from-string": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
"integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/resolve-pkg-maps": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
@@ -4475,9 +4346,9 @@
"license": "ISC"
},
"node_modules/unbash": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/unbash/-/unbash-6.0.1.tgz",
"integrity": "sha512-0db9eS5iqybux41zLkX69nk90KTci7F7eZ+gXzEG/Q7E0tAqEBhRh5fkZvk1N7jT7QkGWqq34i8SFGPFEe1V8A==",
"version": "6.0.4",
"resolved": "https://registry.npmjs.org/unbash/-/unbash-6.0.4.tgz",
"integrity": "sha512-t3OptUArewg9OpYGDskTSlxhyLDahfmZ4d36hE44Efb1y3HRLLpzsVqwH+AwBVymP4t7pP71xN+nnduudn2awA==",
"dev": true,
"license": "ISC",
"engines": {
@@ -5080,16 +4951,6 @@
"integrity": "sha512-msJxIvYDYcoNL+PJsu+7qmpDWsYmAxTY+2TNYXXF0hzBzBk0BMecOqDOG/EckUoKCuKwObfbugIl8QpqHDXeFA==",
"dev": true,
"license": "MIT"
},
"node_modules/zod": {
"version": "4.6.7",
"resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz",
"integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==",
"dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}
}
}
}
+9 -6
View File
@@ -1,7 +1,7 @@
{
"name": "bookmarkmagic",
"private": true,
"version": "1.2.1",
"version": "1.3.0",
"type": "module",
"description": "Import, export & edit bookmarks between browsers — offline, no account, no cloud.",
"license": "GPL-3.0-or-later",
@@ -22,29 +22,32 @@
"dev": "wxt",
"dev:firefox": "wxt -b firefox",
"build": "wxt build",
"build:firefox": "wxt build -b firefox",
"zip": "wxt zip",
"zip:firefox": "wxt zip -b firefox",
"check": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings && tsc --noEmit && tsc -p tsconfig.scripts.json",
"lint": "biome check .",
"lint:fix": "biome check --write .",
"knip": "knip",
"guard": "node scripts/guard.mjs",
"check:manifest": "node scripts/check-manifest.mjs",
"check:licenses": "node scripts/check-licenses.mjs",
"icons": "node scripts/gen-icons.mjs",
"test": "vitest run",
"test:watch": "vitest",
"coverage": "vitest run --coverage",
"verify": "npm run lint && npm run check && npm run knip && npm run guard && npm run test",
"verify:full": "npm run verify && npm run coverage && npm run build && npm run check:manifest"
"verify": "npm run lint && npm run check && npm run knip && npm run guard && npm run check:licenses && npm run test",
"verify:full": "npm run verify && npm run coverage && npm run build && npm run check:manifest && npm run build:firefox && npm run check:manifest -- --browser firefox"
},
"devDependencies": {
"@biomejs/biome": "2.6.4",
"@biomejs/biome": "2.6.6",
"@sveltejs/vite-plugin-svelte": "^7.3.1",
"@types/node": "^26.6.6",
"@typescript/native": "npm:typescript@~7.0.2",
"@vitest/coverage-v8": "^5.1.0",
"@wxt-dev/module-svelte": "^2.0.5",
"jsdom": "^30.1.3",
"knip": "^6.44.1",
"jsdom": "^31.0.0",
"knip": "^6.45.1",
"svelte": "^5.57.3",
"svelte-check": "^4.7.8",
"typescript": "npm:@typescript/typescript6@~6.0.2",
+49
View File
@@ -0,0 +1,49 @@
# Qodana — docs/12 §2.7. Read by .github/workflows/qodana.yml.
#
# qodana-js is JetBrains' JavaScript/TypeScript linter; it needs the Ultimate
# licence that QODANA_TOKEN carries. Native mode (no Docker image): the
# workflow installs node_modules on the runner first, with install scripts
# off, and the analysis reads them from there.
version: "1.0"
linter: qodana-js
withinDocker: false
profile:
name: qodana.recommended
# What is not code, or not ours: byte-exact browser samples (malformed on
# purpose), build and coverage output, screenshots, store copy, prose.
exclude:
- name: All
paths:
- tests/fixtures
- .output
- .wxt
- coverage
- capture
- store
- docs
- legal
# Inspections switched off after the first run (2026-11-18), each because it
# contradicts a rule of this repository rather than finding a defect:
#
# Doc comments here are prose (docs/10 §6). `@param` tags appear only where a
# `// @ts-check` script needs a type, so "every parameter described" is not
# the convention — 22 of the first run's 27 findings.
- name: JSCommentMatchesSignature
# A CRC-32 table for PNG chunks is bitwise by definition.
- name: JSBitwiseOperatorUsage
paths:
- scripts/gen-icons.mjs
# The dark palette is declared twice on purpose: once under the
# prefers-color-scheme query, once for the explicit theme switch (docs/06 §1).
- name: DuplicatedCode
paths:
- src/styles/tokens.css
# Clean since 2026-11-18 (docs/12 §2.7): any new finding turns this workflow
# red, so it is fixed or switched off here with its reason — never left
# standing to be ignored. Not a required check.
failureConditions:
severityThresholds:
any: 0
+17
View File
@@ -0,0 +1,17 @@
/**
* Types for scripts/check-licenses.mjs, so its tests can call it directly.
* The script itself is plain JavaScript checked with `// @ts-check`.
*/
export const SHIPPED_LICENSES: readonly string[];
export const TOOLCHAIN_LICENSES: readonly string[];
export const EXCEPTIONS: Readonly<Record<string, string>>;
export function satisfies(expression: string, allowed: readonly string[]): boolean;
export function packageNameOf(key: string): string;
export function checkLockfile(
lock: unknown,
options?: { shipsCode?: boolean },
): {
problems: string[];
checked: number;
counts: Map<string, number>;
};
+248
View File
@@ -0,0 +1,248 @@
// @ts-check
/**
* Licence gate — docs/09 §3.2, docs/12 §2.1.
*
* Reads `package-lock.json` (lockfile v3), where npm records each installed
* package's `license` field, and checks every entry against one of two lists:
*
* - SHIPPED — the packages the build compiles into the extension
* (`CREDITED_PACKAGES`, scripts/credited-packages.mjs). Their code travels
* inside a GPL-3.0-or-later extension, so only permissive licences that
* combine with it cleanly are accepted.
* - TOOLCHAIN — everything else. The extension has no runtime dependencies,
* so all of these are build and test tools that never ship. Permissive
* licences and weak, file-level copyleft (MPL-2.0) are fine; network
* copyleft (AGPL), source-available terms (SSPL, BUSL, Commons Clause),
* a missing or custom licence (`UNLICENSED`, `SEE LICENSE IN …`) are not.
*
* Anything outside the lists fails the run until a person looks at it — the
* point is that a new licence enters the tree through a reviewed change to
* this file, never unnoticed through a Dependabot bump. `EXCEPTIONS` is that
* reviewed change for one package, with its reason.
*
* The `license` value is self-declared by each package and copied verbatim by
* npm; this gate trusts it, as every lockfile-based checker must. It needs no
* `node_modules` and no network, so it runs before anything is installed.
*
* Usage: node scripts/check-licenses.mjs — reads <repo>/package-lock.json and
* <repo>/tools/publish/package-lock.json (the store-upload tool, docs/12 §3),
* resolved from this file. Its tests call `checkLockfile(lock)` directly.
*/
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { CREDITED_PACKAGES } from './credited-packages.mjs';
/** Permissive licences that may ship inside a GPL-3.0-or-later extension. */
export const SHIPPED_LICENSES = Object.freeze([
'0BSD',
'Apache-2.0',
'BSD-2-Clause',
'BSD-3-Clause',
'ISC',
'MIT',
'MIT-0',
]);
/** Licences accepted for build and test tooling, which never ships. */
export const TOOLCHAIN_LICENSES = Object.freeze([
...SHIPPED_LICENSES,
'BlueOak-1.0.0',
'CC-BY-4.0',
'CC0-1.0',
'MPL-2.0',
'Python-2.0',
'Unlicense',
'Zlib',
]);
/**
* Packages accepted despite the lists above: `name → reason`. Empty on
* purpose; an entry is a decision, recorded in docs/15's decision log.
* @type {Readonly<Record<string, string>>}
*/
export const EXCEPTIONS = Object.freeze({});
/**
* Whether an SPDX licence expression is satisfied by the allowed identifiers.
* `A OR B` needs either side, `A AND B` both; parentheses group; `A WITH X`
* (a licence exception) is judged by `A`. Anything unparseable is refused.
*
* @param {string} expression
* @param {readonly string[]} allowed
* @returns {boolean}
*/
export function satisfies(expression, allowed) {
const tokens = expression.match(/\(|\)|[^\s()]+/g) ?? [];
let at = 0;
/** @returns {boolean} */
const parseOr = () => {
let ok = parseAnd();
while (tokens[at] === 'OR') {
at++;
const right = parseAnd();
ok = ok || right;
}
return ok;
};
/** @returns {boolean} */
const parseAnd = () => {
let ok = parseTerm();
while (tokens[at] === 'AND') {
at++;
const right = parseTerm();
ok = ok && right;
}
return ok;
};
/** @returns {boolean} */
const parseTerm = () => {
const token = tokens[at++];
if (token === '(') {
const ok = parseOr();
if (tokens[at++] !== ')') throw new SyntaxError('unbalanced parentheses');
return ok;
}
if (token === undefined || token === ')' || token === 'AND' || token === 'OR') {
throw new SyntaxError('expected a licence identifier');
}
if (tokens[at] === 'WITH') at += 2;
return allowed.includes(token);
};
try {
const ok = parseOr();
return at === tokens.length && tokens.length > 0 && ok;
} catch {
return false;
}
}
/**
* The package name a lockfile key installs: the part after the last
* `node_modules/`, scope included.
* @param {string} key
*/
export function packageNameOf(key) {
const at = key.lastIndexOf('node_modules/');
return at === -1 ? key : key.slice(at + 'node_modules/'.length);
}
/**
* Lockfile text is our own committed file, but it is still file content: keep
* what reaches the log to the characters package names and SPDX ids use.
* @param {unknown} value
*/
function printable(value) {
return String(value)
.replaceAll(/[^\w@/.+() -]/g, '?')
.slice(0, 120);
}
/**
* Check every installed package of a v2/v3 lockfile.
*
* @param {unknown} lock - the parsed `package-lock.json`
* @param {{ shipsCode?: boolean }} [options] - `shipsCode: false` for a lockfile
* that builds nothing into the extension (tools/publish), where the credited
* packages are not expected
* @returns {{ problems: string[], checked: number, counts: Map<string, number> }}
*/
export function checkLockfile(lock, options = {}) {
const shipsCode = options.shipsCode ?? true;
/** @type {string[]} */
const problems = [];
/** @type {Map<string, number>} */
const counts = new Map();
const packages =
typeof lock === 'object' && lock !== null && 'packages' in lock ? lock.packages : undefined;
if (typeof packages !== 'object' || packages === null) {
return { problems: ['no "packages" map — lockfile v2 or v3 expected'], checked: 0, counts };
}
const shippedSeen = new Set();
let checked = 0;
for (const [key, raw] of Object.entries(packages)) {
// The root project (key "") and workspace links carry no install of their own.
if (key === '' || !key.includes('node_modules/')) continue;
if (typeof raw === 'object' && raw !== null && 'link' in raw && raw.link === true) continue;
checked++;
const name = packageNameOf(key);
const license =
typeof raw === 'object' && raw !== null && 'license' in raw ? raw.license : undefined;
const label = typeof license === 'string' ? license : '(none)';
counts.set(label, (counts.get(label) ?? 0) + 1);
const shipped = CREDITED_PACKAGES.includes(name);
if (shipped) shippedSeen.add(name);
if (Object.hasOwn(EXCEPTIONS, name)) continue;
const allowed = shipped ? SHIPPED_LICENSES : TOOLCHAIN_LICENSES;
if (typeof license !== 'string' || !satisfies(license, allowed)) {
problems.push(
`${printable(key)}: licence "${printable(label)}" is not accepted for ` +
(shipped ? 'code that ships in the extension' : 'build tooling'),
);
}
}
for (const name of shipsCode ? CREDITED_PACKAGES : []) {
if (!shippedSeen.has(name)) {
problems.push(`${printable(name)}: credited as shipping, but not in the lockfile`);
}
}
return { problems, checked, counts };
}
/** The lockfiles this repository installs from, and whether each builds the extension. */
const LOCKFILES = [
{ path: 'package-lock.json', shipsCode: true },
{ path: 'tools/publish/package-lock.json', shipsCode: false },
];
/** @returns {number} exit code */
function main() {
const repo = resolve(fileURLToPath(import.meta.url), '..', '..');
/** @type {string[]} */
const problems = [];
let checked = 0;
/** @type {Map<string, number>} */
const counts = new Map();
for (const { path, shipsCode } of LOCKFILES) {
/** @type {unknown} */
let lock;
try {
lock = JSON.parse(readFileSync(resolve(repo, path), 'utf8'));
} catch (cause) {
console.error(`::error::check-licenses: cannot read ${path} (${String(cause)})`);
return 1;
}
const result = checkLockfile(lock, { shipsCode });
for (const problem of result.problems) problems.push(`${path}: ${problem}`);
checked += result.checked;
for (const [license, n] of result.counts) counts.set(license, (counts.get(license) ?? 0) + n);
}
if (problems.length > 0) {
for (const problem of problems) console.error(`::error::check-licenses: ${problem}`);
console.error(
'\nSee docs/09 §3.2: add the licence to a list, or an EXCEPTIONS entry, on purpose.',
);
return 1;
}
const summary = [...counts]
.sort((a, b) => b[1] - a[1])
.map(([license, n]) => `${printable(license)} ${n}`)
.join(', ');
console.warn(`check-licenses: clean — ${checked} packages (${summary}).`);
return 0;
}
// Run only as the entry point (same guard as check-manifest.mjs).
const isEntry =
import.meta.url.startsWith('file:') &&
process.argv[1] !== undefined &&
resolve(process.argv[1]) === fileURLToPath(import.meta.url);
if (isEntry) {
// exitCode, not exit(): exit() can cut off piped stderr before CI reads it.
process.exitCode = main();
}
+5 -1
View File
@@ -2,4 +2,8 @@
* Types for scripts/check-manifest.mjs, so its tests can call it directly.
* The script itself is plain JavaScript checked with `// @ts-check`.
*/
export function checkExtension(outDir: string): { problems: string[]; readError?: string };
export const TARGETS: Record<string, { dir: string; keys: string[]; label: string }>;
export function checkExtension(
outDir: string,
target?: string,
): { problems: string[]; readError?: string };
+89 -19
View File
@@ -18,10 +18,12 @@
* 3. the bundle: none of the network identifiers `npm run guard` bans in the
* source, anywhere in the shipped JavaScript.
*
* Usage: node scripts/check-manifest.mjs — checks <repo>/.output/chrome-mv3,
* resolved from this file, not the cwd. It takes no arguments on purpose: a
* path from the command line flowed straight into file reads (SonarCloud
* S8707). Its tests call `checkExtension(dir)` directly instead.
* Usage: node scripts/check-manifest.mjs [--browser chrome|firefox] — checks
* <repo>/.output/chrome-mv3 (the default) or <repo>/.output/firefox-mv3 (since
* v1.3.0, docs/08 §9), resolved from this file, not the cwd. It takes no path:
* one from the command line flowed straight into file reads (SonarCloud
* S8707), so `--browser` only picks an entry of a fixed table. Its tests call
* `checkExtension(dir, target)` directly instead.
*/
import { existsSync, readdirSync, readFileSync } from 'node:fs';
import { join, relative, resolve } from 'node:path';
@@ -54,7 +56,10 @@ const EXPECTED_CSP =
*
* Adding a key here is a deliberate act. Check docs/08 §1 first.
*/
const EXPECTED_KEYS = [
/** @param {string} a @param {string} b */
const byName = (a, b) => a.localeCompare(b, 'en');
const COMMON_KEYS = [
'action',
'content_security_policy',
'default_locale',
@@ -62,13 +67,57 @@ const EXPECTED_KEYS = [
'homepage_url',
'icons',
'manifest_version',
'minimum_chrome_version',
'name',
'options_ui',
'permissions',
'version',
];
/**
* Firefox's block, exactly (docs/08 §9). The id is permanent once on AMO; the
* floor is the first Firefox that accepts `data_collection_permissions`.
*/
const FIREFOX_SETTINGS = {
gecko: {
id: 'bookmarkmagic@poli0981.dev',
strict_min_version: '140.0',
data_collection_permissions: { required: ['none'] },
},
};
/**
* The two packages (docs/08 §1): where each is built, its exact key set, and
* how its floor reads in the log. Edge Add-ons takes the Chrome package.
*
* @type {Record<string, { dir: string, keys: string[], label: string }>}
*/
export const TARGETS = {
chrome: {
dir: 'chrome-mv3',
keys: [...COMMON_KEYS, 'minimum_chrome_version'].sort(byName),
label: `Chrome ≥${CHROME_FLOOR}`,
},
firefox: {
dir: 'firefox-mv3',
keys: [...COMMON_KEYS, 'browser_specific_settings'].sort(byName),
label: 'Firefox ≥140, gecko id pinned',
},
};
/**
* A value's JSON with object keys sorted, so key order never decides equality.
* @param {unknown} value
* @returns {string}
*/
function canonical(value) {
if (Array.isArray(value)) return `[${value.map(canonical).join(',')}]`;
if (value !== null && typeof value === 'object') {
const entries = Object.entries(value).sort(([a], [b]) => byName(a, b));
return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${canonical(v)}`).join(',')}}`;
}
return JSON.stringify(value) ?? 'undefined';
}
/** Keys that would widen the extension's reach. None may be present. */
const FORBIDDEN_KEYS = [
'host_permissions',
@@ -110,9 +159,6 @@ const NETWORK_IN_BUNDLE =
/** `src`/`href` values in a built page. Vite writes them double-quoted. */
const PAGE_REFS = /\b(?:src|href)="([^"]*)"/g;
/** @param {string} a @param {string} b */
const byName = (a, b) => a.localeCompare(b, 'en');
/** @param {string} dir @returns {string[]} */
function listFiles(dir) {
return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
@@ -133,8 +179,13 @@ function readManifest(outDir) {
}
}
/** @param {Record<string, unknown>} manifest @param {string[]} problems */
function checkManifest(manifest, problems) {
/**
* @param {Record<string, unknown>} manifest
* @param {string[]} problems
* @param {string} target - a key of TARGETS
*/
function checkManifest(manifest, problems, target) {
const expectedKeys = TARGETS[target]?.keys ?? [];
if (manifest.manifest_version !== 3) {
problems.push(`manifest_version is ${manifest.manifest_version}, expected 3`);
}
@@ -152,14 +203,20 @@ function checkManifest(manifest, problems) {
}
const actualKeys = Object.keys(manifest);
const unexpected = actualKeys.filter((key) => !EXPECTED_KEYS.includes(key)).sort(byName);
const missing = EXPECTED_KEYS.filter((key) => !actualKeys.includes(key));
const unexpected = actualKeys.filter((key) => !expectedKeys.includes(key)).sort(byName);
const missing = expectedKeys.filter((key) => !actualKeys.includes(key));
if (unexpected.length > 0) {
problems.push(`unexpected top-level key(s): ${unexpected.join(', ')} — see docs/08 §1`);
}
if (missing.length > 0) problems.push(`missing expected top-level key(s): ${missing.join(', ')}`);
if (manifest.minimum_chrome_version !== CHROME_FLOOR) {
if (target === 'firefox') {
if (canonical(manifest.browser_specific_settings) !== canonical(FIREFOX_SETTINGS)) {
problems.push(
`browser_specific_settings is ${JSON.stringify(manifest.browser_specific_settings)}, expected exactly ${JSON.stringify(FIREFOX_SETTINGS)} (docs/08 §9)`,
);
}
} else if (manifest.minimum_chrome_version !== CHROME_FLOOR) {
problems.push(
`minimum_chrome_version is ${JSON.stringify(manifest.minimum_chrome_version)}, expected "${CHROME_FLOOR}" (docs/01 §1)`,
);
@@ -235,15 +292,19 @@ function checkBundle(outDir, problems) {
* Check one built extension directory.
*
* @param {string} outDir
* @param {string} [target] - a key of TARGETS; `chrome` when omitted
* @returns {{ problems: string[], readError?: string }} no problems and no read
* error means the build is clean
*/
export function checkExtension(outDir) {
export function checkExtension(outDir, target = 'chrome') {
if (!Object.hasOwn(TARGETS, target)) {
return { problems: [], readError: `unknown target "${target}"` };
}
const manifest = readManifest(outDir);
if (typeof manifest === 'string') return { problems: [], readError: manifest };
/** @type {string[]} */
const problems = [];
checkManifest(manifest, problems);
checkManifest(manifest, problems, target);
checkInventory(outDir, manifest, problems);
checkBundle(outDir, problems);
return { problems };
@@ -251,10 +312,19 @@ export function checkExtension(outDir) {
/** @returns {number} the exit code */
function main() {
const flag = process.argv.indexOf('--browser');
const target = flag === -1 ? 'chrome' : (process.argv[flag + 1] ?? '');
const profile = Object.hasOwn(TARGETS, target) ? TARGETS[target] : undefined;
if (profile === undefined) {
console.error(`check-manifest: --browser must be one of ${Object.keys(TARGETS).join(', ')}`);
return 1;
}
const repo = resolve(fileURLToPath(new URL('..', import.meta.url)));
const { problems, readError } = checkExtension(join(repo, '.output', 'chrome-mv3'));
// The directory comes from the table, never from the command line.
const { problems, readError } = checkExtension(join(repo, '.output', profile.dir), target);
if (readError !== undefined) {
console.error(`check-manifest: ${readError} — run \`npm run build\` first.`);
const build = target === 'chrome' ? 'npm run build' : `npm run build:${target}`;
console.error(`check-manifest: ${readError} — run \`${build}\` first.`);
return 1;
}
if (problems.length > 0) {
@@ -268,7 +338,7 @@ function main() {
// Constants only: the manifest has just passed every check, so its values ARE
// these — and nothing read from a file is echoed into the log.
console.warn(
`check-manifest: clean — MV3, permissions exactly ${ALLOWED_PERMISSIONS.join(' + ')}, Chrome ≥${CHROME_FLOOR}, CSP pinned, inventory complete, no network API in the bundle.`,
`check-manifest: clean (${target}) — MV3, permissions exactly ${ALLOWED_PERMISSIONS.join(' + ')}, ${profile.label}, CSP pinned, inventory complete, no network API in the bundle.`,
);
return 0;
}
+5
View File
@@ -0,0 +1,5 @@
/**
* Types for scripts/credited-packages.mjs, so `wxt.config.ts` and the tests can
* import the list. The script itself is plain JavaScript checked with `// @ts-check`.
*/
export const CREDITED_PACKAGES: readonly string[];
+17
View File
@@ -0,0 +1,17 @@
// @ts-check
/**
* The npm packages whose code the build compiles into the extension — docs/14 §5.
*
* One list behind three gates, so none of them can drift from the others:
* - `wxt.config.ts` fails the build when code from any other package ships;
* - `tests/unit/third-party.test.ts` requires both notices files to credit
* every package named here;
* - `scripts/check-licenses.mjs` holds each of them to the licences that may
* travel inside a GPL-3.0-or-later extension.
*
* Through v1.0.x the notices said "none" while three of these shipped. Adding
* a name here is the first step of shipping a new package, never the last:
* its licence text goes into `legal/THIRD_PARTY_NOTICES.md` and
* `src/public/THIRD_PARTY_NOTICES.txt` in the same pull request.
*/
export const CREDITED_PACKAGES = Object.freeze(['svelte', 'clsx', '@wxt-dev/browser', 'wxt']);
+1 -1
View File
@@ -107,7 +107,7 @@ export function makeTitleMapper() {
const SCRIPTS = [
[/[一-鿿぀-ヿ]/, '文字'],
[/[֐-ࣿ]/, 'شيء'],
[/[\p{Extended_Pictographic}]/u, '🌸'],
[/\p{Extended_Pictographic}/u, '🌸'],
];
return (raw) => {
+22
View File
@@ -0,0 +1,22 @@
/**
* Types for scripts/triage.mjs, so its tests can call it directly.
* The script itself is plain JavaScript checked with `// @ts-check`.
*/
export interface Decision {
action: 'close' | 'label' | 'none';
reason: string;
kind?: 'issue' | 'pr';
number?: number;
label?: string;
comment?: string;
}
export const POLICY_URL: string;
export const IDEAS_URL: string;
export const KIND_QUESTION: string;
export const KIND: Readonly<{ roadmap: string; needed: string; fresh: string }>;
export const LABEL: Readonly<{ feature: string; closed: string; triage: string; exempt: string }>;
export const ISSUE_COMMENT: string;
export const PR_COMMENT: string;
export function kindOf(body: unknown): string | undefined;
export function decide(eventName: string | undefined, payload: unknown): Decision;
+261
View File
@@ -0,0 +1,261 @@
// @ts-check
/**
* Maintenance-mode triage — MAINTENANCE.md, docs/12 §2.6.
*
* Decides what `.github/workflows/triage.yml` does with a new issue or pull
* request; the workflow then carries the decision out with `gh`. The decision
* is a pure function of the event payload, so every branch is unit-tested
* (tests/unit/scripts/triage.test.ts) instead of living in shell `if`s.
*
* - An issue labelled `enhancement` (the feature form applies it) whose
* "kind of change" answer is "something new" — or that has no answer at
* all, i.e. the maintainer labelled it by hand — is labelled
* `maintenance-mode`, gets a comment and is closed as not planned.
* - The other two answers (on the roadmap; needed for a fix) keep it open,
* labelled `needs-triage`, for the maintainer to read.
* - A pull request from outside the project titled `feat…` (Conventional
* Commits) is labelled and closed the same way.
* - Exempt: the owner's own issues, project members and collaborators, bots
* (Dependabot), anything labelled `roadmap`, anything already triaged.
*
* Nothing here runs code from the event: titles and bodies are only compared
* with constants, and the workflow passes the payload by file, never through
* shell interpolation.
*
* Usage (in CI): node scripts/triage.mjs — reads GITHUB_EVENT_NAME and
* GITHUB_EVENT_PATH from the environment the runner sets, prints a JSON
* decision on stdout. It takes no arguments.
*/
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
const REPO = 'https://github.com/poli0981/bookmarkmagic';
export const POLICY_URL = `${REPO}/blob/main/MAINTENANCE.md`;
export const IDEAS_URL = `${REPO}/discussions/categories/ideas`;
/** The feature form's dropdown, word for word (`.github/ISSUE_TEMPLATE/feature_request.yml`). */
export const KIND_QUESTION = 'Which kind of change is this?';
export const KIND = Object.freeze({
roadmap: 'Something already on the roadmap (docs/15)',
needed: 'Needed to fix a bug, a UI/UX defect or an accessibility barrier',
fresh: 'Something new — not on the roadmap',
});
export const LABEL = Object.freeze({
feature: 'enhancement',
closed: 'maintenance-mode',
triage: 'needs-triage',
exempt: 'roadmap',
});
/** Associations that mean "part of the project", per GitHub's author_association. */
const INSIDERS = new Set(['OWNER', 'MEMBER', 'COLLABORATOR']);
const BOT_NOTE = '<sub>Posted automatically by the triage workflow.</sub>';
export const ISSUE_COMMENT = [
'Thank you for the suggestion.',
'',
`BookmarkMagic is in **maintenance mode** ([MAINTENANCE.md](${POLICY_URL})): it takes bug, UI/UX and accessibility fixes, translation fixes, dependency and security updates, and features that are already on the roadmap. This request is for something new, so it has been labelled \`${LABEL.closed}\` and closed.`,
'',
'It has not been deleted, and it will be read. If it is on the roadmap, or it is needed to fix a defect or remove a barrier, it will be reopened. Ideas are welcome in [Discussions › Ideas](' +
`${IDEAS_URL}).`,
'',
BOT_NOTE,
].join('\n');
export const PR_COMMENT = [
'Thank you for the pull request.',
'',
`BookmarkMagic is in **maintenance mode** ([MAINTENANCE.md](${POLICY_URL})). A pull request that adds a feature — its title starts with \`feat\` — is closed automatically unless the feature is already on the roadmap, so this one has been labelled \`${LABEL.closed}\` and closed.`,
'',
'Please open a feature request first; if it is accepted (label `roadmap`), this pull request will be reopened. If it is a fix rather than a feature, say so in a comment — a `fix:` title is what the maintainer expects.',
'',
BOT_NOTE,
].join('\n');
/**
* @typedef {{
* action: 'close' | 'label' | 'none',
* reason: string,
* kind?: 'issue' | 'pr',
* number?: number,
* label?: string,
* comment?: string,
* }} Decision
*/
/**
* The answer to the feature form's dropdown, or undefined when the body has
* none (an issue from another form, labelled by hand). Issue forms render each
* field as `### <label>` followed by the answer.
* @param {unknown} body
* @returns {string | undefined}
*/
export function kindOf(body) {
if (typeof body !== 'string') return undefined;
const lines = body.split(/\r?\n/);
const at = lines.findIndex((line) => line.trim() === `### ${KIND_QUESTION}`);
if (at === -1) return undefined;
for (const line of lines.slice(at + 1)) {
const text = line.trim();
if (text.startsWith('### ')) return undefined;
if (text !== '') return text;
}
return undefined;
}
/** @param {unknown} value @returns {Record<string, unknown>} */
function record(value) {
return typeof value === 'object' && value !== null
? /** @type {Record<string, unknown>} */ (value)
: {};
}
/** @param {unknown} labels @returns {string[]} */
function labelNames(labels) {
if (!Array.isArray(labels)) return [];
return labels.map((label) => record(label).name).filter((name) => typeof name === 'string');
}
/** @param {unknown} value @returns {number | undefined} */
function positiveInt(value) {
return typeof value === 'number' && Number.isInteger(value) && value > 0 ? value : undefined;
}
/**
* Whether this event is the repository owner adding a label by hand.
* @param {Record<string, unknown>} payload
*/
function addedByOwner(payload) {
const sender = record(payload.sender).login;
const owner = record(record(payload.repository).owner).login;
return (
payload.action === 'labeled' && typeof sender === 'string' && sender !== '' && sender === owner
);
}
/**
* @param {Record<string, unknown>} payload
* @returns {Decision}
*/
function decideIssue(payload) {
const issue = record(payload.issue);
const number = positiveInt(issue.number);
if (number === undefined) return { action: 'none', reason: 'no issue number' };
if (payload.action !== 'opened' && payload.action !== 'labeled') {
return { action: 'none', reason: `issue action ${String(payload.action)}` };
}
if (payload.action === 'labeled' && record(payload.label).name !== LABEL.feature) {
return { action: 'none', reason: 'a different label was added' };
}
if (issue.state !== 'open') return { action: 'none', reason: 'issue is not open' };
const labels = labelNames(issue.labels);
if (!labels.includes(LABEL.feature)) return { action: 'none', reason: 'not a feature request' };
for (const done of [LABEL.exempt, LABEL.closed, LABEL.triage]) {
if (labels.includes(done)) return { action: 'none', reason: `already labelled ${done}` };
}
if (issue.author_association === 'OWNER')
return { action: 'none', reason: "the owner's own issue" };
const kind = kindOf(issue.body);
const forTriage = /** @type {Decision} */ ({
action: 'label',
reason: 'in policy — for the maintainer',
kind: 'issue',
number,
label: LABEL.triage,
});
if (kind === KIND.roadmap || kind === KIND.needed) return forTriage;
// No answer at all means the form was not used. Closing on that is the
// owner's one-touch close, so it needs the owner's own `enhancement` label;
// anything else (an edited body, an answer the form never offered) goes to
// a human rather than being closed on a guess.
if (kind !== KIND.fresh && !addedByOwner(payload)) {
return { ...forTriage, reason: 'no answer to the form, not labelled by the owner' };
}
return {
action: 'close',
reason:
kind === KIND.fresh ? 'a new feature outside the roadmap' : 'labelled enhancement by hand',
kind: 'issue',
number,
label: LABEL.closed,
comment: ISSUE_COMMENT,
};
}
/** Conventional Commits `feat`, with an optional scope and breaking-change mark. */
const FEAT_TITLE = /^feat(\([^)]*\))?!?:/i;
/**
* @param {Record<string, unknown>} payload
* @returns {Decision}
*/
function decidePullRequest(payload) {
const pr = record(payload.pull_request);
const number = positiveInt(pr.number);
if (number === undefined) return { action: 'none', reason: 'no pull request number' };
if (payload.action !== 'opened')
return { action: 'none', reason: `pull request action ${String(payload.action)}` };
if (pr.state !== 'open') return { action: 'none', reason: 'pull request is not open' };
if (record(pr.user).type === 'Bot') return { action: 'none', reason: 'opened by a bot' };
if (INSIDERS.has(String(pr.author_association)))
return { action: 'none', reason: 'opened from inside the project' };
if (labelNames(pr.labels).includes(LABEL.exempt))
return { action: 'none', reason: 'labelled roadmap' };
if (typeof pr.title !== 'string' || !FEAT_TITLE.test(pr.title.trim())) {
return { action: 'none', reason: 'not a feature pull request' };
}
return {
action: 'close',
reason: 'a feature pull request from outside the project',
kind: 'pr',
number,
label: LABEL.closed,
comment: PR_COMMENT,
};
}
/**
* What to do with one event.
* @param {string | undefined} eventName — GITHUB_EVENT_NAME
* @param {unknown} payload — the parsed GITHUB_EVENT_PATH file
* @returns {Decision}
*/
export function decide(eventName, payload) {
const event = record(payload);
if (eventName === 'issues') return decideIssue(event);
if (eventName === 'pull_request_target') return decidePullRequest(event);
return { action: 'none', reason: `event ${String(eventName)} is not triaged` };
}
/** @returns {number} exit code */
function main() {
const eventPath = process.env.GITHUB_EVENT_PATH;
if (eventPath === undefined || eventPath === '') {
console.error('triage: GITHUB_EVENT_PATH is not set — this runs inside GitHub Actions only');
return 1;
}
/** @type {unknown} */
let payload;
try {
payload = JSON.parse(readFileSync(eventPath, 'utf8'));
} catch (cause) {
console.error(`triage: cannot read the event payload (${String(cause)})`);
return 1;
}
process.stdout.write(`${JSON.stringify(decide(process.env.GITHUB_EVENT_NAME, payload))}\n`);
return 0;
}
// Run only as the entry point (same guard as check-manifest.mjs).
const isEntry =
import.meta.url.startsWith('file:') &&
process.argv[1] !== undefined &&
resolve(process.argv[1]) === fileURLToPath(import.meta.url);
if (isEntry) {
// exitCode, not exit(): exit() can cut off piped output before CI reads it.
process.exitCode = main();
}
+5 -15
View File
@@ -2,6 +2,7 @@
import { onMount } from 'svelte';
import { getAppVersion } from '@/lib/browser/app-info';
import { getRootChildren } from '@/lib/browser/bookmarks';
import { countLive } from '@/lib/browser/live-tree';
import { type ManagerRoute, openManager } from '@/lib/browser/open-manager';
import Icon, { type IconName } from '@/lib/components/icons/Icon.svelte';
import { num, t, tPlural } from '@/lib/i18n/index.svelte';
@@ -27,21 +28,10 @@
*/
async function countTree(): Promise<void> {
try {
let bookmarks = 0;
let folders = 0;
const stack: { url?: string; children?: unknown[] }[] = [];
for (const root of await getRootChildren()) {
// A loop, not push(...spread): Other Bookmarks can hold 100k children.
for (const child of root.children ?? []) stack.push(child);
}
while (stack.length > 0) {
const node = stack.pop();
if (node === undefined) break;
if (node.url === undefined) folders++;
else bookmarks++;
// SAFETY: children of a LiveNode are LiveNodes, which have this shape.
for (const child of (node.children ?? []) as typeof stack) stack.push(child);
}
// Inside the roots, separators (Firefox) apart: a separator's url is
// "data:", and counting by url called every one a bookmark.
const inside = (await getRootChildren()).flatMap((root) => root.children ?? []);
const { bookmarks, folders } = countLive(inside);
counts = { bookmarks, folders };
} catch {
counts = undefined;
+9
View File
@@ -25,6 +25,15 @@ export function getAppVersion(): string {
}
}
/** This install's extension id, or `''` when it cannot be read. Never throws. */
export function getExtensionId(): string {
try {
return browser.runtime.id;
} catch {
return '';
}
}
/**
* The `generator` string written into exported and backup BM JSON.
*
+36 -187
View File
@@ -3,60 +3,20 @@
*
* Purpose: the single audited surface where the extension talks to the
* bookmarks API. Components never call `chrome.*` directly.
* Inputs / guarantees: raw rejections are mapped to `BmBrowserError`; the live
* tree is converted into the pure `BookmarkNode` file model here, including
* the millisecond→second conversion (`chrome.bookmarks` reports `dateAdded`
* in ms; `BookmarkNode.addDate` is seconds — docs/05 §4).
* Inputs / guarantees: raw rejections are mapped to `BmBrowserError`. The
* pure half — the node shape, separators, counts and the conversion into the
* `BookmarkNode` file model — is `live-tree.ts`; which folders are the roots
* is `roots.ts`. Firefox's API differs from Chromium's in ways this file
* absorbs (docs/02 §4): its move index (below) and its missing events.
*/
import { browser } from 'wxt/browser';
import type { BookmarkNode } from '../core/model';
import { millisToSeconds } from '../core/timestamps';
import { BmAborted, BmBrowserError, BmEnvError, BmPartialWrite } from './errors';
import { BmAborted, BmBrowserError, BmPartialWrite } from './errors';
import { type LiveNode, type MoveDestination, type MoveIndexRule, moveIndexFor } from './live-tree';
/** The live-tree node. Unlike `BookmarkNode` it carries browser identity. */
export interface LiveNode {
id: string;
parentId?: string;
index?: number;
title: string;
url?: string;
dateAdded?: number;
dateGroupModified?: number;
/** Set by Chrome on policy-managed nodes; such nodes reject writes. */
unmodifiable?: string;
/**
* Chrome 134+: which permanent folder a root is ('bookmarks-bar', 'other',
* 'mobile', 'managed'), and whether it is in the signed-in account's storage
* rather than this device's. Both exist from the 136 floor up.
*/
folderType?: string;
syncing?: boolean;
children?: LiveNode[];
}
export interface BookmarkRoots {
/** Bookmarks Bar. */
toolbarId: string;
/** Other Bookmarks. */
otherId: string;
/** Mobile Bookmarks, when the profile has one. */
mobileId: string | undefined;
/** The same three roots as nodes, children included — Merge matches inside them. */
toolbar: LiveNode;
other: LiveNode;
mobile: LiveNode | undefined;
/** Writable top-level folders, in tree order, excluding managed ones. */
writable: LiveNode[];
/**
* The roots Replace backs up and empties: exactly the destinations above.
* Never an account-storage root this import does not write back into —
* deleting one would sync the deletion to every device, and the restore
* would land its bookmarks in local storage.
*/
replaceable: LiveNode[];
/** Every top-level folder, managed ones included — what "already in this browser" means. */
all: LiveNode[];
}
// The node shape and the move-index rule live with the pure helpers
// (live-tree.ts); re-exported so the adapter stays the one import for code
// that talks to the browser.
export type { LiveNode, MoveDestination } from './live-tree';
async function guard<T>(operation: string, run: () => Promise<T>): Promise<T> {
try {
@@ -72,139 +32,6 @@ export async function getRootChildren(): Promise<LiveNode[]> {
return (tree[0]?.children ?? []) as LiveNode[];
}
const FOLDER_IDS = { 'bookmarks-bar': '1', other: '2', mobile: '3' } as const;
/**
* Desktop Chrome leaves an EMPTY Mobile root out of `getTree()`, so a restore
* into a fresh profile found no Mobile root and nested those bookmarks under
* Other. The node still exists, and accepts writes; ask for it by id.
*/
async function hiddenMobileRoot(): Promise<LiveNode | undefined> {
try {
const [node] = (await browser.bookmarks.get(FOLDER_IDS.mobile)) as LiveNode[];
const usable =
node !== undefined &&
node.url === undefined &&
node.unmodifiable === undefined &&
node.syncing !== true &&
(node.folderType === undefined || node.folderType === 'mobile');
return usable ? { ...node, children: node.children ?? [] } : undefined;
} catch {
return undefined;
}
}
/**
* Resolve the destination roots.
*
* By `folderType` first — Chrome 134+ can list a signed-in account's own bar,
* Other and Mobile beside this device's, and the old by-id-then-by-position
* rule mixed the two sets up. This device's roots are the destinations;
* account roots are never written to or emptied. The ids "1"/"2"/"3" and then
* position remain as fallbacks for a browser without `folderType`. Nodes
* carrying `unmodifiable` (the enterprise "Managed bookmarks" folder) are
* excluded everywhere — writing to or removing them rejects.
*/
export async function getRoots(): Promise<BookmarkRoots> {
const children = await getRootChildren();
const writable = children.filter((node) => node.unmodifiable === undefined);
const local = writable.filter((node) => node.syncing !== true);
const typed = local.some((node) => node.folderType !== undefined);
const pick = (type: keyof typeof FOLDER_IDS): LiveNode | undefined =>
local.find((node) => node.folderType === type) ??
local.find((node) => node.id === FOLDER_IDS[type]);
const toolbar = pick('bookmarks-bar') ?? (typed ? undefined : local[0]);
const other = pick('other') ?? (typed ? undefined : local.find((n) => n !== toolbar));
const mobile =
pick('mobile') ??
(typed ? undefined : local.find((n) => n !== toolbar && n !== other)) ??
(await hiddenMobileRoot());
if (toolbar === undefined || other === undefined) {
// Not a BmBrowserError: nothing refused anything. Every root this profile
// has is policy-managed, so there is nowhere an extension may write, and
// "the browser refused a bookmark operation" would be actively misleading.
throw new BmEnvError('NO_WRITABLE_ROOTS', `${children.length} root(s), none writable`);
}
return {
toolbarId: toolbar.id,
otherId: other.id,
mobileId: mobile?.id,
toolbar,
other,
mobile,
writable,
replaceable: mobile === undefined ? [toolbar, other] : [toolbar, other, mobile],
all: children,
};
}
export interface ToNodesOptions {
/**
* Id of the Bookmarks Bar. The matching node is marked `toolbar: true`.
*
* Without this the marker is lost, and re-importing the file (including the
* Replace safety backup) lands the entire toolbar under Other Bookmarks —
* `03 §1` routes purely on that flag.
*/
toolbarId?: string;
/**
* Ids of Other and Mobile Bookmarks, marked `root: 'other'`/`'mobile'` for
* the same reason: without them a restore nested both one level too deep.
*/
otherId?: string;
mobileId?: string;
}
/** The marker ids for a whole-tree conversion — what an export or backup passes. */
export function rootMarkersOf(roots: BookmarkRoots): ToNodesOptions {
return {
toolbarId: roots.toolbarId,
otherId: roots.otherId,
...(roots.mobileId !== undefined && { mobileId: roots.mobileId }),
};
}
function markerOf(id: string, options: ToNodesOptions): Pick<BookmarkNode, 'toolbar' | 'root'> {
if (id === options.toolbarId) return { toolbar: true };
if (id === options.otherId) return { root: 'other' };
if (id === options.mobileId) return { root: 'mobile' };
return {};
}
/** Convert the live tree into the pure file model (ms → s, ids dropped). */
export function toBookmarkNodes(
nodes: readonly LiveNode[],
options: ToNodesOptions = {},
): BookmarkNode[] {
return nodes.map((node) => {
const addDate = millisToSeconds(node.dateAdded);
const isFolderNode = node.url === undefined;
// dateGroupModified is a FOLDER field — Chrome does not set it on
// bookmarks, and our HTML serializer only emits LAST_MODIFIED on <H3>.
const lastModified = isFolderNode ? millisToSeconds(node.dateGroupModified) : undefined;
return {
title: node.title,
...(node.url !== undefined && { url: node.url }),
...(addDate !== undefined && { addDate }),
...(lastModified !== undefined && { lastModified }),
...(isFolderNode && markerOf(node.id, options)),
...(isFolderNode && { children: toBookmarkNodes(node.children ?? [], options) }),
};
});
}
/** Flatten a live tree, parents before children. Used by dedupe and #edit. */
export function flattenLive(nodes: readonly LiveNode[], into: LiveNode[] = []): LiveNode[] {
for (const node of nodes) {
into.push(node);
if (node.children !== undefined) flattenLive(node.children, into);
}
return into;
}
/** The current children of one folder — what a bulk command re-plans from. */
export async function getChildren(id: string): Promise<LiveNode[]> {
return (await guard('bookmarks.getChildren', () =>
@@ -226,11 +53,33 @@ export async function update(id: string, changes: { title?: string; url?: string
await guard('bookmarks.update', () => browser.bookmarks.update(id, changes));
}
const MOVE_INDEX_RULE: MoveIndexRule = import.meta.env.FIREFOX ? 'firefox' : 'chromium';
/**
* The longest address this browser accepts in a bookmark, or `undefined` for
* none. Firefox refuses anything over 65 536 characters (Places'
* `MAX_URL_LENGTH`) — mid-write, so the import drops such addresses up front
* (docs/04 §1.2); Chromium has no limit an import can reach.
*/
export const MAX_URL_LENGTH: number | undefined = import.meta.env.FIREFOX ? 65_536 : undefined;
/**
* Move a node. Resolves to the index the browser says the node now has, which
* the caller compares with `position.local` — a disagreement means the tree on
* screen no longer matches the browser's, and it is re-read (docs/03 §3).
*/
export async function move(
id: string,
destination: { parentId?: string; index?: number },
): Promise<void> {
await guard('bookmarks.move', () => browser.bookmarks.move(id, destination));
destination: MoveDestination,
rule: MoveIndexRule = MOVE_INDEX_RULE,
): Promise<number | undefined> {
const { parentId, position } = destination;
const details = {
...(parentId !== undefined && { parentId }),
...(position !== undefined && { index: moveIndexFor(position, rule) }),
};
const moved = await guard('bookmarks.move', () => browser.bookmarks.move(id, details));
return (moved as { index?: number } | undefined)?.index;
}
/** Remove a single bookmark. Folders need `removeTree`. */
+20 -6
View File
@@ -102,14 +102,28 @@ export interface DiagnosticsContext {
theme: string;
}
/**
* The browser and its major version from the user agent: "Firefox 160",
* "Edge 142", "Chrome 142", or "unknown". Edge's agent also says Chrome, so it
* is read first. Since v1.3.0 — until then the report carried `chromeMajor`,
* which said "unknown" on Firefox.
*/
export function browserOf(userAgent: string): string {
for (const [name, pattern] of [
['Firefox', /Firefox\/(\d+)/],
['Edge', /Edg\/(\d+)/],
['Chrome', /Chrome\/(\d+)/],
] as const) {
const major = pattern.exec(userAgent)?.[1];
if (major !== undefined) return `${name} ${major}`;
}
return 'unknown';
}
/** The report the About tab copies: context first, then the events, oldest first. */
export function snapshot(context: DiagnosticsContext): string {
const chrome = /Chrome\/(\d+)/.exec(globalThis.navigator?.userAgent ?? '')?.[1] ?? 'unknown';
return JSON.stringify(
{ app: 'BookmarkMagic', ...context, chromeMajor: chrome, events: entries },
null,
2,
);
const browser = browserOf(globalThis.navigator?.userAgent ?? '');
return JSON.stringify({ app: 'BookmarkMagic', ...context, browser, events: entries }, null, 2);
}
/** Test teardown — module state outlives a single `it()`. */
+173
View File
@@ -0,0 +1,173 @@
/**
* The live bookmark tree as the browser reports it — docs/02 §4.
*
* Purpose: the pure half of the bookmarks adapter — the node shape, Firefox's
* separators, the counts, and the conversion into the file model. No
* browser call lives here, so every line is tested directly.
* Guarantees: separators are recognised by `type` alone. Firefox gives them
* `url: "data:"`, so every "has a url, so it is a bookmark" test in the code
* would otherwise count, export, dedupe and open them as bookmarks.
*/
import type { BookmarkNode } from '../core/model';
import { millisToSeconds } from '../core/timestamps';
/** The live-tree node. Unlike `BookmarkNode` it carries browser identity. */
export interface LiveNode {
id: string;
parentId?: string;
index?: number;
title: string;
url?: string;
dateAdded?: number;
dateGroupModified?: number;
/** Set by Chrome on policy-managed nodes; such nodes reject writes. */
unmodifiable?: string;
/**
* Chrome 134+: which permanent folder a root is ('bookmarks-bar', 'other',
* 'mobile', 'managed'), and whether it is in the signed-in account's storage
* rather than this device's. Both exist from the 136 floor up; Firefox has
* neither.
*/
folderType?: string;
syncing?: boolean;
/** Firefox: 'bookmark', 'folder' or 'separator'. Chromium does not send it. */
type?: string;
children?: LiveNode[];
}
/** A Firefox separator. By `type`, never by url: a separator's url is "data:". */
export function isSeparator(node: { type?: string }): boolean {
return node.type === 'separator';
}
/**
* The forest without its separators — for everything that reads bookmarks as
* bookmarks (the dedupe index, Merge's folder matching). Untouched branches
* are returned as they are.
*/
export function withoutSeparators(nodes: readonly LiveNode[]): LiveNode[] {
const out: LiveNode[] = [];
for (const node of nodes) {
if (isSeparator(node)) continue;
out.push(
node.children === undefined ? node : { ...node, children: withoutSeparators(node.children) },
);
}
return out;
}
export interface LiveCounts {
bookmarks: number;
folders: number;
/** Firefox only; always 0 in a Chromium browser. */
separators: number;
}
/**
* Count what a forest holds, separators apart. Iterative: Other Bookmarks can
* hold 100k children, and the live tree has no depth cap.
*/
export function countLive(nodes: readonly LiveNode[]): LiveCounts {
const counts: LiveCounts = { bookmarks: 0, folders: 0, separators: 0 };
const stack: LiveNode[] = [];
for (const node of nodes) stack.push(node);
while (stack.length > 0) {
const node = stack.pop();
if (node === undefined) break;
if (isSeparator(node)) counts.separators++;
else if (node.url === undefined) counts.folders++;
else counts.bookmarks++;
for (const child of node.children ?? []) stack.push(child);
}
return counts;
}
export interface ToNodesOptions {
/**
* Id of the Bookmarks Bar. The matching node is marked `toolbar: true`.
*
* Without this the marker is lost, and re-importing the file (including the
* Replace safety backup) lands the entire toolbar under Other Bookmarks —
* `03 §1` routes purely on that flag.
*/
toolbarId?: string;
/**
* Ids of Other and Mobile Bookmarks, and of Firefox's Bookmarks Menu,
* marked `root: 'other'`/`'mobile'`/`'menu'` for the same reason: without
* them a restore nested each one level too deep.
*/
otherId?: string;
mobileId?: string;
menuId?: string;
}
function markerOf(id: string, options: ToNodesOptions): Pick<BookmarkNode, 'toolbar' | 'root'> {
if (id === options.toolbarId) return { toolbar: true };
if (id === options.otherId) return { root: 'other' };
if (id === options.mobileId) return { root: 'mobile' };
if (id === options.menuId) return { root: 'menu' };
return {};
}
/**
* Convert the live tree into the pure file model (ms → s, ids dropped).
* Separators are left out: no format BookmarkMagic writes can hold one
* (docs/04).
*/
export function toBookmarkNodes(
nodes: readonly LiveNode[],
options: ToNodesOptions = {},
): BookmarkNode[] {
const out: BookmarkNode[] = [];
for (const node of nodes) {
if (isSeparator(node)) continue;
const addDate = millisToSeconds(node.dateAdded);
const isFolderNode = node.url === undefined;
// dateGroupModified is a FOLDER field — Chrome does not set it on
// bookmarks, and our HTML serializer only emits LAST_MODIFIED on <H3>.
const lastModified = isFolderNode ? millisToSeconds(node.dateGroupModified) : undefined;
out.push({
title: node.title,
...(node.url !== undefined && { url: node.url }),
...(addDate !== undefined && { addDate }),
...(lastModified !== undefined && { lastModified }),
...(isFolderNode && markerOf(node.id, options)),
...(isFolderNode && { children: toBookmarkNodes(node.children ?? [], options) }),
});
}
return out;
}
/**
* How a browser counts `bookmarks.move`'s index for a move inside one folder
* (docs/05 §10). Chromium counts as if the node were still in place; Firefox
* counts after removing it, because Places stores the final position. Moving
* `a` after `c` in `[a, b, c]` is index 3 in Chrome and 2 in Firefox — and
* sending Chrome's number to Firefox made every rightward drag land one place
* too far and Alt+↓ move two places.
*/
export type MoveIndexRule = 'chromium' | 'firefox';
/** Where a node goes: a folder, and optionally a place in it counted both ways (`planDrop`). */
export interface MoveDestination {
parentId?: string;
/** `api` counted before the node's removal (Chromium's rule), `local` after it. */
position?: { api: number; local: number };
}
/** The index to send under a browser's rule. */
export function moveIndexFor(
position: { api: number; local: number },
rule: MoveIndexRule,
): number {
return rule === 'firefox' ? position.local : position.api;
}
/** Flatten a live tree, parents before children. Used by dedupe and #edit. */
export function flattenLive(nodes: readonly LiveNode[], into: LiveNode[] = []): LiveNode[] {
for (const node of nodes) {
into.push(node);
if (node.children !== undefined) flattenLive(node.children, into);
}
return into;
}
+139
View File
@@ -0,0 +1,139 @@
/**
* Which live folders are the browser's permanent roots — docs/02 §4.
*
* Purpose: find the import's destinations — the bar, Other, Mobile, and on
* Firefox the Bookmarks Menu — in whatever browser this runs in.
* Guarantees: this device's roots only (a signed-in Chrome account's own roots
* are listed but never written to or emptied); policy-managed roots never;
* and on Firefox the Menu is never mistaken for the bar.
*/
import { browser } from 'wxt/browser';
import { getRootChildren } from './bookmarks';
import { BmEnvError } from './errors';
import type { LiveNode, ToNodesOptions } from './live-tree';
export interface BookmarkRoots {
/** Bookmarks Bar. */
toolbarId: string;
/** Other Bookmarks. */
otherId: string;
/** Mobile Bookmarks, when the profile has one. */
mobileId: string | undefined;
/** Firefox's Bookmarks Menu. No Chromium browser has one. */
menuId: string | undefined;
/** The same roots as nodes, children included — Merge matches inside them. */
toolbar: LiveNode;
other: LiveNode;
mobile: LiveNode | undefined;
menu: LiveNode | undefined;
/** Writable top-level folders, in tree order, excluding managed ones. */
writable: LiveNode[];
/**
* The roots Replace backs up and empties: exactly the destinations above.
* Never an account-storage root this import does not write back into —
* deleting one would sync the deletion to every device, and the restore
* would land its bookmarks in local storage.
*/
replaceable: LiveNode[];
/** Every top-level folder, managed ones included — what "already in this browser" means. */
all: LiveNode[];
}
/** Chromium's stable ids for the three permanent folders. */
const CHROMIUM_IDS = { 'bookmarks-bar': '1', other: '2', mobile: '3' } as const;
/** Firefox's permanent folders — Places GUIDs, the same in every profile. */
const FIREFOX_IDS = {
'bookmarks-bar': 'toolbar_____',
other: 'unfiled_____',
mobile: 'mobile______',
} as const;
const FIREFOX_MENU_ID = 'menu________';
/**
* Desktop Chrome leaves an EMPTY Mobile root out of `getTree()`, so a restore
* into a fresh profile found no Mobile root and nested those bookmarks under
* Other. The node still exists, and accepts writes; ask for it by id. (Firefox
* always lists its Mobile root, and rejects the id "3" — caught here.)
*/
async function hiddenMobileRoot(): Promise<LiveNode | undefined> {
try {
const [node] = (await browser.bookmarks.get(CHROMIUM_IDS.mobile)) as LiveNode[];
const usable =
node !== undefined &&
node.url === undefined &&
node.unmodifiable === undefined &&
node.syncing !== true &&
(node.folderType === undefined || node.folderType === 'mobile');
return usable ? { ...node, children: node.children ?? [] } : undefined;
} catch {
return undefined;
}
}
/**
* Resolve the destination roots.
*
* By `folderType` first — Chrome 134+ can list a signed-in account's own bar,
* Other and Mobile beside this device's, and the old by-id-then-by-position
* rule mixed the two sets up. Then the stable Chromium ids, then Firefox's
* GUIDs, and position last. The Bookmarks Menu is never a candidate for a
* position: Firefox lists it first, and until v1.3.0 the position fallback
* took it for the bar — Replace would have emptied the Menu and the toolbar
* and restored the bar's bookmarks into the Menu. Nodes carrying
* `unmodifiable` (the enterprise "Managed bookmarks" folder) are excluded
* everywhere — writing to or removing them rejects.
*/
export async function getRoots(): Promise<BookmarkRoots> {
const children = await getRootChildren();
const writable = children.filter((node) => node.unmodifiable === undefined);
const local = writable.filter((node) => node.syncing !== true);
const typed = local.some((node) => node.folderType !== undefined);
const menu = local.find((node) => node.id === FIREFOX_MENU_ID);
const positional = local.filter((node) => node !== menu);
const pick = (type: keyof typeof CHROMIUM_IDS): LiveNode | undefined =>
local.find((node) => node.folderType === type) ??
local.find((node) => node.id === CHROMIUM_IDS[type]) ??
local.find((node) => node.id === FIREFOX_IDS[type]);
const toolbar = pick('bookmarks-bar') ?? (typed ? undefined : positional[0]);
const other = pick('other') ?? (typed ? undefined : positional.find((n) => n !== toolbar));
const mobile =
pick('mobile') ??
(typed ? undefined : positional.find((n) => n !== toolbar && n !== other)) ??
(await hiddenMobileRoot());
if (toolbar === undefined || other === undefined) {
// Not a BmBrowserError: nothing refused anything. Every root this profile
// has is policy-managed, so there is nowhere an extension may write, and
// "the browser refused a bookmark operation" would be actively misleading.
throw new BmEnvError('NO_WRITABLE_ROOTS', `${children.length} root(s), none writable`);
}
const replaceable = [toolbar, other];
if (mobile !== undefined) replaceable.push(mobile);
if (menu !== undefined) replaceable.push(menu);
return {
toolbarId: toolbar.id,
otherId: other.id,
mobileId: mobile?.id,
menuId: menu?.id,
toolbar,
other,
mobile,
menu,
writable,
replaceable,
all: children,
};
}
/** The marker ids for a whole-tree conversion — what an export or backup passes. */
export function rootMarkersOf(roots: BookmarkRoots): ToNodesOptions {
return {
toolbarId: roots.toolbarId,
otherId: roots.otherId,
...(roots.mobileId !== undefined && { mobileId: roots.mobileId }),
...(roots.menuId !== undefined && { menuId: roots.menuId }),
};
}
+6 -3
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { getAppVersion } from '../browser/app-info';
import { getAppVersion, getExtensionId } from '../browser/app-info';
import { dateTime, t } from '../i18n/index.svelte';
import {
ACCESSIBILITY_URL,
@@ -8,7 +8,7 @@
ISSUES_URL,
LEGAL_URLS,
REPO_URL,
STORE_URL,
storeUrlFor,
} from '../links';
import { copyToClipboard } from '../browser/clipboard';
import { snapshot } from '../browser/diagnostics';
@@ -19,6 +19,9 @@
import Icon from './icons/Icon.svelte';
const version = getAppVersion();
// The listing this copy came from (docs/06 §3.5): AMO for the Firefox build,
// the Chrome Web Store for its own id, the install page for anything else.
const storeUrl = storeUrlFor({ firefox: import.meta.env.FIREFOX, extensionId: getExtensionId() });
const acceptance = $derived(getAcceptance());
// undefined when acceptedAt is missing or unparseable — storage coerces a
// missing timestamp to '', and formatting that would throw inside the render.
@@ -60,7 +63,7 @@
{t('about.accessibility')}<Icon name="external" size={12} />
</a>
</li>
<li><a href={STORE_URL} target="_blank" rel="noopener noreferrer">{t('about.store')}<Icon name="external" size={12} /></a></li>
<li><a href={storeUrl} target="_blank" rel="noopener noreferrer">{t('about.store')}<Icon name="external" size={12} /></a></li>
</ul>
<h2 class="eyebrow">{t('about.thirdParty')}</h2>
+5 -1
View File
@@ -1,5 +1,6 @@
<script lang="ts">
import type { LiveNode } from '../browser/bookmarks';
import { isSeparator } from '../browser/live-tree';
import type { CheckState } from '../core/select';
import { num, t, tPlural } from '../i18n/index.svelte';
import Disclosure from './Disclosure.svelte';
@@ -24,7 +25,10 @@
/** Only folders are pickable — a bookmark travels with its parent. */
const folders = $derived((node.children ?? []).filter((child) => child.url === undefined));
const bookmarks = $derived((node.children ?? []).filter((child) => child.url !== undefined).length);
// A Firefox separator has a url ("data:") but is not a bookmark (docs/02 §4).
const bookmarks = $derived(
(node.children ?? []).filter((child) => child.url !== undefined && !isSeparator(child)).length,
);
const shown = $derived(folders.length > limit ? folders.slice(0, limit) : folders);
let input: HTMLInputElement | undefined = $state();
+13 -5
View File
@@ -191,11 +191,19 @@
open={confirmingReplace}
danger
title={t('import.replaceConfirmTitle')}
body={t('import.replaceConfirmBody', {
current: counts(prepared?.current.bookmarks ?? 0, prepared?.current.folders ?? 0),
incoming: counts(forecast?.stats.bookmarkCount ?? 0, forecast?.stats.folderCount ?? 0),
name: session.filename,
})}
body={[
t('import.replaceConfirmBody', {
current: counts(prepared?.current.bookmarks ?? 0, prepared?.current.folders ?? 0),
incoming: counts(forecast?.stats.bookmarkCount ?? 0, forecast?.stats.folderCount ?? 0),
name: session.filename,
}),
// Firefox only: separators go with the rest, and nothing brings them back.
(prepared?.current.separators ?? 0) > 0
? tPlural('import.replaceSeparators', prepared?.current.separators ?? 0)
: '',
]
.filter((sentence) => sentence !== '')
.join(' ')}
confirmLabel={t('import.replaceConfirm')}
cancelLabel={t('common.cancel')}
onconfirm={() => void start(session.filename)}
+36 -12
View File
@@ -110,18 +110,27 @@
onfocus={onFocus}
>
{#each shown as row (row.node.id)}
<li
id="node-{row.node.id}"
data-node-id={row.node.id}
role="treeitem"
aria-level={row.depth}
aria-setsize={row.setSize}
aria-posinset={row.posInSet}
aria-expanded={row.expandable ? row.expanded : undefined}
aria-selected={session.focusedId === row.node.id}
>
<TreeRow {row} {session} {onopen} {oncopy} {onsort} />
</li>
{#if row.node.separator === true}
<!-- A Firefox separator (docs/06 §5): a line, and aria-hidden, so it is
outside the accessibility tree and the tree still owns only
treeitems. It takes no focus and no drop. -->
<li class="separator" aria-hidden="true" style:--depth={row.depth - 1}>
<span class="rule"></span>
</li>
{:else}
<li
id="node-{row.node.id}"
data-node-id={row.node.id}
role="treeitem"
aria-level={row.depth}
aria-setsize={row.setSize}
aria-posinset={row.posInSet}
aria-expanded={row.expandable ? row.expanded : undefined}
aria-selected={session.focusedId === row.node.id}
>
<TreeRow {row} {session} {onopen} {oncopy} {onsort} />
</li>
{/if}
{/each}
</ul>
@@ -156,6 +165,21 @@
overflow: auto;
}
/* Indented like a row: 18px per level, plus the row's own inset and a
disclosure-sized gap, so the line starts where its siblings' titles do. */
.separator {
display: flex;
align-items: center;
height: 12px;
padding-left: calc(var(--depth) * 18px + var(--sp-1) + 18px);
padding-right: var(--sp-2);
}
.separator .rule {
flex: 1;
border-top: 1px solid var(--border-strong);
}
.tree:focus-visible {
outline: 2px solid var(--accent);
outline-offset: -2px;
+5 -1
View File
@@ -36,7 +36,11 @@
? 'unfiled'
: node.root === 'mobile'
? 'mobile'
: undefined,
: // Only Firefox has a Bookmarks Menu to unwrap into; elsewhere a
// menu folder stays a folder, so it gets no pill (docs/03 §1).
node.root === 'menu' && import.meta.env.FIREFOX
? 'menu'
: undefined,
);
</script>
+3 -1
View File
@@ -28,6 +28,8 @@
const focused = $derived(session.focusedId === node.id);
const renaming = $derived(session.renamingId === node.id && editable);
const domain = $derived(hostOf(node.url));
// Bookmarks and folders only: a Firefox separator is not an item (docs/03 §3).
const itemCount = $derived((node.children ?? []).filter((c) => c.separator !== true).length);
const blocked = $derived(!isFolder && isBlockedUrl(node.url));
/** Which part of this row a drag is over, when the drop there is legal. */
@@ -118,7 +120,7 @@
{:else}
<span class="title" class:untitled={node.title === ''}>{node.title === '' ? (node.url ?? '') : node.title}</span>
{#if domain !== ''}<span class="domain">{domain}</span>{/if}
{#if isFolder}<span class="count">{node.children?.length ?? 0}</span>{/if}
{#if isFolder}<span class="count">{itemCount}</span>{/if}
{#if blocked}
<!-- docs/09 T3: a javascript:/data: bookmark must not look like an
ordinary link that merely does nothing when clicked. -->
+41
View File
@@ -8,6 +8,8 @@
* censor; they are never rendered as links).
*/
import { type BookmarkNode, computeStats, isFolder, type ParseResult } from './model';
export type HrefVerdict = 'ok' | 'missing' | 'invalid' | 'place-query';
/**
@@ -31,3 +33,42 @@ export function classifyHref(raw: string | null | undefined): HrefVerdict {
if (/^place:/i.test(trimmed)) return 'place-query';
return 'ok';
}
/** Bookmarks under `nodes` whose address is longer than `max`, removed. */
function withoutLongUrls(
nodes: readonly BookmarkNode[],
max: number,
dropped: { count: number },
): BookmarkNode[] {
const out: BookmarkNode[] = [];
for (const node of nodes) {
if (!isFolder(node)) {
if ((node.url ?? '').length > max) dropped.count++;
else out.push(node);
continue;
}
out.push({ ...node, children: withoutLongUrls(node.children ?? [], max, dropped) });
}
return out;
}
/**
* Drop the bookmarks a browser would refuse for their length — docs/04 §1.2.
*
* Firefox refuses an address longer than 65 536 characters, and refuses it in
* the middle of a write, possibly after a Replace has cleared the tree. The
* browser layer passes its limit; Chromium has none and passes `undefined`,
* which returns the result untouched. Applied once after parsing, so every
* format meets one rule, and before the preview, so its counts include it.
*/
export function capUrlLength(result: ParseResult, max: number | undefined): ParseResult {
if (max === undefined) return result;
const dropped = { count: 0 };
const roots = withoutLongUrls(result.roots, max, dropped);
if (dropped.count === 0) return result;
return {
roots,
stats: computeStats(roots),
warnings: [...result.warnings, { code: 'URL_TOO_LONG', count: dropped.count }],
};
}
+7 -2
View File
@@ -11,8 +11,11 @@
* OMITTING absent keys, never by assigning `undefined`.
*/
/** A top-level folder that stands for a browser root other than the bar (docs/04 §1.1, §2). */
export type RootMarker = 'other' | 'mobile';
/**
* A top-level folder that stands for a browser root other than the bar
* (docs/04 §1.1, §2). `menu` is Firefox's Bookmarks Menu (since v1.3.0).
*/
export type RootMarker = 'other' | 'mobile' | 'menu';
export interface BookmarkNode {
title: string;
@@ -56,6 +59,8 @@ export const PARSE_WARNING_CODES = [
'PLACE_QUERIES_SKIPPED',
'EXTRA_ROOTS_SKIPPED',
'UNREADABLE_ENTRIES',
'SEPARATORS_SKIPPED',
'URL_TOO_LONG',
] as const;
export type ParseWarningCode = (typeof PARSE_WARNING_CODES)[number];
+3 -1
View File
@@ -47,7 +47,9 @@ function readDate(value: unknown, warnings: WarningBag): number | undefined {
function readRootMarker(raw: Record<string, unknown>): RootMarker | undefined {
if (raw.toolbar === true) return undefined; // the toolbar wins
return raw.root === 'other' || raw.root === 'mobile' ? raw.root : undefined;
return raw.root === 'other' || raw.root === 'mobile' || raw.root === 'menu'
? raw.root
: undefined;
}
function readNode(
+6 -10
View File
@@ -9,18 +9,12 @@
* by shape), plus display titles for the roots Firefox names only by key.
* Guarantees: emits the same tree Firefox's own HTML export describes for the
* same profile (docs/04 §2b parity rule), with the Mobile root added.
* Separators are skipped silently, as `<HR>` is; `place:` smart bookmarks
* Separators are skipped and counted, as `<HR>` is; `place:` smart bookmarks
* are skipped and counted; the tags root is dropped, because it is a view
* over bookmarks the other roots already hold.
*/
import { classifyHref } from '../href';
import {
BmParseError,
type BookmarkNode,
computeStats,
type ParseResult,
type RootMarker,
} from '../model';
import { BmParseError, type BookmarkNode, computeStats, type ParseResult } from '../model';
import { microsToSeconds } from '../timestamps';
import { bookmarkTitle, isRecord, NodeBudget, type RootTitles, WarningBag } from './shared';
@@ -141,6 +135,8 @@ function readNode(raw: unknown, depth: number, ctx: ReadContext): BookmarkNode |
case 'bookmark':
return readBookmark(raw, ctx);
case 'separator':
// No format BookmarkMagic writes holds one; counted, as <HR> is (docs/04 §2b).
ctx.warnings.add('SEPARATORS_SKIPPED');
return null;
case 'unknown':
ctx.warnings.add('UNREADABLE_ENTRIES');
@@ -162,7 +158,7 @@ function countBookmarks(root: unknown): number {
}
/** A Map, not an object literal: `root: "toString"` must not find a prototype method. */
const ROOT_KEYS = new Map<unknown, 'toolbar' | RootMarker>([
const ROOT_KEYS = new Map<unknown, 'toolbar' | 'other' | 'mobile'>([
['toolbarFolder', 'toolbar'],
['unfiledBookmarksFolder', 'other'],
['mobileFolder', 'mobile'],
@@ -180,7 +176,7 @@ function readPlacesRoot(
ctx: ReadContext,
): BookmarkNode[] {
const menu: BookmarkNode[] = [];
const special: Partial<Record<'toolbar' | RootMarker, BookmarkNode>> = {};
const special: Partial<Record<'toolbar' | 'other' | 'mobile', BookmarkNode>> = {};
for (const child of children) {
if (!isRecord(child)) {
+6 -3
View File
@@ -128,9 +128,9 @@ function walkDl(dl: Element, depth: number, ctx: WalkContext): BookmarkNode[] {
const out: BookmarkNode[] = [];
for (const child of entryElements(dl)) {
const tag = tagOf(child);
// <HR> separators (Firefox) are skipped silently — docs/04 §1.2. The HTML
// parser usually nests them inside the preceding <DT>; either way they
// are never read as an entry.
// <HR> separators (Firefox) are never read as an entry — docs/04 §1.2.
// The HTML parser usually nests them inside the preceding <DT>, so they
// are counted once for the whole document instead (SEPARATORS_SKIPPED).
if (tag === 'dd') ctx.warnings.add('DESCRIPTIONS_DROPPED');
if (tag !== 'dt') continue;
// Checked per entry, not per list: an EMPTY list one level past the cap is
@@ -287,6 +287,9 @@ export function parseNetscapeHtml(text: string): ParseResult {
}
const ctx: WalkContext = { warnings: new WarningBag(), budget: new NodeBudget() };
// The file model has no separator (docs/04 §1.2): count what is left out.
const separators = doc.getElementsByTagName('hr').length;
if (separators > 0) ctx.warnings.add('SEPARATORS_SKIPPED', separators);
let roots = body === null || !hasEntries ? [] : collectRoots(body, ctx);
if (roots.length === 0 && hasEntries) roots = outermostLists(doc, ctx);
+7 -1
View File
@@ -26,6 +26,8 @@ export interface PlanDestinations {
other: LiveFolderLike;
/** Absent when the profile has none; Mobile-marked folders then land under Other. */
mobile?: LiveFolderLike;
/** Firefox's Bookmarks Menu; absent in every Chromium browser (docs/03 §1). */
menu?: LiveFolderLike;
}
export interface BuildPlanOptions {
@@ -70,8 +72,12 @@ function planSplit(
destinations: PlanDestinations,
mode: 'merge' | 'replace',
): { segments: PlanSegment[]; reusedFolders: number } {
const routed = routeTopLevel(nodes, { hasMobileRoot: destinations.mobile !== undefined });
const routed = routeTopLevel(nodes, {
hasMobileRoot: destinations.mobile !== undefined,
hasMenuRoot: destinations.menu !== undefined,
});
const targets: [BookmarkNode[], LiveFolderLike | undefined][] = [
[routed.menu, destinations.menu],
[routed.toolbar, destinations.toolbar],
[routed.other, destinations.other],
[routed.mobile, destinations.mobile],
+18 -5
View File
@@ -2,7 +2,8 @@
* Top-level routing — docs/03 §1 step 7, docs/02 §4.
*
* Purpose: decide which browser root each top-level node of a file lands in.
* Inputs: the (deduped) top-level nodes; whether the profile has a Mobile root.
* Inputs: the (deduped) top-level nodes; whether the profile has a Mobile root,
* and whether it has a Bookmarks Menu (Firefox).
* Guarantees: pure. Markers are read on TOP-LEVEL nodes only — deeper they are
* carried as data. A marked folder IS that root, so it is unwrapped: its
* children go into the root and the folder itself is never written, which is
@@ -14,6 +15,8 @@ export interface RoutedNodes {
toolbar: BookmarkNode[];
other: BookmarkNode[];
mobile: BookmarkNode[];
/** Firefox's Bookmarks Menu; always empty without one. */
menu: BookmarkNode[];
/** Marked folders that were unwrapped rather than written. */
unwrapped: number;
}
@@ -30,13 +33,17 @@ function append(target: BookmarkNode[], list: readonly BookmarkNode[] | undefine
* - `root: 'other'` folder → its children into Other, in its place in the order;
* - `root: 'mobile'` folder → its children into Mobile; a profile with no
* Mobile root keeps it as an ordinary folder under Other instead;
* - everything else → Other.
* - `root: 'menu'` folder → its children into the Bookmarks Menu; a browser
* with none (every Chromium one) keeps it as an ordinary folder under Other;
* - everything else → the Bookmarks Menu where there is one — what Firefox's
* own import does with the loose entries its own export writes — else Other.
*/
export function routeTopLevel(
nodes: readonly BookmarkNode[],
options: { hasMobileRoot: boolean },
options: { hasMobileRoot: boolean; hasMenuRoot?: boolean },
): RoutedNodes {
const routed: RoutedNodes = { toolbar: [], other: [], mobile: [], unwrapped: 0 };
const routed: RoutedNodes = { toolbar: [], other: [], mobile: [], menu: [], unwrapped: 0 };
const loose = options.hasMenuRoot === true ? routed.menu : routed.other;
for (const node of nodes) {
if (node.toolbar === true) {
if (isFolder(node)) {
@@ -51,8 +58,14 @@ export function routeTopLevel(
} else if (isFolder(node) && node.root === 'mobile' && options.hasMobileRoot) {
append(routed.mobile, node.children);
routed.unwrapped++;
} else {
} else if (isFolder(node) && node.root === 'menu' && options.hasMenuRoot === true) {
append(routed.menu, node.children);
routed.unwrapped++;
} else if (isFolder(node) && (node.root === 'menu' || node.root === 'mobile')) {
// A root this browser does not have stays a folder, under Other.
routed.other.push(node);
} else {
loose.push(node);
}
}
return routed;
+3 -1
View File
@@ -13,6 +13,8 @@ export interface SearchableNode {
id: string;
title: string;
url?: string;
/** A Firefox separator: shown, never a match — its url is "data:" (docs/03 §3). */
separator?: true;
children?: SearchableNode[];
}
@@ -50,7 +52,7 @@ export function searchTree(roots: readonly SearchableNode[], query: string): Sea
const walk = (nodes: readonly SearchableNode[], ancestors: readonly string[]): boolean => {
let anyHere = false;
for (const node of nodes) {
const self = matches(node, needle);
const self = node.separator !== true && matches(node, needle);
const trail = [...ancestors, node.id];
const below = walk(node.children ?? [], trail);
+15 -2
View File
@@ -78,10 +78,23 @@ function writeNode(node: BookmarkNode, depth: number, out: string[]): void {
);
}
/** Serialize a tree to Netscape bookmark HTML (UTF-8, LF line endings). */
/**
* Serialize a tree to Netscape bookmark HTML (UTF-8, LF line endings).
*
* Firefox's Bookmarks Menu has no attribute in this format: Firefox writes the
* menu's entries as the file's top level and reads loose top-level entries
* back into the menu. A top-level `root: 'menu'` folder is therefore
* unwrapped here, its children written in its place (docs/04 §1.1).
*/
export function serializeNetscapeHtml(roots: readonly BookmarkNode[]): string {
const out: string[] = ['<DL><p>'];
for (const node of roots) writeNode(node, 1, out);
for (const node of roots) {
if (node.root === 'menu' && node.toolbar !== true && !isBookmark(node)) {
for (const child of node.children ?? []) writeNode(child, 1, out);
} else {
writeNode(node, 1, out);
}
}
out.push('</DL><p>');
return `${HEADER}${out.join('\n')}\n`;
}
+15 -5
View File
@@ -6,7 +6,7 @@
* Inputs: `EditNode` trees, plus `LiveNode`s straight from the bookmarks API.
* Guarantees: pure — no `chrome.*`, no Svelte, no mutation of the input.
*/
import type { LiveNode } from '../browser/bookmarks';
import { isSeparator, type LiveNode } from '../browser/live-tree';
import type { EditNode } from './patch-tree';
/**
@@ -17,13 +17,18 @@ import type { EditNode } from './patch-tree';
* folders, which is what makes `url === undefined` a reliable folder test.
*/
export function toEditNode(node: LiveNode): EditNode {
const separator = isSeparator(node);
// A separator keeps a url — Firefox sends "data:" — so that no "no url ⇒
// folder" test anywhere mistakes it for an empty folder.
const url = separator ? (node.url ?? 'data:') : node.url;
return {
id: node.id,
...(node.parentId !== undefined && { parentId: node.parentId }),
title: node.title,
...(node.url !== undefined && { url: node.url }),
...(node.url === undefined && { children: (node.children ?? []).map(toEditNode) }),
...(url !== undefined && { url }),
...(url === undefined && { children: (node.children ?? []).map(toEditNode) }),
...(node.unmodifiable !== undefined && { unmodifiable: node.unmodifiable }),
...(separator && { separator: true as const }),
};
}
@@ -45,6 +50,8 @@ export function flattenTree(nodes: readonly EditNode[], into: EditNode[] = []):
*/
export function isEditable(roots: readonly EditNode[], node: EditNode): boolean {
if (node.unmodifiable !== undefined) return false;
// Separators are shown and left alone: none of the row commands applies.
if (node.separator === true) return false;
return !roots.some((root) => root.id === node.id);
}
@@ -87,10 +94,13 @@ export function hostOf(url: string | undefined): string {
return new URL(url).host;
}
/** How many nodes sit inside `node`. Drives the delete confirmation's count. */
/**
* How many bookmarks and folders sit inside `node` — the delete confirmation's
* count. Separators (Firefox) go too, but are not "items" to anyone reading it.
*/
export function countDescendants(node: EditNode | undefined): number {
if (node === undefined) return 0;
return flattenTree(node.children ?? []).length;
return flattenTree(node.children ?? []).filter((child) => child.separator !== true).length;
}
/** Ids to delete so one copy of each duplicated link survives. */
+5
View File
@@ -19,6 +19,11 @@ export interface EditNode {
url?: string;
dateAdded?: number;
unmodifiable?: string;
/**
* A Firefox separator (docs/03 §3): a row of its own that no command touches.
* It keeps its `url` ("data:"), so every "no url ⇒ folder" test stays right.
*/
separator?: true;
children?: EditNode[];
}
+31 -5
View File
@@ -22,11 +22,9 @@ function sortKey(node: EditNode): string {
return node.title.trim() === '' && node.url !== undefined ? node.url : node.title;
}
/** The children in sorted order, without moving anything. */
export function sortedOrder(children: readonly EditNode[], locale: string): EditNode[] {
const collator = new Intl.Collator(locale, { numeric: true, sensitivity: 'base' });
return children
.map((node, position) => ({ node, position }))
/** One run of children between separators, sorted: folders first, then by name. */
function sortRun(run: readonly { node: EditNode; position: number }[], collator: Intl.Collator) {
return [...run]
.sort((a, b) => {
const aFolder = a.node.url === undefined;
const bFolder = b.node.url === undefined;
@@ -36,6 +34,34 @@ export function sortedOrder(children: readonly EditNode[], locale: string): Edit
.map(({ node }) => node);
}
/**
* The children in sorted order, without moving anything.
*
* Firefox's separators split a folder into runs the user made on purpose, so
* each run is sorted on its own and every separator keeps its place (docs/05
* §10). Chromium has no separators: one run, as before.
*/
export function sortedOrder(children: readonly EditNode[], locale: string): EditNode[] {
const collator = new Intl.Collator(locale, { numeric: true, sensitivity: 'base' });
const out: EditNode[] = [];
// A loop, not push(...spread): a folder can hold 100k children.
const flush = (items: readonly { node: EditNode; position: number }[]): void => {
for (const node of sortRun(items, collator)) out.push(node);
};
let run: { node: EditNode; position: number }[] = [];
for (const [position, node] of children.entries()) {
if (node.separator === true) {
flush(run);
out.push(node);
run = [];
} else {
run.push({ node, position });
}
}
flush(run);
return out;
}
/**
* The moves, left to right: each fills the next position with the child that
* belongs there. Every move takes a child from further right, so moving it to
+16 -6
View File
@@ -17,7 +17,9 @@ export interface VisibleRow {
/**
* Position among the visible siblings, 1-based, and how many there are. The
* rows render flat, so the browser cannot count siblings itself — without
* these, a screen reader announced "1 of 1" on every row.
* these, a screen reader announced "1 of 1" on every row. Separators
* (Firefox) are rows but not items: they are not counted, and their own
* values mean nothing (docs/06 §5).
*/
posInSet: number;
setSize: number;
@@ -44,17 +46,21 @@ export function visibleRows(
const rows: VisibleRow[] = [];
const walk = (nodes: readonly EditNode[], depth: number, parentId: string | undefined): void => {
const shown = visible === undefined ? nodes : nodes.filter((node) => visible.has(node.id));
for (const [index, node] of shown.entries()) {
const setSize = shown.filter((node) => node.separator !== true).length;
let position = 0;
for (const node of shown) {
const children = node.children ?? [];
const isOpen = expanded.has(node.id);
if (node.separator !== true) position++;
rows.push({
node,
depth,
parentId,
expandable: node.url === undefined && children.length > 0,
// A folder holding only separators has nothing to step into.
expandable: node.url === undefined && children.some((child) => child.separator !== true),
expanded: isOpen,
posInSet: index + 1,
setSize: shown.length,
posInSet: position,
setSize,
});
if (isOpen) walk(children, depth + 1, node.id);
}
@@ -73,8 +79,10 @@ export function visibleRows(
export function resolveKey(
key: string,
focusedId: string | undefined,
rows: readonly VisibleRow[],
allRows: readonly VisibleRow[],
): TreeAction {
// Separators take no focus, so every key moves over the rows that can.
const rows = allRows.filter((row) => row.node.separator !== true);
if (rows.length === 0) return NONE;
const index = rows.findIndex((row) => row.node.id === focusedId);
const current = index === -1 ? undefined : rows[index];
@@ -123,6 +131,8 @@ export function resolveKey(
* The VISIBLE siblings: under a search only the matches count, because the
* user places the row relative to one they can see, exactly as a drag does. A
* collapsed neighbour's children are not rows, so they are skipped for free.
* A separator IS a neighbour: stepping past one is one place, as a drag beside
* it would be — skipping it would move the row two places at once.
*
* @returns the neighbour's id, or `undefined` at either end of the folder.
*/
+5 -17
View File
@@ -8,15 +8,10 @@
*/
import { getGeneratorVersion } from '../browser/app-info';
import {
getRootChildren,
getRoots,
type LiveNode,
rootMarkersOf,
type ToNodesOptions,
toBookmarkNodes,
} from '../browser/bookmarks';
import { getRootChildren, type LiveNode } from '../browser/bookmarks';
import { sanitizeFilename, timestampSuffix, triggerDownload } from '../browser/download';
import { countLive, type ToNodesOptions, toBookmarkNodes } from '../browser/live-tree';
import { getRoots, rootMarkersOf } from '../browser/roots';
import type { ExportFormat } from '../browser/storage';
import type { CsvDelimiter } from '../core/csv-dialect';
import { filterBySelection } from '../core/select';
@@ -75,15 +70,8 @@ export function countSelected(
selection: ReadonlySet<string> | undefined,
): number {
const scoped = selection === undefined ? roots : filterBySelection(roots, selection);
let total = 0;
const walk = (nodes: readonly LiveNode[]): void => {
for (const node of nodes) {
if (node.url !== undefined) total++;
walk(node.children ?? []);
}
};
walk(scoped);
return total;
// Separators (Firefox) carry a url too, "data:" — never a bookmark here.
return countLive(scoped).bookmarks;
}
/** Serialize a scoped tree. Split out from the download so it is testable. */
+1 -1
View File
@@ -83,7 +83,7 @@ export function tPlural(
function interpolate(raw: string, params?: Record<string, string | number>): string {
if (params === undefined) return raw;
return raw.replace(/\{(\w+)\}/g, (match, token: string) =>
return raw.replace(/\{(\w+)}/g, (match, token: string) =>
Object.hasOwn(params, token) ? String(params[token]) : match,
);
}
+8 -2
View File
@@ -41,7 +41,13 @@ export const importTab = {
replaceConfirmBody:
'{current} in this browser will be deleted, after a safety backup is saved. Then {incoming} from {name} are written.',
replaceConfirm: 'Back up and replace',
target: { bar: 'bar', unfiled: 'Other', mobile: 'Mobile' },
// Firefox only (docs/03 §1): Replace deletes separators and no file keeps one.
replaceSeparators: {
one: '{n} separator line will be deleted too, and cannot come back — the backup, like every file BookmarkMagic writes, cannot hold one.',
other:
'{n} separator lines will be deleted too, and cannot come back — the backup, like every file BookmarkMagic writes, cannot hold one.',
},
target: { bar: 'bar', unfiled: 'Other', mobile: 'Mobile', menu: 'Menu' },
targetNote:
'In Merge and Replace, this folder’s contents go straight into that browser folder instead of a copy of it.',
reused: {
@@ -67,7 +73,7 @@ export const importTab = {
cancelledAfterClear:
'You cancelled after your existing bookmarks had already been deleted, so what is left is only the part that was rebuilt.',
dateNotice:
'Imported bookmarks are dated today. Chrome does not let an extension set a bookmark’s original date — your exported files keep the real ones.',
'Imported bookmarks are dated today. The browser does not let an extension set a bookmark’s original date — your exported files keep the real ones.',
partialCreated: {
one: '{n} item had already been created before this failed, and was left in place.',
other: '{n} items had already been created before this failed, and were left in place.',
+12 -3
View File
@@ -46,9 +46,8 @@ export const warnings = {
other: '{n} entries have addresses the browser cannot store, so they were skipped.',
},
PLACE_QUERIES_SKIPPED: {
one: '{n} Firefox smart bookmark (a saved search, not a web page) was skipped — here it would be a dead link.',
other:
'{n} Firefox smart bookmarks (saved searches, not web pages) were skipped — here they would be dead links.',
one: '{n} Firefox smart bookmark (a saved search, not a web page) was skipped.',
other: '{n} Firefox smart bookmarks (saved searches, not web pages) were skipped.',
},
EXTRA_ROOTS_SKIPPED: {
one: '{n} bookmark in a browser-specific folder (such as Opera’s Speed Dial or Trash) was not imported.',
@@ -59,6 +58,16 @@ export const warnings = {
one: '{n} entry in this file could not be read and was skipped.',
other: '{n} entries in this file could not be read and were skipped.',
},
SEPARATORS_SKIPPED: {
one: '{n} separator line was left out — BookmarkMagic keeps bookmarks and folders, not separators.',
other:
'{n} separator lines were left out — BookmarkMagic keeps bookmarks and folders, not separators.',
},
URL_TOO_LONG: {
one: '{n} bookmark was skipped: its address is longer than the 65,536 characters this browser accepts.',
other:
'{n} bookmarks were skipped: their addresses are longer than the 65,536 characters this browser accepts.',
},
};
export const errors = {
+1 -1
View File
@@ -193,7 +193,7 @@ const dict = {
issues: 'Report an issue',
changelog: 'Releases and changelog',
accessibility: 'Accessibility',
store: 'Chrome Web Store listing',
store: 'Store listing',
thirdParty: 'Third-party code',
thirdPartyNote:
'No runtime dependencies are installed. A few small MIT-licensed pieces are compiled into the extension: the Svelte runtime with its clsx helper, and WXT’s one-line browser shim — see THIRD_PARTY_NOTICES.txt in the package.',
+7 -2
View File
@@ -38,7 +38,12 @@ export const importTab = {
replaceConfirmBody:
'バックアップを保存した後、このブラウザの{current}を削除し、{name} から{incoming}を書き込みます。',
replaceConfirm: 'バックアップして置き換え',
target: { bar: 'バー', unfiled: 'その他', mobile: 'モバイル' },
replaceSeparators: {
one: '区切り線 {n} 本も削除され、元に戻せません。バックアップを含め、BookmarkMagic が書き出すファイルは区切り線を保存できないためです。',
other:
'区切り線 {n} 本も削除され、元に戻せません。バックアップを含め、BookmarkMagic が書き出すファイルは区切り線を保存できないためです。',
},
target: { bar: 'バー', unfiled: 'その他', mobile: 'モバイル', menu: 'メニュー' },
targetNote:
'統合と置き換えでは、このフォルダの中身はコピーを作らず、ブラウザの対応するフォルダに直接入ります。',
reused: {
@@ -57,7 +62,7 @@ export const importTab = {
cancelledAfterClear:
'既存のブックマークが削除された後にキャンセルされたため、残っているのは再作成された分だけです。',
dateNotice:
'インポートしたブックマークの日付は本日になります。拡張機能がブックマークの元の作成日を設定することを Chrome が許可していないためです。エクスポートしたファイルには本来の日付が残ります。',
'インポートしたブックマークの日付は本日になります。拡張機能がブックマークの元の作成日を設定することをブラウザが許可していないためです。エクスポートしたファイルには本来の日付が残ります。',
partialCreated: {
one: 'エラーの前に {n} 件が作成済みで、そのまま残されています。',
other: 'エラーの前に {n} 件が作成済みで、そのまま残されています。',
+12 -2
View File
@@ -37,9 +37,9 @@ export const warnings = {
other: 'ブラウザが保存できないアドレスの項目が {n} 件あったため、スキップしました。',
},
PLACE_QUERIES_SKIPPED: {
one: 'Firefox のスマートブックマーク(ウェブページではなく保存された検索)を {n} 件スキップしました。ここではリンク切れになるためです。',
one: 'Firefox のスマートブックマーク(ウェブページではなく保存された検索)を {n} 件スキップしました。',
other:
'Firefox のスマートブックマーク(ウェブページではなく保存された検索)を {n} 件スキップしました。ここではリンク切れになるためです。',
'Firefox のスマートブックマーク(ウェブページではなく保存された検索)を {n} 件スキップしました。',
},
EXTRA_ROOTS_SKIPPED: {
one: 'ブラウザ固有のフォルダ(Opera のスピードダイヤルやゴミ箱など)にあるブックマーク {n} 件はインポートしませんでした。',
@@ -50,6 +50,16 @@ export const warnings = {
one: '読み取れない項目が {n} 件あったため、スキップしました。',
other: '読み取れない項目が {n} 件あったため、スキップしました。',
},
SEPARATORS_SKIPPED: {
one: '区切り線 {n} 本を省きました。BookmarkMagic が保持するのはブックマークとフォルダで、区切り線は保持しません。',
other:
'区切り線 {n} 本を省きました。BookmarkMagic が保持するのはブックマークとフォルダで、区切り線は保持しません。',
},
URL_TOO_LONG: {
one: 'アドレスがこのブラウザの上限(65,536 文字)を超えるブックマーク {n} 件をスキップしました。',
other:
'アドレスがこのブラウザの上限(65,536 文字)を超えるブックマーク {n} 件をスキップしました。',
},
} satisfies Dict['warnings'];
export const errors = {
+1 -1
View File
@@ -179,7 +179,7 @@ export default {
issues: '問題を報告',
changelog: 'リリースと変更履歴',
accessibility: 'アクセシビリティ',
store: 'Chrome ウェブストアのページ',
store: 'ストアのページ',
thirdParty: 'サードパーティのコード',
thirdPartyNote:
'実行時の依存関係はインストールされません。MIT ライセンスの小さなコード(Svelte のランタイムとその clsx ヘルパー、WXT の 1 行のブラウザ互換層)が拡張機能に組み込まれています。パッケージ内の THIRD_PARTY_NOTICES.txt をご覧ください。',
+8 -2
View File
@@ -42,7 +42,13 @@ export const importTab = {
replaceConfirmBody:
'Vor fi șterse din acest browser: {current}, după salvarea unei copii de rezervă de siguranță. Apoi se scrie conținutul din {name}: {incoming}.',
replaceConfirm: 'Salvați copia și înlocuiți',
target: { bar: 'bară', unfiled: 'Alte marcaje', mobile: 'Mobile' },
replaceSeparators: {
one: 'Va fi ștearsă și {n} linie de separare, care nu mai poate fi restaurată — copia de rezervă, ca orice fișier scris de BookmarkMagic, nu poate păstra separatoare.',
few: 'Vor fi șterse și {n} linii de separare, care nu mai pot fi restaurate — copia de rezervă, ca orice fișier scris de BookmarkMagic, nu poate păstra separatoare.',
other:
'Vor fi șterse și {n} de linii de separare, care nu mai pot fi restaurate — copia de rezervă, ca orice fișier scris de BookmarkMagic, nu poate păstra separatoare.',
},
target: { bar: 'bară', unfiled: 'Alte marcaje', mobile: 'Mobile', menu: 'Meniul de marcaje' },
targetNote:
'La îmbinare și la înlocuire, conținutul acestui dosar ajunge direct în dosarul respectiv al browserului, nu într-o copie a lui.',
reused: {
@@ -65,7 +71,7 @@ export const importTab = {
cancelledAfterClear:
'Ați anulat după ce marcajele existente fuseseră deja șterse, așa că a rămas doar partea care a fost refăcută.',
dateNotice:
'Marcajele importate poartă data de azi. Chrome nu permite unei extensii să seteze data originală a unui marcaj — fișierele exportate păstrează datele reale.',
'Marcajele importate poartă data de azi. Browserul nu permite unei extensii să seteze data originală a unui marcaj — fișierele exportate păstrează datele reale.',
partialCreated: {
one: '{n} element fusese deja creat înainte de eroare și a rămas pe loc.',
few: '{n} elemente fuseseră deja create înainte de eroare și au rămas pe loc.',
+15 -4
View File
@@ -49,10 +49,9 @@ export const warnings = {
other: '{n} de intrări au adrese pe care browserul nu le poate stoca, așa că au fost omise.',
},
PLACE_QUERIES_SKIPPED: {
one: '{n} marcaj inteligent Firefox (o căutare salvată, nu o pagină web) a fost omis — aici ar fi un link nefuncțional.',
few: '{n} marcaje inteligente Firefox (căutări salvate, nu pagini web) au fost omise — aici ar fi linkuri nefuncționale.',
other:
'{n} de marcaje inteligente Firefox (căutări salvate, nu pagini web) au fost omise — aici ar fi linkuri nefuncționale.',
one: '{n} marcaj inteligent Firefox (o căutare salvată, nu o pagină web) a fost omis.',
few: '{n} marcaje inteligente Firefox (căutări salvate, nu pagini web) au fost omise.',
other: '{n} de marcaje inteligente Firefox (căutări salvate, nu pagini web) au fost omise.',
},
EXTRA_ROOTS_SKIPPED: {
one: '{n} marcaj dintr-un dosar specific unui browser (cum ar fi Speed Dial sau Coșul de gunoi din Opera) nu a fost importat.',
@@ -65,6 +64,18 @@ export const warnings = {
few: '{n} intrări din acest fișier nu au putut fi citite și au fost omise.',
other: '{n} de intrări din acest fișier nu au putut fi citite și au fost omise.',
},
SEPARATORS_SKIPPED: {
one: '{n} linie de separare a fost omisă — BookmarkMagic păstrează marcaje și dosare, nu separatoare.',
few: '{n} linii de separare au fost omise — BookmarkMagic păstrează marcaje și dosare, nu separatoare.',
other:
'{n} de linii de separare au fost omise — BookmarkMagic păstrează marcaje și dosare, nu separatoare.',
},
URL_TOO_LONG: {
one: '{n} marcaj a fost omis: adresa lui depășește cele 65.536 de caractere acceptate de acest browser.',
few: '{n} marcaje au fost omise: adresele lor depășesc cele 65.536 de caractere acceptate de acest browser.',
other:
'{n} de marcaje au fost omise: adresele lor depășesc cele 65.536 de caractere acceptate de acest browser.',
},
} satisfies Dict['warnings'];
export const errors = {
+1 -1
View File
@@ -210,7 +210,7 @@ export default {
issues: 'Raportați o problemă',
changelog: 'Versiuni și jurnalul modificărilor',
accessibility: 'Accesibilitate',
store: 'Pagina din Magazinul Chrome Web',
store: 'Pagina din magazin',
thirdParty: 'Cod terț',
thirdPartyNote:
'Nu este instalată nicio dependență de rulare. Câteva componente mici cu licență MIT sunt compilate în extensie: runtime-ul Svelte cu utilitarul său clsx și adaptorul de browser de o linie al WXT — consultați THIRD_PARTY_NOTICES.txt din pachet.',
+7 -2
View File
@@ -37,7 +37,12 @@ export const importTab = {
replaceConfirmBody:
'{current} trong trình duyệt này sẽ bị xóa, sau khi bản sao lưu an toàn được lưu. Sau đó {incoming} từ {name} sẽ được ghi vào.',
replaceConfirm: 'Sao lưu rồi thay thế',
target: { bar: 'thanh dấu trang', unfiled: 'Khác', mobile: 'Di động' },
replaceSeparators: {
one: '{n} đường phân cách cũng sẽ bị xóa và không thể khôi phục — bản sao lưu, như mọi tệp BookmarkMagic ghi ra, không lưu được đường phân cách.',
other:
'{n} đường phân cách cũng sẽ bị xóa và không thể khôi phục — bản sao lưu, như mọi tệp BookmarkMagic ghi ra, không lưu được đường phân cách.',
},
target: { bar: 'thanh dấu trang', unfiled: 'Khác', mobile: 'Di động', menu: 'Menu dấu trang' },
targetNote:
'Ở chế độ Gộp và Thay thế, nội dung thư mục này được đưa thẳng vào thư mục tương ứng của trình duyệt, không tạo bản sao của nó.',
reused: {
@@ -56,7 +61,7 @@ export const importTab = {
cancelledAfterClear:
'Bạn đã hủy sau khi bookmark cũ đã bị xóa, nên những gì còn lại chỉ là phần đã được tạo lại.',
dateNotice:
'Bookmark được nhập vào sẽ mang ngày hôm nay. Chrome không cho phép tiện ích đặt lại ngày tạo gốc của bookmark — các tệp bạn xuất ra vẫn giữ ngày thật.',
'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 bookmark — các tệp bạn xuất ra vẫn giữ ngày thật.',
partialCreated: {
one: '{n} mục đã được tạo trước khi lỗi xảy ra và vẫn được giữ lại.',
other: '{n} mục đã được tạo trước khi lỗi xảy ra và vẫn được giữ lại.',
+11 -3
View File
@@ -36,9 +36,8 @@ export const warnings = {
other: '{n} mục có địa chỉ mà trình duyệt không lưu được nên đã bị bỏ qua.',
},
PLACE_QUERIES_SKIPPED: {
one: 'Đã bỏ qua {n} bookmark thông minh của Firefox (một truy vấn đã lưu, không phải trang web) — ở đây nó sẽ là liên kết hỏng.',
other:
'Đã bỏ qua {n} bookmark thông minh của Firefox (truy vấn đã lưu, không phải trang web) — ở đây chúng sẽ là liên kết hỏng.',
one: 'Đã bỏ qua {n} bookmark thông minh của Firefox (một truy vấn đã lưu, không phải trang web).',
other: 'Đã bỏ qua {n} bookmark thông minh của Firefox (truy vấn đã lưu, không phải trang web).',
},
EXTRA_ROOTS_SKIPPED: {
one: '{n} bookmark nằm trong thư mục riêng của trình duyệt (như Speed Dial hay Thùng rác của Opera) nên không được nhập.',
@@ -49,6 +48,15 @@ export const warnings = {
one: '{n} mục trong tệp không đọc được và đã bị bỏ qua.',
other: '{n} mục trong tệp không đọc được và đã bị bỏ qua.',
},
SEPARATORS_SKIPPED: {
one: 'Đã bỏ qua {n} đường phân cách — BookmarkMagic giữ bookmark và thư mục, không giữ đường phân cách.',
other:
'Đã bỏ qua {n} đường phân cách — BookmarkMagic giữ bookmark và thư mục, không giữ đường phân cách.',
},
URL_TOO_LONG: {
one: 'Đã bỏ qua {n} bookmark: địa chỉ dài hơn 65.536 ký tự mà trình duyệt này chấp nhận.',
other: 'Đã bỏ qua {n} bookmark: địa chỉ dài hơn 65.536 ký tự mà trình duyệt này chấp nhận.',
},
} satisfies Dict['warnings'];
export const errors = {
+1 -1
View File
@@ -177,7 +177,7 @@ export default {
issues: 'Báo lỗi',
changelog: 'Bản phát hành và nhật ký thay đổi',
accessibility: 'Hỗ trợ tiếp cận',
store: 'Trang trên Chrome Web Store',
store: 'Trang trên cửa hàng',
thirdParty: 'Mã của bên thứ ba',
thirdPartyNote:
'Không cài thêm thư viện nào khi chạy. Vài phần mã nhỏ theo giấy phép MIT được biên dịch vào tiện ích: bộ chạy của Svelte cùng hàm trợ giúp clsx của nó, và lớp tương thích trình duyệt một dòng của WXT — xem THIRD_PARTY_NOTICES.txt trong gói.',
+7 -2
View File
@@ -36,7 +36,12 @@ export const importTab = {
replaceConfirmBody:
'保存安全备份后,将删除此浏览器中的 {current}。然后写入 {name} 中的 {incoming}。',
replaceConfirm: '备份并替换',
target: { bar: '书签栏', unfiled: '其他书签', mobile: '移动设备书签' },
replaceSeparators: {
one: '还会删除 {n} 条分隔线,且无法恢复——备份与 BookmarkMagic 写出的其他文件一样,无法保存分隔线。',
other:
'还会删除 {n} 条分隔线,且无法恢复——备份与 BookmarkMagic 写出的其他文件一样,无法保存分隔线。',
},
target: { bar: '书签栏', unfiled: '其他书签', mobile: '移动设备书签', menu: '书签菜单' },
targetNote:
'在合并和替换模式下,此文件夹中的内容会直接放入对应的浏览器文件夹,而不是创建它的副本。',
reused: {
@@ -55,7 +60,7 @@ export const importTab = {
},
cancelledAfterClear: '您是在现有书签已被删除之后取消的,因此剩下的只有已重建的部分。',
dateNotice:
'导入的书签日期均为今天。Chrome 不允许扩展程序设置书签的原始日期——您导出的文件会保留真实日期。',
'导入的书签日期均为今天。浏览器不允许扩展程序设置书签的原始日期——您导出的文件会保留真实日期。',
partialCreated: {
one: '操作失败前已创建 {n} 项,这些项保持原样。',
other: '操作失败前已创建 {n} 项,这些项保持原样。',
+10 -2
View File
@@ -36,8 +36,8 @@ export const warnings = {
other: '{n} 个条目的地址无法存入浏览器,因此已跳过。',
},
PLACE_QUERIES_SKIPPED: {
one: '已跳过 {n} 个 Firefox 智能书签(已保存的搜索,而非网页)——在这里它会成为失效链接。',
other: '已跳过 {n} 个 Firefox 智能书签(已保存的搜索,而非网页)——在这里它们会成为失效链接。',
one: '已跳过 {n} 个 Firefox 智能书签(已保存的搜索,而非网页)。',
other: '已跳过 {n} 个 Firefox 智能书签(已保存的搜索,而非网页)。',
},
EXTRA_ROOTS_SKIPPED: {
one: '浏览器专用文件夹(例如 Opera 的快速拨号或回收站)中的 {n} 个书签未导入。',
@@ -47,6 +47,14 @@ export const warnings = {
one: '此文件中有 {n} 个条目无法读取,已跳过。',
other: '此文件中有 {n} 个条目无法读取,已跳过。',
},
SEPARATORS_SKIPPED: {
one: '已略去 {n} 条分隔线——BookmarkMagic 保存书签和文件夹,不保存分隔线。',
other: '已略去 {n} 条分隔线——BookmarkMagic 保存书签和文件夹,不保存分隔线。',
},
URL_TOO_LONG: {
one: '已跳过 {n} 个书签:其地址超过了此浏览器接受的 65,536 个字符。',
other: '已跳过 {n} 个书签:其地址超过了此浏览器接受的 65,536 个字符。',
},
} satisfies Dict['warnings'];
export const errors = {
+1 -1
View File
@@ -175,7 +175,7 @@ export default {
issues: '报告问题',
changelog: '版本发布与更新日志',
accessibility: '无障碍',
store: 'Chrome 网上应用店页面',
store: '商店页面',
thirdParty: '第三方代码',
thirdPartyNote:
'未安装任何运行时依赖项。扩展程序中编译了几个采用 MIT 许可的小组件:Svelte 运行时及其 clsx 辅助函数,以及 WXT 的一行浏览器适配代码——详见软件包中的 THIRD_PARTY_NOTICES.txt。',
+29 -17
View File
@@ -11,14 +11,7 @@
* is written, downloaded or deleted.
*/
import { getGeneratorVersion } from '../browser/app-info';
import {
type BookmarkRoots,
clearRoots,
getRoots,
type LiveNode,
rootMarkersOf,
toBookmarkNodes,
} from '../browser/bookmarks';
import { clearRoots, type LiveNode, MAX_URL_LENGTH } from '../browser/bookmarks';
import { record } from '../browser/diagnostics';
import {
discardTarget,
@@ -30,17 +23,19 @@ import {
writeToTarget,
} from '../browser/download';
import { BmAborted, BmBackupError } from '../browser/errors';
import { countLive, toBookmarkNodes, withoutSeparators } from '../browser/live-tree';
import { type BookmarkRoots, getRoots, rootMarkersOf } from '../browser/roots';
import type { ImportMode } from '../browser/storage';
import { withWriteLock } from '../browser/write-lock';
import { type WriteProgress, writeTree } from '../browser/write-queue';
import { textCapsBreach, treeCapsBreach } from '../core/caps';
import { buildUrlIndex } from '../core/dedupe';
import { diffAgainstBrowser, type NodeStatus } from '../core/diff';
import { capUrlLength } from '../core/href';
import { MAX_FILE_BYTES, MAX_WRITE_DEPTH } from '../core/limits';
import {
BmParseError,
type BookmarkNode,
computeStats,
type FileFormat,
type ImportPlan,
type MergeMode,
@@ -63,8 +58,12 @@ export interface PreparedImport {
browserIndex: Set<string>;
/** The live roots at preview time — what the Start button's preview plan is built against. */
destinations: PlanDestinations;
/** Everything inside the writable roots: what Replace would delete (docs/09 T4). */
current: { bookmarks: number; folders: number };
/**
* Everything inside the roots Replace empties — exactly what it would
* delete (docs/09 T4); a signed-in Chrome's account roots are not among them. Separators (Firefox) are counted apart — never as bookmarks — so the
* confirmation can say they will not come back (docs/03 §1).
*/
current: { bookmarks: number; folders: number; separators: number };
}
export interface PrepareOptions {
@@ -90,7 +89,11 @@ export async function prepareImport(
// Blob.text() is UTF-8 decode, which consumes a leading BOM for us.
const text = await file.text();
const { format, result } = parseBookmarkFile(text, options);
const parsed = parseBookmarkFile(text, options);
const { format } = parsed;
// What this browser would refuse for its length goes before the preview, so
// the counts the user confirms already leave it out (docs/04 §1.2).
const result = capUrlLength(parsed.result, MAX_URL_LENGTH);
record({
kind: 'import',
phase: 'parsed',
@@ -101,9 +104,9 @@ export async function prepareImport(
// One read: getRoots walks the whole tree, so the index and the counts come
// from the same snapshot instead of a second getTree().
const roots = await getRoots();
const browserIndex = buildUrlIndex(roots.all);
const browserIndex = buildUrlIndex(withoutSeparators(roots.all));
const { existsCount, status } = diffAgainstBrowser(result.roots, browserIndex);
const inside = computeStats(roots.writable.flatMap((root) => root.children ?? []));
const inside = countLive(roots.replaceable.flatMap((root) => root.children ?? []));
return {
format,
@@ -112,7 +115,11 @@ export async function prepareImport(
status,
browserIndex,
destinations: destinationsOf(roots),
current: { bookmarks: inside.bookmarks, folders: inside.folders },
current: {
bookmarks: inside.bookmarks,
folders: inside.folders,
separators: inside.separators,
},
};
}
@@ -169,6 +176,7 @@ function destinationsOf(roots: BookmarkRoots): PlanDestinations {
toolbar: roots.toolbar,
other: roots.other,
...(roots.mobile !== undefined && { mobile: roots.mobile }),
...(roots.menu !== undefined && { menu: roots.menu }),
};
}
@@ -233,7 +241,8 @@ async function writeAll(
mode,
dedupe,
// Fresh, not the preview's: anything bookmarked since must not be added twice.
browserIndex: dedupe && mode !== 'replace' ? buildUrlIndex(roots.all) : new Set(),
browserIndex:
dedupe && mode !== 'replace' ? buildUrlIndex(withoutSeparators(roots.all)) : new Set(),
destinations: destinationsOf(roots),
newFolderTitle,
});
@@ -244,7 +253,7 @@ async function writeAll(
if (plan.stats.writeDepth > MAX_WRITE_DEPTH) {
throw new BmParseError(
'TOO_DEEP',
`the import would nest folders ${plan.stats.writeDepth} deep; Chrome stores at most ${MAX_WRITE_DEPTH}`,
`the import would nest folders ${plan.stats.writeDepth} deep; at most ${MAX_WRITE_DEPTH} are written, in every browser (Chrome's own storage limit)`,
);
}
@@ -282,6 +291,9 @@ async function backUpThenFreeze(
backup: BackupState,
first: BookmarkRoots,
): Promise<LiveNode[]> {
// Separators are not in the snapshot (no format holds one), so a change
// that only moves or adds separators is not seen here; Replace deletes them
// and says so before it starts (docs/03 §1).
const snapshotOf = (roots: BookmarkRoots) =>
toBookmarkNodes(roots.replaceable, rootMarkersOf(roots));
let roots = first;
+42 -4
View File
@@ -27,11 +27,47 @@ export const CHANGELOG_URL = `${REPO_URL}/blob/main/CHANGELOG.md`;
*/
export const ACCESSIBILITY_URL = `${REPO_URL}/blob/main/ACCESSIBILITY.md`;
/** The Chrome Web Store item id (docs/00 §9) — also the CHROME_EXTENSION_ID secret. */
const CWS_ITEM_ID = 'eghnciphhegekmnofffpgbdfefckdhmg';
/** The published Chrome Web Store listing. */
const CWS_URL = `https://chromewebstore.google.com/detail/bookmarkmagic/${CWS_ITEM_ID}`;
/**
* The published Chrome Web Store listing (item id — docs/00 §9).
* 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
* source then holds nothing that reads as an email address (see below).
*/
const AMO_URL = 'https://addons.mozilla.org/firefox/addon/bookmarkmagic%40poli0981.dev/';
/** Every store, listed: the README's install section. */
const INSTALL_URL = `${REPO_URL}#install`;
/**
* The listing this copy was installed from — docs/06 §3.5.
*
* The only route from inside the product to rating or reviewing it, which
* docs/13 §6 lists as a post-launch channel.
* 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: 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
@@ -40,8 +76,10 @@ export const ACCESSIBILITY_URL = `${REPO_URL}/blob/main/ACCESSIBILITY.md`;
* SECURITY.md, CONTRIBUTING.md and the privacy policy, where it arrives with
* the instruction to sanitize first (docs/15 decision log, 2026-08-03).
*/
export const STORE_URL =
'https://chromewebstore.google.com/detail/bookmarkmagic/eghnciphhegekmnofffpgbdfefckdhmg';
export function storeUrlFor(install: { firefox: boolean; extensionId: string }): string {
if (install.firefox) return AMO_URL;
return CHROMIUM_LISTINGS.get(install.extensionId) ?? INSTALL_URL;
}
export interface LabelledLink {
labelKey: string;
+15 -4
View File
@@ -15,6 +15,7 @@ import {
getChildren,
getRootChildren,
type LiveNode,
type MoveDestination,
move,
remove,
removeTree,
@@ -41,7 +42,8 @@ export interface EditApi {
getChildren: (id: string) => Promise<LiveNode[]>;
create: (details: { parentId: string; title: string }) => Promise<LiveNode>;
update: (id: string, changes: { title?: string }) => Promise<void>;
move: (id: string, destination: { parentId?: string; index?: number }) => Promise<void>;
/** Resolves to the index the browser reports the node now has (`browser/bookmarks.ts`). */
move: (id: string, destination: MoveDestination) => Promise<number | undefined>;
remove: (id: string) => Promise<void>;
removeTree: (id: string) => Promise<void>;
}
@@ -229,13 +231,22 @@ export class EditCommands extends EditView {
if (node === undefined || !this.isEditable(node)) return false;
if (!canMoveInto(this.roots, id, plan.parentId)) return false;
const { parentId, position } = plan;
return this.guard(async () => {
let landed: number | undefined;
const moved = await this.guard(async () => {
this.roots = moveNode(this.roots, id, parentId, position?.local);
await this.api.move(
landed = await this.api.move(
id,
position === undefined ? { parentId } : { parentId, index: position.api },
position === undefined ? { parentId } : { parentId, position },
);
});
// The browser says where the node really went. If that is not where the
// tree put it, the two disagree — re-read rather than show a wrong order
// (docs/03 §3). The adapter already sends each browser its own index, so
// this only fires if a browser changes its rule.
if (moved && position !== undefined && landed !== undefined && landed !== position.local) {
await this.load();
}
return moved;
};
/**
+15 -3
View File
@@ -51,9 +51,14 @@ export class EditSession extends EditCommands {
: [],
);
/** Any folder with two or more children that is not policy-managed, roots included. */
/**
* Any folder with two or more items that is not policy-managed, roots
* included. Separators (Firefox) are not items: they never move in a sort.
*/
canSort = (node: EditNode): boolean =>
node.url === undefined && node.unmodifiable === undefined && (node.children?.length ?? 0) > 1;
node.url === undefined &&
node.unmodifiable === undefined &&
(node.children ?? []).filter((child) => child.separator !== true).length > 1;
keepFirst = async (): Promise<void> => {
this.pendingKeepFirst = false;
@@ -96,7 +101,14 @@ export class EditSession extends EditCommands {
record({ kind: 'edit', action: 'sort', count: moves.length });
const outcome = await applySort(
moves,
(step) => this.api.move(step.id, { parentId: folder.id, index: step.index }),
// Every sort move goes LEFT, where both browsers' index rules agree
// (docs/05 §10): the same number serves as both.
async (step) => {
await this.api.move(step.id, {
parentId: folder.id,
position: { api: step.index, local: step.index },
});
},
(step) => {
this.roots = moveNode(this.roots, step.id, folder.id, step.index);
},
+6 -2
View File
@@ -171,8 +171,12 @@ export class EditView {
if (index === -1) return undefined;
// Skip the node's own descendants, which disappear with it.
const depth = this.rows[index]?.depth ?? 0;
const after = this.rows.slice(index + 1).find((row) => row.depth <= depth);
return after?.node.id ?? this.rows[index - 1]?.node.id;
// Separators (Firefox) take no focus, so they are never the neighbour.
const after = this.rows
.slice(index + 1)
.find((row) => row.depth <= depth && row.node.separator !== true);
const before = this.rows.slice(0, index).findLast((row) => row.node.separator !== true);
return after?.node.id ?? before?.node.id;
};
dispose = (): void => {
+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.
+78
View File
@@ -56,3 +56,81 @@ https://github.com/poli0981/bookmarkmagic
`https://github.com/poli0981/bookmarkmagic/blob/main/legal/PRIVACY.md`
**Distribution:** Public, all regions.
## Firefox Add-ons (since v1.3.0)
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
from the profile folder of a Chromium browser (Chrome, Edge, Brave…) and
Firefox JSON backups — with a full preview before anything is written:
counts, folders and duplicates first.
```
```
• 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.
```
On Firefox Add-ons only, add to LIMITATIONS:
```
• Firefox separators are not kept: exports and backups leave them out, and
Replace deletes them (it tells you first).
```
**Firefox Add-ons:** summary = the summary above (AMO allows 250 characters) ·
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.
+79
View File
@@ -60,3 +60,82 @@ https://github.com/poli0981/bookmarkmagic
法的文書は英語のみです(`docs/14`)。プライバシーポリシーの URL は EN 版と
同じものを使います。
## Firefox Add-ons(v1.3.0 以降)
上の説明文のうち、Chrome に触れている 2 項目を次のものに置き換えて使います(Firefox ではそのままでは正しくないため):
```
• ブックマークファイル(HTML、JSON、CSV)をインポートします。Chromium 系
ブラウザ(Chrome、Edge、Brave など)のプロファイルフォルダにある
「Bookmarks」ファイルや Firefox の JSON バックアップにも対応。書き込む前に
必ずプレビューを表示し、件数・フォルダ・重複を先に確認できます。
```
```
• インポートしたブックマークの日付は本日になります。拡張機能がブックマーク
の元の作成日を設定することをブラウザが許可していないためです。エクスポート
したファイルには本来の日付が残ります。
```
Firefox Add-ons のみ、「制限事項」に追加:
```
• Firefox の区切り線は保持されません。エクスポートとバックアップには含まれず、
置き換えでは削除されます(事前に表示されます)。
```
**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` が失敗します。
```
ブックマークをブラウザ間で移すいちばん簡単な方法は、ファイルを使うことです。
アカウント不要、クラウド同期なし、完全オフラインで動作します。
できること
• ブックマークファイル(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。
Loaded 100 of 126 files, more files were not shown because too many files have changed in this diff. Show more