Switch Lightning Locker On and Off in the UI

Turn Lightning Locker on and off for all components in a community, regardless of API version, with a simple switch in Experience Builder. The switch is available in Lightning Communities that use the Script Security level Allow Inline Scripts and Script Access to Whitelisted Third-party Hosts.

Where: This change applies to Lightning communities accessed through Lightning Experience and Salesforce Classic in Enterprise, Essentials, Performance, Unlimited, and Developer editions.

Why: Lightning Locker provides security in your community by isolating components from other components. For example, it can isolate a component that captures password information and prevent other components from reading that data. However, sometimes you don’t require this level of security. In the past, if you wanted to bypass the Lightning Locker security feature in your community, you could use components based on API versions 39.0 or earlier. With the new switch, you can use components based on later API versions and still turn off Lightning Locker in the community.

How: In Experience Builder, go to Settings | Security | Content Security Policy (CSP).

Lightning Locker toggle below the Script Security Level dropbox.