How Firefox Letterboxing Hides Your True Screen Size
This article explores how the Firefox web browser uses a privacy technique called Letterboxing to protect users from browser fingerprinting. By dynamically adding margins around a webpage, Letterboxing masks a user's exact window and screen dimensions. The following sections break down the mechanics of screen-size tracking, how Letterboxing groups users into standardized dimension buckets, and how to enable this hidden feature in Firefox.
The Threat of Window Dimension Fingerprinting
Websites can track you without cookies by collecting your device's unique characteristics, a process known as browser fingerprinting. One of the easiest metrics for trackers to capture is your browser's viewport—the visible area of a webpage.
Because users resize windows randomly, use different monitor resolutions, and have varying operating system taskbars, bookmarks bars, or browser toolbars, the exact pixel width and height of a browser's viewport is often unique. Trackers read these exact dimensions to identify and follow a user across different websites.
The Mechanics of Letterboxing
Originally developed for the Tor Browser and later integrated into Firefox via the Tor Uplift project, Letterboxing neutralizes viewport tracking. It does this by decoupling the size of your actual browser window from the size of the webpage being rendered. Instead of allowing a website to fill the entire available browser space, Firefox creates an invisible container inside the window and renders the webpage strictly within those confines.
Here is how the disguise works in practice:
- Dimension Bucketing: Letterboxing restricts the rendered webpage to a set of predefined, standardized dimensions, which are typically multiples of 200 pixels in width and 100 pixels in height.
- Rounding Down: When you open or resize your Firefox window, the browser calculates the largest standardized "bucket" that can fit inside your current window. For example, if your actual usable browser space is 1366x654 pixels, Firefox will round the webpage rendering area down to 1200x600 pixels.
- Adding Visual Margins: To fill the gap between your actual window size (1366x654) and the spoofed webpage size (1200x600), Firefox adds blank, gray borders around the webpage. This mimics the black bars seen when watching a widescreen movie on a standard television, which is where the term "letterboxing" originates.
- Spoofing Web APIs: When a tracking script attempts
to read your screen or window dimensions using JavaScript (such as
window.innerWidthorwindow.innerHeight) or CSS media queries, Firefox reports the dimensions of the inner letterboxed area (1200x600) rather than your true window size.
If you resize your window, the webpage will not smoothly scale with your mouse cursor. Instead, the gray margins will grow or shrink until your window crosses the threshold into the next 200x100 pixel bucket, at which point the webpage will snap to the new standardized size.
The Crowd Immunity Effect
The ultimate goal of Letterboxing is not to give you a completely fake, randomized screen size, which would actually make you stand out more to trackers. Instead, its goal is uniformity. By forcing millions of different custom window sizes into a small handful of 200x100 pixel increments, Firefox forces thousands of users to share the exact same viewport dimensions. You effectively blend into a crowd of other privacy-conscious users, rendering the screen-size metric useless for individual identification.
How to Enable Letterboxing in Firefox
While Letterboxing is enabled by default in the Tor Browser, it is a hidden preference in standard Firefox. You can activate it manually by following these steps:
- Type
about:configinto the Firefox address bar and press Enter. - Click the button to accept the risk and continue.
- In the search bar at the top, type
privacy.resistFingerprinting.letterboxing. - Double-click the preference to change its value from
falsetotrue.
Once enabled, the change is immediate. If you resize your browser window, you will instantly see the gray margins appear, actively shielding your true window dimensions from the websites you visit.