Back to blog

Features

YouTube Grid Layout: How to Control Videos Per Row

July 20, 2026·4 min read

YouTube's homepage layout is designed for engagement — not for your preferences. The number of videos per row changes based on your window size, your device, and YouTube's own A/B testing. You have no control over it.

Adless changes that. Here's how the grid control feature works under the hood.

The problem with CSS injection timing

The naive approach to changing YouTube's grid is simple: inject a CSS rule that overrides the grid template columns. But timing matters enormously. If your CSS arrives after YouTube's layout has already painted, users see a jarring "flash" — the page renders with YouTube's default layout, then snaps to your custom grid.

This Flash of Unstyled Content (FOUC) is the #1 complaint about layout-modifying extensions. Adless solves it with a technique called pre-paint injection.

Pre-paint injection with document_start

Adless's content script runs at document_start — the earliest possible moment, before the DOM is constructed. At this point, it:

  1. Reads your grid preference from a localStorage cache (synchronous, instant)
  2. Injects a <style> element with your grid CSS into the document head
  3. Asynchronously refreshes the cache from Chrome storage (in case settings changed on another tab)

Because step 1 uses localStorage (synchronous) rather than chrome.storage (asynchronous), the CSS is injected before the browser's first paint. The page never renders with the wrong layout.

Available controls

  • Videos per row: 2, 3, 4, 5, 6, 7, or 8 columns
  • Hide Shorts: Removes the Shorts shelf from homepage and search
  • Hide notification bell: Removes the bell icon from YouTube's header

All settings are accessible from the Adless popup — click the extension icon on any YouTube page, adjust the slider, and see changes immediately. No page reload required.

Why this matters

A denser grid means more content visible without scrolling. A sparser grid means larger thumbnails and easier scanning. The right density depends on your screen size, your eyesight, and your browsing style — not YouTube's engagement metrics.