Newer Version Available

This content describes an older version of this product. View Latest

Freeze JavaScript Prototypes

Freeze JavaScript prototypes to prevent Aura component authors from modifying JavaScript prototypes of global objects that are shared between namespaces. This restriction enables better code separation between components and prevents malicious or inadvertent tampering of shared objects, such as the JavaScript APIs or DOM APIs.

In JavaScript, each object has a prototype object. An object inherits methods and properties from its prototype object. Prototypes enable a JavaScript object to inherit features from another object. If a component author modifies a JavaScript prototype of a shared object, it can introduce unexpected behavior and potential security issues. Freezing JavaScript prototypes eliminates this risk.

This setting is supported only in Lightning Experience and is disabled by default.

  1. From Setup, enter Session in the Quick Find box, and then select Session Settings.
  2. Select the checkbox for “Freeze JavaScript Prototypes”.

    Cisco Webex Teams and Meetings features aren't compatible with the Freeze JavaScript Prototypes setting. If you have one of these Webex features enabled, you can’t enable this setting.

    Note

  3. Click Save.