Sitelet https://github.com/misswell/ImageViewer
Skip to content

Repository files navigation

Image Viewer

A lightweight Chrome extension that replaces the browser's plain image view with a full overlay viewer — zoom, pan, rotate, flip and pixelate, all in a dark, distraction-free frame. Built as clean, readable vanilla JS (Manifest V3).

Features

  • Image page viewer — navigating directly to an image file (.jpg, .png, .gif, .webp, .svg, …) replaces the browser's plain image view with a full overlay viewer.
  • Full control set in the overlay:
    • Single click = zoom into the point you clicked (1:1) · click again = back to fit
    • Scroll = zoom (Zoom mode) / scroll vertically (Chrome-default mode)
    • Left/middle drag = pan (a drag never triggers the click zoom)
    • E / Q rotate 90° · H / V flip · P pixelate · T checkered bg
    • + / − zoom, Shift++/− rotate 5° · arrow keys move the view
    • Esc (remappable) closes the overlay
  • Options page — background color / blurred-image background, start zoom, image position, click-to-zoom behavior (single click vs. the legacy double click), keep-inside-viewport, smooth animations, close-on-background-click, control scheme, explicit scroll/zoom/rotate direction selectors, remappable shortcuts, and context-menu toggles.
  • Context menu — "View image in current tab" and "Open image in current tab" when right-clicking an image.
  • Internationalization — the UI follows the browser language. Bundled locales: English (en) and Simplified Chinese (zh_CN); add more by dropping a _locales/<code>/messages.json.

Files

├── manifest.json        MV3 manifest (storage + contextMenus permissions only)
├── background.js        Service worker: context menus, menu sync
├── content.js           Image page overlay viewer (single file)
├── options.html         Settings page markup (localized)
├── options.css          Settings page styles
├── options.js           Settings page logic
├── fonts/               Display font (Space Grotesk)
├── _locales/en/         English strings (default locale)
├── _locales/zh_CN/      Simplified Chinese strings
├── tests/               Node smoke/functional tests for the viewer
└── icons/               Extension icons (16–128 px)

Install

  1. Open chrome://extensions
  2. Enable Developer mode (top right)
  3. Click Load unpacked
  4. Select the image-viewer folder

Controls (defaults)

Action Default
Zoom (Zoom mode) Mousewheel — wheel up zooms in
Scroll vertically (Zoom mode) Ctrl + Mousewheel
Rotate Shift + Mousewheel, E / Q
Scroll horizontally Alt + Mousewheel
Pan Left / middle drag
Zoom into the clicked point / return to fit Single click on the image
Flip horizontally / vertically H / V
Pixelate / checkered background P / T
Move view Arrow keys
Close overlay Esc (remappable)

All shortcuts, scroll directions and the control scheme are configurable in the settings page.

How zoom works

The viewer keeps one of three view modes, and the cursor always tells you what a click will do:

Mode Reached by Click on the image Cursor
fit opening, or clicking a zoomed image zoom to 1:1 here zoom-in
actual clicking a fitted image return to fit zoom-out
custom wheel zoom, or panning a zoomed image return to fit zoom-out

Clicking zooms around the pixel under the pointer, so the part you clicked on stays under the cursor; a second click fits the whole image back into the window. An image that already fits at 1:1 has nothing to zoom into and stays put. Dragging is always a pan — the click the browser fires when you release is never mistaken for a zoom, so you never snap back by accident. Prefer the old two-click gesture? Set Click to zoom to Double click in the settings.


👨‍💻 作者的其他开源项目

MacPilot —— 开源 macOS 菜单栏效率工具箱(Swift 原生 · 零第三方依赖):应用自动退出规则、BLE 靠近解锁、窗口切换器、剪贴板历史、平滑滚动、画中画、录屏、截图贴图等 11 合 1,Apple 公证签名,免费下载。觉得有用欢迎点个 Star ⭐

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages