Is there any possibility to add a <noscript> tag to the body? Or some other way to detect disabled / not supported JavaScript?
By default, a blank page is rendered, which is not really helpful.
On StackOverflow it is recommended to put a <noscript> tag inside the head. This works (at least with Chrome), but apparently text (or <p> or <div>) is not allowed inside a head <noscript>. The validator says:
Non-space character inside noscript inside head.
This was discussed (but not solved) on GitHub as well. In the referenced issue they solved it by using WebApp.addHtmlBodyHook:
Unfortunately this API is not available anymore (I use Meteor 1.1).
Any suggestions? Or should I just go with the head <noscript> (and ignore validation)?
I can imagine that many apps could benefit from an “official” (and valid) API for this though.
Hi, I have a meteor + react app and I can’t find a way to add a noscript message.
I only have js files in my app… Where can I add the noscript tag ? Is there anything embedded in meteor ?
I found the solution, I added this in server/main.js
Inject.rawHead('noscript', '<noscript><style>body {font-size: 32px;text-align: center;line-height: 100vh;}body:after {content: "Please enable JavaScript in your browser to view this site."}</style></noscript>')