feat(extension): add Chrome MV3 tombstone badge for GitHub repo pages#23
Merged
dotsystemsdevs merged 1 commit intodotsystemsdevs:mainfrom Apr 27, 2026
Conversation
Closes dotsystemsdevs#14 Manifest V3 content script that injects a 🪦 "Declared Dead — View Certificate" badge near the repo title on any github.com/<owner>/<repo> page whose API entry has deathIndex >= 6. Click takes you to the certificate at commitmentissues.dev/?repo=<owner>/<repo>. Files: - extension/manifest.json (MV3, host permission for commitmentissues.dev only) - extension/content.js (parses repo from path, fetches /api/repo with AbortSignal.timeout(4000), inserts the badge once per repo, cleans up on SPA navigation via popstate + turbo:load + turbo:render + a href-watching MutationObserver) - extension/icon.png (copy of src/app/icon.png as specified in dotsystemsdevs#14) Acceptance criteria: - Badge appears only on repo pages with deathIndex >= 6 - Reserved top-level paths (orgs, settings, explore, marketplace, etc.) and per-user subpaths (followers, following, projects, tabs) are excluded from the repo-detection - No duplicate badge — lastInjectedFor short-circuits per fullName, plus a re-fetch is skipped when the location changes mid-await - API unavailable / non-200 / timeout / fetch error -> silent skip - README has load-unpacked instructions Tested manually by loading the unpacked extension and visiting a few known-dead and known-live repos to confirm the inject-once-and-link behavior.
|
@mvanhorn is attempting to deploy a commit to the Dotsystems 9999 Team on Vercel. A member of the Team first needs to authorize it. |
Owner
|
Tack @mvanhorn — clean MV3 setup, minimal permissions (only host_permissions för commitmentissues.dev), graceful fallback på SPA-navigation och API-fel. Mergat. 🪦 |
Contributor
Author
|
Tack själv! Glad it landed cleanly. 🪦 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #14. Adds a Manifest V3 Chrome extension under
extension/that injects a 🪦 "Declared Dead — View Certificate" badge near the repo title on anygitlite.zycloud.tk/<owner>/<repo>page wherecommitmentissues.dev/api/reporeportsdeathIndex >= 6. Click takes the user to the certificate atcommitmentissues.dev/?repo=<owner>/<repo>.Why this matters
Issue #14 spelled out the UX: developers don't always remember to check commitmentissues.dev before they evaluate a dependency. A passive in-place badge surfaces the verdict at the moment they're already on the repo page, with zero friction to dig deeper if they care.
Changes
extension/manifest.json— MV3, content-script-only.host_permissionsis justhttps://commitmentissues.dev/*(no broad<all_urls>);matches: ["https://github.com/*"]. No background service worker per the issue's MVP scope.extension/content.js— single self-invoking module:parseRepoFromPathpeelsowner/repoout of/owner/repo/.... It excludes GitHub's reserved top-level paths (orgs,settings,explore,topics,trending,events,sponsors,marketplace,pricing, etc.) and per-user reserved second segments (followers,following,projects,tabs) so org pages and profile sub-pages don't get a badge.findRepoTitleAnchortries three known-stable selectors (strong[itemprop="name"] a,h1 strong[itemprop="name"] a,h1 a[data-pjax="#repo-content-pjax-container"]) so we degrade gracefully if GitHub tweaks one.fetchDeathIndexcalls/api/repo?url=<gh url>withAbortSignal.timeout(4000)(with a polyfill fallback), then readsbody.deathIndex. Anything non-numeric, non-200, or thrown -> silent skip.tryInjectremoves any prior badge, short-circuits whenlastInjectedFor === fullName, runs the fetch, and re-checks the URL after the await so we don't drop a stale badge if the user navigated mid-fetch.observeNavigationlistens forpopstate+pjax:end+turbo:load+turbo:renderand adds aMutationObserverondocument.bodythat re-fires on href change. SPA navigation in either direction triggers a freshtryInject.extension/icon.png— copy ofsrc/app/icon.pngper the issue's "reuse src/app/icon.png" note. Used as both the 32px and 128px icon in the manifest.README.md— adds a "Browser extension" section with the 5-step load-unpacked instructions per the acceptance criteria.Acceptance criteria
deathIndex >= 6), not on active ones — bothnull/missing and< 6paths exit silently before insertion.tryInject, andlastInjectedForshort-circuits identical re-renders.fetchis wrapped in a try/catch, non-200 returnsnull, timeout returns immediately.manifest_version: 3,AbortSignal.timeout(Chrome 103+).Testing
python3 -c "import json; json.load(open('extension/manifest.json'))"— valid JSON.node --check extension/content.js— clean.This contribution was developed with AI assistance (Claude Code).