The named parameters.
Optionalname?: stringAn additional name to aid in the query.
Optionalobj?: objectThe object to check for a given named feature. Only valid with the AVAILABILITY_REQUEST.AskRuntime request.
The item to query about the runtime.
// Determine if this is the Worker runtime
if (runtime_available({request AVAILABILITY_REQUEST.WorkerRuntime})) {
// Do Worker related things.
}
// Ask runtime about a particular thing globally
// Can also specify the obj property to check on a given object.
// NOTE: "serial" is predefined ask. Just using as an example.
if (runtime_available({
request: AVAILABILITY_REQUEST.AskRuntime,
name: "serial"})) {
// Do serial things
}
Determines if a particular resources is available to the JavaScript runtime the module was loaded into.