I tried googling and I got a lot of hits for what reader mode does and how to enable it, but nobody can explain what the browser is actually doing.

Do sites have pared-down versions of their pages specifically for reader mode? Or does the browser just scan for particular HTML tags?

you are viewing a single comment's thread
view the rest of the comments
[–] 15 points 3 months ago*

If it helps there's a standalone version of the logic.

At a rough scan, it looks like it tries to find a best guess "main content" node by stripping unlikely nodes and then scoring each node. Element type and content contribute to the score

/**
       * Loop through all paragraphs, and assign a score to them based on how content-y they look.
       * Then add their score to their parent node.
       *
       * A score is determined by things like number of commas, class names, etc. Maybe eventually link density.
       **/
  • source