You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 14
Next »
A userscript is JavaScript code plus metadata that is executed on a web page rendered in a user's browser.
Userscripts for Confluence defines a userscript in form of a descriptor with a reference to the actual script code.
The userscript is configured for users by the administration team. Hence users can benefit from additional functions without bothering to validate the fitness of a script for their task by themselves. This makes extending Confluence easier, especially for team members without programming skills. While these additional features can be implemented in form of Confluence apps, many utilities simply rely on a short amount of JavaScript code. These few lines of code are easily shared and boost the productivity of teams.
The userscript consists of
- an identifier consisting of
namespace
, name
, and version
- a reference to the userscript code (
script
) - metadata, like a
description
, a reference to further information (documentation
), and an ${short name}
- an activation record (
activation
) that defines when the userscript is actually executed
The following fragment shows the basic structure of a userscript in JSON.
{
"namespace": "...",
"name": "...",
"version": "...",
"script": "...",
"description": "...",
"documentation": "...",
"author": "...",
"activation": {
...
}
}
Differences to
The term userscript may refer to the JavaScript code or the userscript descriptor.
A userscript is typically JavaScript code that is executed on a web page when rendered in a user's browser. These scripts are usually configured by users to add additional functions on web pages they are visiting. A browser add-on allows users to add userscripts and define on which web pages they should run- These userscripts as supported by browser add-ons. The code contains its metadata in a comment section.
Userscripts for Confluence provides the metadata in form of an JSON external descriptor with a reference to the script. Both, the descriptor and the JavaScript code form the userscript.
Subordinate Glossary Items
The information a userscript provides can be categorizes by the following bundles.
Resources
More information on userscripts: