§5.4 of the core defines a scripting context base on the presence of the <script> element in, say, HTML. However, the HTML <script> element is not restricted to active 'scripts', i.e., javascript code. It can hold any type of data: a typical case is schema.org metadata in JSON-LD format.
The HTML spec says of the type attribute:
Omitting the attribute, setting it to the empty string, or setting it to a JavaScript MIME type essence match [...] to be interpreted according to the JavaScript Script top-level production.
which probably gives us the way we should restrict the case when we consider the scripting context: it does not have a type or the value of the type is a JavaScript MIME type essence match.
§5.4 of the core defines a scripting context base on the presence of the
<script>element in, say, HTML. However, the HTML<script>element is not restricted to active 'scripts', i.e., javascript code. It can hold any type of data: a typical case is schema.org metadata in JSON-LD format.The HTML spec says of the
typeattribute:which probably gives us the way we should restrict the case when we consider the scripting context: it does not have a type or the value of the type is a JavaScript MIME type essence match.