Greasy Fork is available in English.

Userscript Manager Detection

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

Ce script ne doit pas être installé directement. C'est une librairie destinée à être incluse dans d'autres scripts avec la méta-directive // @require https://update.greasyfork.org/scripts/453189/1106477/Userscript%20Manager%20Detection.js

Auteur
Taureon
Version
1
Créé
16/10/2022
Mis à jour
18/10/2022
Size
787 octets
Licence
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.