https://wiki.greasespot.net/GM.info
https://github.com/quoid/userscripts#api
|
- `GM.info` && `GM_info` |
|
- is available without needing to add it to `@grant` |
|
- an object containing information about the running userscript |
|
- `scriptHandler: String` - returns `Userscripts` |
|
- `version: String` - the version of Userscripts app |
|
- `scriptMetaStr: String` - the metablock for the currently running script |
|
- `script: Object` - contains data about the currently running script |
|
// add global values |
|
let scriptHandler = "Userscripts" |
|
let scriptHandlerVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "??" |
|
allFiles["scriptHandler"] = scriptHandler |
|
allFiles["scriptHandlerVersion"] = scriptHandlerVersion |
|
const scriptData = { |
|
"script": scriptDataKey.scriptObject, |
|
"scriptHandler": data.scriptHandler, |
|
"scriptHandlerVersion": data.scriptHandlerVersion, |
|
"scriptMetaStr": scriptDataKey.scriptMetaStr |
|
}; |
The project has been using scriptHandlerVersion, which is inconsistent with the actual documentation.
https://wiki.greasespot.net/GM.info
https://github.com/quoid/userscripts#api
userscripts/README.md
Lines 209 to 215 in 16a23bd
userscripts/extension/Userscripts Extension/Functions.swift
Lines 1313 to 1317 in 16a23bd
userscripts/extension/Userscripts Extension/Resources/content.js
Lines 51 to 56 in 16a23bd
The project has been using
scriptHandlerVersion, which is inconsistent with the actual documentation.