Userscript Manager Detection

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

אין להתקין סקריפט זה ישירות. זוהי ספריה עבור סקריפטים אחרים // @require https://update.greasyfork.org/scripts/453189/1106477/Userscript%20Manager%20Detection.js

יוצר
Taureon
גרסה
1
נוצר
16-10-2022
עודכן
18-10-2022
רישיון
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.