Advanced Edition
HTML by Mosaic for Confluence Advanced Edition gives you access to JavaScript. You can add JavaScript to your HTML macros to bring them to life.
When JavaScript is enabled, users can write and execute custom JavaScript in their HTML by Mosaic macros. This allows them to create interactive elements such as animations, dynamic content, and form handling. The code runs inside a sandboxed iframe with restricted permissions. Dangerous operations, including network requests and navigation, are blocked. This setting should be enabled only if administrators trust users to write their own code.
When JavaScript is disabled, the JavaScript tab is hidden in the HTML by Mosaic macro screen. Existing macros continue to render their HTML and CSS, but any JavaScript is blocked from running. Users cannot create new interactive macros or edit existing JavaScript. Static HTML and CSS macros continue to work normally. This is the recommended setting when only trusted content is required.
JavaScript support is available only in Advanced Edition, and all code is sanitised regardless of the setting.
If an administrator disables JavaScript, any existing pages that use JavaScript in an HTML macro will no longer work as expected. We recommend you check your pages for JavaScript use before making changes to the settings.
Feature Controls
- Log into Confluence as an administrator.Select Apps > HTML by Mosaic.Use the toggle to control access to JavaScript in your instance.
- Click the cog icon next to your profile icon, to open the Confluence administration menu.
- Select Apps > HTML by Mosaic.
- Use the toggle to control access to JavaScript in your instance.