How Firefox Remembers Custom Zoom Levels Per Domain

This article explains the underlying mechanism the Mozilla Firefox web browser uses to remember custom zoom levels for individual websites across browsing sessions. By utilizing a dedicated local SQLite database within the user's profile folder, Firefox maps specific domain names to user-defined zoom preferences. We will explore the exact file responsible for this feature, how the browser processes and retrieves this data in real-time, the configuration settings that control it, and how privacy modes affect this behavior.

The Storage File: content-prefs.sqlite

Firefox stores all user-specific data—such as bookmarks, passwords, and settings—inside a local directory known as the User Profile folder. Within this folder lies a specific relational database file named content-prefs.sqlite.

When you adjust the zoom level on a webpage (using Ctrl + +/- or the menu controls), Firefox writes this change directly to content-prefs.sqlite. The database contains three primary components to make this work:

  1. Groups: This table stores the domain name of the website (e.g., wikipedia.org).
  2. Settings: This table defines the type of preference being saved. For zooming, Firefox uses the internal identifier browser.content.full-zoom.
  3. Prefs: This table links the specific domain ID to the setting ID and records the numerical zoom value (for example, 1.2 for 120% zoom, or 0.8 for 80% zoom).

Because this data is written to a persistent file on your hard drive, it remains intact when you close the browser or restart your computer.

Domain Extraction and Grouping

Firefox does not save zoom levels on a per-page basis; doing so would bloat the database and create a jarring user experience as you click through links on the same website. Instead, it uses a component called the Content Preference Service to parse the URL.

When you change the zoom level on https://www.example.com/news/article-1.html, Firefox strips away the protocol (https://), the path (/news/article-1.html), and often the subdomain, isolating the base hostname (example.com). It then binds the zoom preference to that hostname. Any subsequent pages you visit under that same domain will automatically inherit the saved zoom level.

How Firefox Retrieves the Zoom Level

When you start a new browsing session and navigate to a website, Firefox executes a quick sequence of actions before displaying the page:

  1. The browser extracts the domain name from the URL you are requesting.
  2. It queries the content-prefs.sqlite database to see if an entry for browser.content.full-zoom exists for that specific domain.
  3. If a match is found, Firefox retrieves the stored numerical value and instructs the rendering engine (Gecko) to scale the webpage layout accordingly before painting it to the screen.
  4. If no match is found, Firefox applies the browser's global default zoom level (usually 100%).

If you reset the zoom level back to the default 100% on a site with a saved preference, Firefox deletes that domain's entry from the database rather than storing a value of 1.0, keeping the database size minimal.

Controlling the Feature via about:config

Firefox allows users to modify how this system works through its advanced configuration page (about:config). Two primary preferences govern per-domain zoom memory:

  • browser.zoom.siteSpecific: By default, this boolean value is set to true. It is the master switch that tells Firefox to use the content-prefs.sqlite database for zooming. If you change this to false, Firefox stops saving zoom levels per domain. Instead, zoom changes will only apply to the currently active tab and will reset as soon as you close the tab or navigate to a different site.
  • browser.zoom.updateBackgroundTabs: Also set to true by default, this setting ensures that if you have multiple tabs from the same domain open simultaneously, changing the zoom level in one tab immediately updates the rendering of the other tabs using the newly saved database value.

Privacy and Private Browsing

Because saving a domain name to content-prefs.sqlite creates a permanent record that you visited that specific website, Firefox alters how zoom memory works to protect user privacy in certain scenarios:

  • Private Browsing Mode: When you adjust the zoom level in a Private Window, Firefox does not write the change to the content-prefs.sqlite file on your hard drive. Instead, it stores the domain and zoom level in temporary system memory (RAM). It will remember the zoom level for that site while the Private Browsing session remains active, but the data is permanently erased the moment the last Private Window is closed.
  • Clearing History: When clearing your browsing data in Firefox, the dialog box separates "Cookies and Site Data" from "Site Settings" (or "Site Preferences"). Leaving "Site Settings" unchecked allows you to wipe your browsing history while preserving content-prefs.sqlite. Checking "Site Settings" purges the database, resetting all custom domain zoom levels back to default.