Classes
Methods
-
<static> licenseData() → {NexusHoratio.userscript~LicenseData}
-
Description
Per some old GM docs, this extracts
@licenseinformation from the userscript header.Returns
Throws
Details
-
<static> environmentData() → {Array.<string>}
-
Description
Gathers information about the current runtime.
This is mostly useful for logging and when providing feedback.
Returns
Details
-
<static> getValue( key, defaultValue ) → {Promise.<object>}
-
Description
Fetches value from userscript storage, if granted permission.
Purposefully no errors if permissions are not granted.
// Enable in the ==UserScript== header with: // @grant GM.getValueParameters
Name Type Description keystring The name of the value to load.
defaultValueobject Value if not stored OR not enabled.
Returns
Details
-
<static> setValue( key, value ) → {Promise.<object>}
-
Description
Sets a value in userscript storage, if granted permission.
Purposefully no errors if permissions are not granted.
// Enable in the ==UserScript== header with: // @grant GM.setValueParameters
Name Type Description keystring The name to use in the storage.
valueobject The value to set.
Returns
Details
-
<async, static> setAutoManageLoggerConfigs( state [, key ] )
-
Description
Control persistent saving of Logger configuration in userscript storage.
Call once near the top of the userscript to enable.
Requires several userscript grants for full capabilities.
// Enable in the ==UserScript== header with: // @grant GM.getValue // @grant GM.setValue // @grant GM.addValueChangeListener // @grant GM.removeValueChangeListenerParameters
Name Type Attributes Default Description stateboolean Enables/disables the feature.
keystring <optional> 'Logger' The key to use in userscript storage.
Details
Type Definitions
-
LicenseData
-
Properties
Name Type Description namestring License name.
idstring SPDX id (fka
name).urlstring URL pointing to the license.
Details