Newer Version Available
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.
- From Setup, enter Session in the Quick Find box, and then select Session Settings.
-
Select the checkbox for “Freeze JavaScript Prototypes”.
- Click Save.