Userscript Manager Detection

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

As of 16.10.2022. See the latest version.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/453189/1105660/Userscript%20Manager%20Detection.js

Аўтар
Taureon
Версія
1
Створаны
16.10.2022
Абноўлены
16.10.2022
Памер
854 байта
Ліцэнзія
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 file.
  • Get isInUserscriptContext anytime when required.