3

We are developing an AppExchange app in which have an HTML file under static resources. Inside the LWC component, we need to display the content of this HTML file. We are currently using the tag and have added the HTML file URL in it. LWC component is loading as expected on record level with HTML content.

Is there any secure way to display the content of the HTML page inside LWC other than iframe from the Salesforce security review perspective?

Please note: the external system provides us a web component with an HTML file hence we do not want go with Canvas app solution.

2

What you're looking for is a lightning:container, which unfortunately does not work in LWC (I have no idea when/if it will be a LWC). However, this would be recommended secure solution you're looking for. It even provides an API you can use to securely interact with Salesforce data if you so desire. Details are in the documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.