Userscript Manager Detection

A Code Snippet for detecting if the script is being ran in an Userscript Manager.

Este script no debería instalarse directamente. Es una biblioteca que utilizan otros scripts mediante la meta-directiva de inclusión // @require https://updategreasyfork.deno.dev/scripts/453189/1106477/Userscript%20Manager%20Detection.js

Autor
Taureon
Versión
1
Creado
16/10/2022
Actualizado
18/10/2022
Tamaño
787 Bytes
Licencia
Unlicense

A Code Snippet for detecting if the script is being ran in an Userscript Manager. Made by Taureon.

How to use:

  • Add var isInUserscriptContext = typeof GM === 'object' || typeof GM_info === 'object'; to the beginning of your script.
  • Get isInUserscriptContext anytime when required.