Click a screenshot in a pull request. Stay on the page.
A fast, keyboard-friendly image viewer for GitHub PRs, issues, comments and READMEs.
GitHub opens every image in a new tab. Reviewing a pull request with twenty screenshots means twenty tabs, and losing your place in the conversation each time. This extension opens images in a viewer on top of the page instead, with everything you'd expect from a photo viewer.
- Browse the whole page. Every image in the PR or issue, in page order, with a thumbnail strip, arrow keys, buttons, and swipe or two-finger trackpad gestures. When a README thumbnail links to a full-size file, the viewer shows the full-size one.
- Zoom where you click. Click a spot to zoom into it, scroll or pinch for fine control, drag to pan. Text in screenshots stays sharp at any zoom level.
- Know what you're looking at. Captions come from the table heading above the screenshot (the usual
Before | Afterlayout), a label row, or alt text. The comment author and the image's real pixel size are shown alongside. - Copy and save. Copy the image to the clipboard as PNG, copy its link, or download it at full size with the right file extension. Download all saves every image into a folder named after the PR, numbered and named after their captions.
- Feels native. The image grows out of its thumbnail and shrinks back into it on close. ⌘ shortcuts on macOS, Ctrl on Windows and Linux. ⌘/Ctrl-click still opens an image in a new tab.
- Stays out of the way. Badges, emoji, avatars, images inside collapsed
<details>, and images that link somewhere else (like a CI badge) are left alone.
![]() |
![]() |
![]() |
| Gallery with thumbnails | Click to zoom | Press ? for shortcuts |
The extension isn't on the Chrome Web Store yet, so install it from source:
- Download this repository as a ZIP and unzip it, or
git cloneit. - Open
chrome://extensionsand turn on Developer mode (top right). - Click Load unpacked and choose the
extensionfolder. - Reload any GitHub tabs you already had open.
Other Chromium browsers (Edge, Brave, Arc) can load it the same way. Tested in Chrome.
| Action | macOS | Windows / Linux |
|---|---|---|
| Previous / next image | ← → | ← → |
| First / last image | ⌘← ⌘→ | Home End |
| Zoom in / out | + − or ⌘+ ⌘− | + − or Ctrl+ Ctrl− |
| Fit to screen / actual size | 0 / 1 | 0 / 1 |
| Zoom at a point | Click or double-click the image | Click or double-click the image |
| Rotate | R, ⇧R | R, ShiftR |
| Copy image | C or ⌘C | C or CtrlC |
| Copy image link | L | L |
| Download image | D or ⌘S | D or CtrlS |
| Download all images | ⇧D | ShiftD |
| Open original in new tab | O | O |
| Fullscreen | F | F |
| Shortcut help | ? | ? |
| Close | Esc or click the background | Esc or click the background |
flowchart TB
click["Click on an image in .markdown-body"] --> content["content.js collects the gallery, captions and authors"]
content --> viewer["Viewer UI (shadow DOM)"]
viewer -- "download / copy" --> worker["background.js service worker"]
worker -- "chrome.downloads" --> disk[("Downloads/GitHub images/…")]
worker -- "fetch" --> hosts["GitHub image hosts"]
The whole extension is two plain JavaScript files with no build step and no dependencies. A few details that make it work well on GitHub:
- It never fights GitHub's own handlers. A capture-phase listener on
windowsees the click before GitHub does. Modifier clicks and middle clicks pass straight through. - It survives navigation. GitHub swaps
<body>when you move between pages, so the viewer is attached to<html>and closes itself on navigation. - It's isolated. The UI lives in a shadow root, so GitHub's CSS can't affect it and its CSS can't leak into GitHub.
- Zoomed images stay sharp. The viewer resizes the
<img>itself instead of scaling it withtransform: scale(), so the browser redraws it at the real size. - Downloads work for private repos.
chrome.downloadssends your GitHub session cookies, so private attachments download like public ones. GitHub's attachment URLs have no file extension, so the worker picks the final filename inonDeterminingFilename, once Chrome knows the file type. - Copying works despite CORS. GitHub's image hosts don't allow cross-origin reads from a page, so the service worker fetches the bytes. The page converts them to PNG with
OffscreenCanvasand writes them to the clipboard.
Everything happens in your browser, and the first time you click an image the viewer explains what it reads and asks you to agree. The developer receives no data, and there are no analytics, tracking or remote code. The only requests the extension makes are for the images themselves: the ones already on the page, the full-size file when a thumbnail links to one on GitHub, and the image's file when you copy or download it. The full privacy policy has the details.
| Permission | Why |
|---|---|
downloads |
Save images with sensible names and folders |
storage |
Remember that you agreed to the one-time privacy notice |
github.com |
Run the viewer on GitHub pages, and fetch GitHub-hosted images for Copy image |
raw, camo, private-user-images, user-images, media, gist .githubusercontent.com |
Fetch image bytes from GitHub's image servers for Copy image |
npm install
npm run setup # downloads Playwright's Chromium
npm test # end-to-end + download naming tests (headless)
npm run test:live # visible Chrome against a real public GitHub issue
npm run demo # re-records docs/demo.gif and the screenshots (needs ffmpeg)
npm run package # zips extension/ for the Chrome Web Store
npm run store-assets # renders the store's promo images into store/The tests load the real extension into Chromium and drive it with mouse and keyboard input:
tests/e2e.mjsserves copies of GitHub's PR and README markup atgithub.comand checks 64 behaviours, from captions and zoom anchoring to keyboard focus, clipboard contents and download requests.tests/downloads.mjslaunches Chromium without automation owning downloads, to check the files really land on disk with the right names and extensions.tests/live.mjsruns the same kind of checks on a real GitHub issue.
extension/ the extension (load this folder in chrome://extensions)
manifest.json
src/content.js gallery detection and the viewer
src/background.js downloads and image fetches
tests/ Playwright end-to-end tests and fixtures
scripts/ icon renderer, PNG encoder, demo recorder
docs/ README media
If you'd rather use a userscript, GitHub Image Lightbox and GitHub Ultimate Lightbox Gallery on Greasy Fork do something similar through Tampermonkey or Violentmonkey.
MIT © Ayush Kaithwas
Image Viewer for GitHub is an independent project, not affiliated with or endorsed by GitHub, Inc.



