Brandable

Generated JavaScript

How Brandable generates small JavaScript modules for Moodle, off by default, reviewed by the administrator, with a kill switch.

Last updated: November 9, 2026

Most designs need only styles and template changes. Some need a little behaviour: a back to top button, a banner that can be closed, an animation. Brandable then writes a small JavaScript module.

Off by default

The generated JavaScript is off until an administrator turns it on, on the page Generated JavaScript (Site administration > Appearance > Themes, capability theme/brandable:managejs). The page explains the risk; turning it on records your consent, with the version of its text. While it is off, Brandable generates no module and none runs. A request that needs one says so and offers to turn it on.

Reviewed before publication

No module is published without a review on your site:

  • before Publish, the editor shows every module new or changed since the published version, with its code and the difference with the previous one; an administrator reads each one and ticks I reviewed this code;
  • a module restored from the cloud or imported from a theme is reviewed again, even if it ran elsewhere;
  • with the Pro plan, a Security review by AI by Brandable explains what a module does and the points to check (it helps the review, it does not replace it).

Modules only use a small library provided by the plugin (find elements, react to events, add classes or elements), and are checked by the plugin before they are applied. Brandable never generates PHP.

Kill switch

  • Stop every module on the page Generated JavaScript stops all the modules at once, without changing the design; Run the modules again turns them back on.
  • An administrator can add ?brandable_nojs=1 to the address of any page to load it without the modules, to take back control if a module gets in the way.
  • Turn the generated JavaScript off removes the consent: no module runs any more and no new one is generated.

The history of the page lists who turned the JavaScript on or off, and when.