Using iFrame in lightning component to embed visualforce page (clickjack protection is enabled)
Lighting Component: HZN_CohortImport.cmp<aura:component description="HZN_CohortImport" implements="force:appHostable" access="global">
<iframe src="/apex/HZN_CohortImport" width="100%" height="1000px;" frameBorder="0"/>
</aura:component>
Visualforce Page: HZN_CohortImport.page
<apex:page id="HZN_CohortImport" showHeader="false" sideBar="false" controller="HZN_CohortImportController" lightningStylesheets="true" docType="html-5.0">
</apex:page>
Add visualforce page in lightning component using iframe tag. iframe tag have some limitations, it will work only when clickjack protection is disabled.
When clickjack protection is enabled visualforce page appear as a blank screen. To avoid this issue add your organization url in whitelisted domains.
for example: https://utz--dev.lightning.force.com
Set Up → Session Settings → Add org domain in Whitelisted Domains (This will be different for different orgs)
Comments
Post a Comment