- Created by Robert Reiner, last modified on 25. Oct 2024
Boost team fun and productivity on Confluence by small changes to the UI with short JavaScript userscripts
Quickly deploy JavaScript userscripts to your Confluence server to make all the small changes to bring an already great collaboration platform to a new level!
Deploy userscripts in a flash!
Make small adjustments to the Confluence user interface (UI) for selected audiences within seconds!
Provide userscripts for users by a central configuration.
Maintain full control over which scripts are executed in your users' browser dependent on user, group, space, space category, and page label.
Choose from free and Open Source userscripts to get started!
Also download userscripts to boost UI for the projectdoc Toolbox!
The Userscripts for Confluence is available on the Atlassian Marketplace!
How does it work?
Browsers render Confluence pages based on HTML when users traverse a Confluence site. The appearance of the page can be altered or additional functions can be applied to these pages by JavaScript code. Confluence users may use bookmarklets or userscripts to execute their own code from within their browser on these pages.
Teams in corporations like to share these scripts and administration teams need to prevent code from uncontrolled sources to be executed in a corporate environment. This is when Userscripts for Confluence enters the stage. Userscripts for Confluence is an app for Confluence Server that allows to administrate JavaScript code to be executed in the browser of their Confluence users.
While bookmarklets need to be executed by users explicitly by clicking on links in the browser's bookmarks and classical userscripts are executed when predefined conditions are meet, typically by the use of a browser add-on like Greasemonkey or Tampermonkey, Userscripts for Confluence allows to execute scripts stored on the server side of Confluence.
All scripts are executed on the client side, within the browser of the user visiting the Confluence page.
The administration team defines the parameters that activates a particular userscript. This set of parameters is called the activation record.
Activation Context
A userscript can be executed on a given page
- if a user is member of a certain Confluence group
- if a user's name is explicitly registered
- if the current page
- is part of a certain space
- is part of a space labelled with a certain category
- is labelled with a given label
Or a combination of user and page information. Like
- a page with a given label for users of a given group
- a space identified by a key for a user with a specific name
By providing scripts to be executed in explicitly specified contexts, users of Confluence can implement a number of use cases.
Use Cases
Short, but effective userscripts support use cases including:
- Hide elements like
- macros from the macro browser
- space blueprints from the space wizard
- page blueprints from the page wizard
- Add page elements
- links or buttons
- context help
- banner
- dialog
- Alter page elements
- focus
- visual properties
Userscripts for Confluence allows to register userscripts for various use cases quick and simple to the userscripts repository.
Get started!
This short tour gets new users started with Userscripts for Confluence quickly.
Name | Audience | Short Description |
---|---|---|
Writing Userscripts | Userscripts Administrator | A short introduction to write userscripts for the Userscripts for Confluence App. |
Managing Userscripts | Userscripts Administrator | A short introduction to manage (add, alter, remove) userscripts with the Userscripts for Confluence App. |
Alternatives to Userscripts for Confluence | Userscripts Administrator | Userscripts for Confluence is one way to implement userscripts for users of a Confluence server. This article introduces alternatives. |
Free Open Source Scripts
The userscript repository provides a collection of sample scripts to be used on Confluence server instances.
- Copy Page ID
- Binds copying the identifier of the current page to a keystroke.
- Create with Template
- Removes the default create-page button and renames the create with template.
- Force Comment
- Enforces comments in a specific format when documents are edited.
- Hello World
- Simply renders "Hello World!" to the browser's console.
- Hide Page Elements
- Hides a static set of elements on a Confluence page for different groups of users.
- Hide Page Elements from Anonymous
- Hides a static set of elements on a Confluence page.
- Hide projectdoc Tools
- Removes projectdoc tools (blueprints and macros) from the current page.
- Inspect Menu for projectdoc
- Renders a menu with tools to inspect information from a projectdoc document, shown in the browser.
- Install Shortcuts
- Sample script to register actions with a shortcut in Confluence.
- projectdoc Search Tool
- Provides an interface to specify and launch queries for projectdoc documents.
- Refactor projectdoc Document
- Adds a refactor menu and checks the current document for property issues.
- Shortcuts for Focus
- Sample script to register actions with a shortcut in Confluence.
- Vertical Banner
- Renders a vertical banner on the left side of a Confluence page.
- Vertical Banner for projectdoc
- Renders a vertical banner on the left side of a Confluence page with space information fetched from a projectdoc service.
- View Mode Landing Page
- Hide elements to render a landing page for an audience.
- View Mode Presentation
- Hide elements to render a page for a presentation.
These scripts are available on Bitbucket with open source licenses. Adjust these scripts to your specific requirements in minutes!