function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Neil KimNeil Kim 

Embed visualforce page to External website

Hi all!
I'm now trying to embed visualforce page to external website(our shoppingmall).
Of course, I use force.com site and use this visualforce page that I want to show.

In this situation, I want to embed this force.com site to our shopping mall page.
When I try to open the URL at browser directly, it works fine.
However, when I embed this URL through Iframe like (src="force.com site URL"), it doesn't work.
There is only 1 grey, empty box.

Anybody can help me?

 
Khan AnasKhan Anas (Salesforce Developers) 
Hi Neil,

Greetings to you!

Salesforce has also implemented its own defenses to "Clickjacking" attacks within the native UI. Due to this, the iFraming of Salesforce, or the iFraming of some external websites is no longer recommended. Modern browsers are forced to defend against this new kind of attack, where framing is used by malicious attackers to compromise a browser and potentially steal customer data. 

Here's the workaround to iframes:
If you're encountering this problem, instead of using a web tab, a custom link can deliver the URL with the behavior set to:
 
  • Display in new window.
  • Display in existing window without sidebar or header.

Please refer to the below links which might help you further with the above issue.

https://help.salesforce.com/articleView?id=IFRAME-or-Web-Tab-Content-Displays-Blank-Page-1327107637323&type=1

https://salesforce.stackexchange.com/questions/126654/embedding-iframe-external-page-to-visualforce-page-iframe-is-showing-blank-page

https://salesforce.stackexchange.com/questions/42591/embed-visualforce-page-in-public-website

https://developer.salesforce.com/forums/?id=906F00000009BRJIA2

https://salesforce.stackexchange.com/questions/153988/embed-salesforce-com-in-an-iframe-on-some-public-website

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks and Regards,
Khan Anas
Neil KimNeil Kim
@Hi Khan. Looks like I couldn't fully understand what you guide.

I changed Site page option as Allow flaming by any page (No protection).
But it still isn't loaded.

Could you please guide more in detail?