Build Reader Mode for the Command Line with Chrome DevTools Protocol
Every developer has been there: you find an article you want to read, but the page is drowning in ads, sticky navbars, newsletter popups, cookie banners, and auto-playing videos. You just want the ...

Source: DEV Community
Every developer has been there: you find an article you want to read, but the page is drowning in ads, sticky navbars, newsletter popups, cookie banners, and auto-playing videos. You just want the text. Browser reader modes help, but they are trapped inside the browser. What if you could extract clean, readable content from any URL directly in your terminal, pipe it to other tools, or batch-process hundreds of pages at once? That is exactly what I built with websnap-reader -- a Node.js CLI tool that turns any webpage into clean Markdown. It uses Chrome DevTools Protocol (CDP) for JavaScript-heavy sites, a readability algorithm to strip away clutter, and optional AI-powered summaries. In this article, I will walk through the architecture, the key problems I solved, and the actual code that makes it work. The Problem: Web Pages Are Cluttered The average web page in 2026 is roughly 20% content and 80% everything else. Navigation bars, sidebars, related article widgets, social share button