A Chrome / Microsoft Edge extension (MV3) that enhances the GitHub Pull Request Files changed view for Markdown files.
- Rich diff enhancement — When you switch a
.mdfile to GitHub's rich diff view, the extension overlays line numbers, comment indicators, and click-to-source navigation. - Line-level comment indicators — Lines with existing review comments show a chat-bubble icon with superscript count in the right margin, and a permanent dashed outline.
- Click-to-source — Click any element in the rich preview to jump to the corresponding line in the source diff, with automatic expansion of collapsed sections.
- Back to rich view — A header button lets you switch back from source diff to rich preview in one click. It only appears when you're in source diff mode.
- Comment bar — A summary bar at the top of each rich diff shows all commented lines with quick-jump badges.
- Toggle on/off — Click the floating status badge (with extension icon) to pause or resume the extension. Pausing fully removes all injected DOM elements.
- Source line highlighting — Selected source lines are persistently highlighted with automatic retry for lazy-loaded diffs.
- Comment activity tracking — Starting a review or adding comments reflects back in the rich diff indicators in real time.
-
Clone this repository:
git clone https://github.com/<your-username>/md-review-extension.git cd md-review-extension
-
Open your browser's extension page:
- Edge:
edge://extensions - Chrome:
chrome://extensions
- Edge:
-
Enable Developer mode.
-
Click Load unpacked and select the project directory.
-
Navigate to any GitHub PR → Files changed tab.
- Download the latest
.zipfrom Releases. - Unzip to a folder.
- Load unpacked from that folder (same steps as above).
To create a distributable .zip locally:
npm run packageThis outputs dist/markdown-rich-review-<version>.zip, ready for Chrome Web Store or Edge Add-ons upload.
A GitHub Actions workflow (.github/workflows/release.yml) automates packaging and releasing:
| Trigger | What happens |
|---|---|
Push to main |
Packages the extension and updates a rolling latest pre-release with the .zip (ci.yml) |
Push a tag v* (e.g. v2.1.0) |
Packages the extension, creates a GitHub Release with the .zip attached and auto-generated release notes (release.yml) |
Manual dispatch (workflow_dispatch) |
Packages the extension and uploads the .zip as a build artifact |
- Update the version in
manifest.jsonandpackage.json. - Commit and push:
git add -A && git commit -m "Release v2.1.0" git tag v2.1.0 git push origin main --tags
- The pipeline will automatically build and publish the release with the installable
.zip.
md-review-extension/
├── manifest.json # MV3 extension manifest
├── content-script.js # Main content script — all extension logic
├── utils/
│ └── domHelpers.js # Shared DOM utility functions
├── styles/
│ └── reviewPane.css # All extension styles
├── icons/
│ ├── icon16.png # Extension icon 16×16
│ ├── icon32.png # Extension icon 32×32
│ └── icon64.png # Extension icon 64×64
├── scripts/
│ └── package.mjs # Packaging script for distribution
├── .github/
│ └── workflows/
│ ├── ci.yml # Latest build on every push to main
│ └── release.yml # Versioned release on tag push
├── package.json
├── LICENSE
└── README.md
The extension runs as a content script on github.com/* pages. On PR Files changed pages, it:
- Detects
.mdfiles among the diff containers (via embedded payload metadata and DOM inspection). - Enhances the rich diff view when the user switches to it — adding click handlers, line numbers, and comment indicators.
- Fetches raw file content (using same-origin credentials) to build a line map for accurate source-position mapping.
- Navigates to the source diff on click, expanding collapsed sections and highlighting the target line.
No GitHub API tokens or special permissions are required. The extension uses only the browser session already authenticated with GitHub.