Greasy Fork is available in English.

Userscript Manager Detection

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

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/1106477/Userscript%20Manager%20Detection.js

Aŭtoro
Taureon
Versio
1
Kreita
2022/10/16
Ĝisdatigita
2022/10/18
Licenco
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.