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:
    • Scroll = zoom (Zoom mode) / scroll vertically (Chrome-default mode)
    • Left/middle drag = pan · double-click = toggle fit / actual size
    • 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, 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
Toggle fit / actual size Double click on image (single click does nothing)
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.


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

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