Story Details

  • Writing "/etc/hosts" breaks the Substack editor

    Posted: 2025-04-25 13:48:30

    Modifying the /etc/hosts file, a common technique for blocking or redirecting websites, can unexpectedly break the Substack editor. Specifically, redirecting fonts.googleapis.com to localhost, even with served font files, causes the editor to malfunction, preventing text entry. This issue seems tied to Substack's Content Security Policy (CSP), which restricts the sources from which the editor can load resources. While the author's workaround was to temporarily disable the redirect while using the editor, the underlying problem highlights the potential for conflicts between local system configurations and web applications with strict security policies.

    Summary of Comments ( 321 )
    https://news.ycombinator.com/item?id=43793526

    Hacker News commenters discuss the Substack editor breaking when /etc/hosts is modified to block certain domains. Several suggest this is due to Substack's reliance on third-party services for things like analytics and advertising, which the editor likely calls out to. Blocking these in /etc/hosts likely causes errors that the editor doesn't handle gracefully, thus breaking functionality. Some commenters find Substack's reliance on these external services concerning for privacy and performance, while others propose using browser extensions like uBlock Origin as a more targeted approach. One commenter notes that even local development can be affected by similar issues due to aggressive content security policies.