Userscript Manager Detection

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

Ezt a szkriptet nem ajánlott közvetlenül telepíteni. Ez egy könyvtár más szkriptek számára, amik tartalmazzák a // @require https://update.greasyfork.org/scripts/453189/1106477/Userscript%20Manager%20Detection.js hivatkozást.

Fejlesztő
Taureon
Verzió
1
Létrehozva
2022.10.16.
Frissítve
2022.10.18.
Licensz
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.