You may have noticed that this notebook has a thumbnail even though it does not contain any images. So where does the thumbnail come from?
(If you haven't, use this search link to view it.)
It's actually rather simple: we check for the user agent string of Observable's thumbnail daemon. That string (as of this writing) is:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/69.0.3452.0 Safari/537.36
All that's left is to check navigator.userAgent for "HeadlessChrome" and act accordingly.