adaptive-zoom

Firefox extension that adjusts page zoom to fit the window width

readme · slastra/adaptive-zoom

Firefox extension that adjusts page zoom to fit the window width.

Automatically adjusts Firefox's zoom level based on window width for optimal readability.

Features

  • Configurable zoom ranges and animation settings
  • Smooth transitions as you resize your window
  • Settings synced across Firefox installations
  • Native Firefox UI with light/dark mode support

Install

From source

  1. Download or clone this repository
  2. Open about:debugging#/runtime/this-firefox in Firefox
  3. Click "Load Temporary Add-on" and select manifest.json

Temporary add-ons are removed when Firefox restarts. To keep it installed, use the signed .xpi build.

Configuration

Access settings through Firefox's Add-ons Manager. Customize:

  • Zoom ranges (minimum/maximum width and zoom levels)
  • Animation speed and smoothness
  • Performance tuning options

Default behavior: 1000px gives 100% zoom, 4000px gives 200% zoom.

Setting Default
Minimum Width (px) 1000 Window width for minimum zoom level
Maximum Width (px) 4000 Window width for maximum zoom level
Minimum Zoom (%) 100 Zoom level at minimum width
Maximum Zoom (%) 200 Zoom level at maximum width
Enable smooth animations on
Animation Step (%) 2 How much to change zoom per frame
Animation Interval (ms) 10 Time between animation frames
Polling Interval (ms) 100 How often to check for window size changes

How it works

A background script polls the current window's width and maps it to a zoom level by linear interpolation between your configured min/max width and min/max zoom. When the target changes, the zoom is eased toward it in small steps (unless animation is disabled). Zoom is re-applied on tab switches and page loads so it stays consistent as you move around. All settings are stored in storage.sync so they persist and sync across your Firefox installations.

License

MIT © 2025 Shaun Lastra. See LICENSE.