Create a Custom JavaScript Module in PowerWeb
As of the 2022 release, we added the ability to add a custom JavaScript module to PowerWeb. This functionality allows you to add event listeners to PowerWeb and kick off custom code when an event is triggered. Additionally, you can disable user interface controls in PowerWeb when the module is active and re-enable controls when it is appropriate.
You can link to a custom JavaScript module for PowerWeb on the Settings tab of your vault settings. The following sections describe how to create the link, and the functions and events you can use when building your custom JavaScript module.
In the custom JavaScript module, you can use the JavaScript API to implement the functionality you want use. An example use case for using this API could be if you wanted to extend the PowerWeb user interface by adding external pages. In external pages, you have more freedom to develop customized functionality and user interfaces integrated with PowerWeb.
With this API, you can synchronize elements of the PowerWeb UI with actions the user is performing in your external page. For instance, with this functionality you can prevent a user from confirming a wizard before all required data is entered in the external page. For more information about external pages, see Configure External Pages.