Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
show-titlefalse
titleDetails

The JSON file has the following format.

Content Marker
first-child-fixtrue
idanatomy-of-a-userscript


Code Block
languagejs
titleUserscript Descriptor in JSON
{
  "namespace": "...",
  "name": "...",
  "version": "...",

  "script": "...",

  "description": "...",
  "documentation": "...",
  "authorsupport": "...",

  "activation": {
    "preserve": false,
    "space": ["...", ...],
    "category": ["...", ...],
    "label": ["...", ...],
    "group": ["...", ...],
    "user": ["...", ...]
  }
}



Section
titleIdentifier

The following JSON attributes identify the userscript.

Tour
marker-column-property-nameTitle
replace-title-with-nametrue
style-classtable=projectdoc-fullwidth[columns=7em,8em,11em,*]


IdentifierTypeTitleShort Description
namespaceStringUserscript Namespace
nameStringUserscript Name
versionSemantic VersionUserscript Version




Section
titleCode

The following JSON attribute references the userscript JavaScript code.

Tour
marker-column-property-nameTitle
replace-title-with-nametrue
style-classtable=projectdoc-fullwidth[columns=7em,8em,11em,*]


IdentifierTypeTitleShort Description
scriptURLUserscript Code URL




Section
titleMetadata

The following JSON attributes provide additional information on the userscript.

Tour
marker-column-property-nameTitle
replace-title-with-nametrue
style-classtable=projectdoc-fullwidth[columns=7em,8em,11em,*]


IdentifierTypeTitleShort Description
descriptionStringUserscript Description
documentationURLUserscript Documentation
authorsupportStringUserscript Support




Section
titleActivation Record

The activation record is defined with the JSON attribute activation, which is a map of attributes.

The activation record provides the following JSON attributes to control in which context the referenced userscript is executed.

Tour
marker-column-property-nameTitle
replace-title-with-nametrue
style-classtable=projectdoc-fullwidth[columns=7em,8em,11em,*]


There is also a control flag for conveniently alter a script without altering the activation record.

Tour
marker-column-property-nameTitle
replace-title-with-nametrue
style-classtable=projectdoc-fullwidth[columns=7em,8em,11em,*]

Allows to control the service to not override an existing activation record. If no activation record exists, none will be created.

This flag allows to alter a userscript without the need to pass in the current values of the activation record.
IdentifierTypeTitleShort Description
preserveBooleanPreserve Activation Record





Section
titleUse
intro-textList of elements that declare this data type.
Display Table
render-no-hits-as-blanktrue
selectName, Doctype|, Short Description
sort-byDoctype, Name
where$<Data Type>=[${Name}]

...