It is not possible to detect and block Chrome headless
Sites detecting headless browsers vs headless browsers trying not to be detected by sites, is an arms race that&#x27;s been going on for a long time. The problem is that, if you&#x27;re trying to detect headless browsers in order to stop scraping, you&#x27;re stepping into an arms race that&#x27;s being played very, very far above your level.<p>The main context in which Javascript tries to detect whether it&#x27;s being run headless is when malware is trying to evade behavioral fingerprinting, by behaving nicely inside a scanning environment and badly inside real browsers. The main context in which a headless browser tries to make itself indistinguishable from a real user&#x27;s web browser is when it&#x27;s trying to stop malware from doing that. Scrapers can piggyback on the latter effort, but scraper-detectors can&#x27;t really piggyback on the former. So this very strongly favors the scrapers.