I understand that adding <meta name="viewport" content="...">
determines the layout on mobile browsers for HTML documents - but is there something (e.g. HTTP header) that tells the browser how to display documents such as plain text files?
Case in point, Gmail's robots.txt looks tiny, like a desktop website without a viewport meta tag:
On the other hand, StackOverflow's robots.txt is displayed in a more mobile-friendly way on the same browser:
Is this standardized anywhere? Does Chrome have some undocumented heuristic to decide this?
No, there is nothing that tells the browser how to display documents such as plain text files.
For some reason Chrome (mobile) zooms only .txt files with more than 302 characters. This seems to be true for other webkit browsers too.
Gmail's robots.txt is 128 characters long and Chrome doesn't zoom it.
Here are two almost identical files, in the same folder; the only difference is the number of characters stored.
301 characters long .txt file:
http://tonttest.altervista.org/301byte.txt
302 characters long .txt file:
http://tonttest.altervista.org/302byte.txt