Options
All
  • Public
  • Public/Protected
  • All
Menu

Conditionally Registering Extensions

You can use the viewer mode or the viewer version to conditionally load the Relativity Review Extensions. Conditional loading is useful when an extension should run in a particular context or is only compatible with certain versions of the Review Interface. For more information, see ApplicationContext and IVersionInformation.

To conditionally register an extension, use the IExtensionParameters passed to your extension script as the params object. This object contains both the application version information (IVersionInformation) and the context (ApplicationContext) that the application is currently running in. Your extension script can use these parameters to determine how the Review Interface is displayed to the user and whether it should be loaded.

To prevent your extension from being loaded, return undefined from your script.

Conditionally loaded extension script example

This example script doesn't load the extension in the context of the document preview pane on the document list page:

(function(params) {

    // If document is shown in preview mode, return
    // undefined to prevent the extension from loading.
    if (params.applicationcontext === "preview") {
        return undefined;
    }

    var config = {
        id: "examplecompany.testextension",
        name: "Example Company Test Extension",
        ....
    };

    // Load the extension when the document is shown outside of preview mode.
    return config;
}(params))