---
schema_version: "1"
id: 49c8117eaba5a03200ccffa2736115dd4680a12f19aabea7a026995610cdacec
title: Third-Party Web Components With Lightning Locker
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lwc/lightning-components-security/guides/locker/locker-custom-elements.md
canonical_url: https://developer.salesforce.com/docs/platform/lightning-components-security/guide/locker-custom-elements.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: f89879e6eb1372a96de3a69adbe9af66a9d5cbf5c74470bbfc6b2f4a61292e08
products:
  - Security for Lightning Components
  - lwc
---
# Third-Party Web Components With Lightning Locker

Lightning Locker blocks the use of third-party web components to prevent security risks on the Salesforce platform.

Web components are custom elements. To define a custom element, you must use the `customElements.define` API. However, this API allows you to globally register a component by its tag name. Registering a tag name globally is a security risk because an attacker could create an instance of any registered custom element and potentially gain access to sensitive information. Lightning Locker’s `SecureWindow` wrapper blocks the `customElements` methods that create custom web components.

The `SecureWindow` wrapper list in the [Locker API Viewer](https://developer.salesforce.com/docs/component-library/tools/locker-service-viewer) tool shows that `customElements` is not supported.
