Lightning Locker is a security architecture developed for Lightning components. The Salesforce Lightning Locker Service prevents security issues when you build your own components or even include third-party libraries in the lightning components. Locker Service applies security in Lightning experience, Salesforce, Template-based communities, Standalone apps, Lightning out, and Lightning components for visual force. Lightning locker also improves code supportability by allowing access to supported APIs, and eliminating access to non-published framework internals.
Salesforce Lightning Locker carries out security and best practices for custom Lightning components used in the following:
Lightning locker is automatically authorized for component bundles having API version 40 or above.
One can disable the lightning locker by making the change to the API version of the lightning component bundle to 39 or below. Component versioning allows you to integrate a component with a Salesforce API version. While creating a component, the default version is the newest API version.
In previous releases, one could able to set the API version of a component to 39.0 using the Developer Console. On the other hand, you cannot utilize the console for this purpose because the console holds up only the six previous API versions.
Now, the API version can be set in the component’s metadata file by utilizing Salesforce CLI. In the AuraDefinitionBundle metadata of your component, use the APIVersion field to adjust the API version to 39.0.
In the below example – the metadata file myComponent.cmp-meta.xml for component myComponent.cmp sets the API version to 39.0:
< ?xml version="1.0" encoding="UTF-8" ?>
< AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata " >
Lightning Locker tool allows you to build more secure code that run efficiently with Lightning Locker
Locker API Viewer displays Lightning Locker’s support of the standard DOM APIs in the Window, Document and Element objects. The SecureWindow, SecureDocument and SecureElement wrappers prevent use of non-supported APIs.
When it comes to developing an app on the cloud by using lightning web components, Salesforce lightning makes the process easy. Salesforce lightning lets you automate the sales process of your organization, build apps at lightning speed, and provide access to your data anytime, anywhere.
Hire our Salesforce lightning developers who assist you to manage all your Salesforce tasks including Salesforce Lightning Locker Services. At Solvios Technology, we are a group of trusted Salesforce development company in the USA, delivering enterprise solutions to boost your business.