TransWikia.com

Render an External Page in an IFrame in a custom VF page

Salesforce Asked by Arun kharb on February 13, 2021

I want to render an External Web page in an IFRAME in custom VF page and retrieve cookies generated by that page in the salesforce.

However, I have tried loading that in both apex:iframe as well as in html iframe but getting this error: Refused to display ‘https://sitename.com/‘ in a frame because it set ‘X-Frame-Options’ to ‘SAMEORIGIN’.

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

2 Answers

You can also check this behaviour by adding a widget called ignore x- frame headers on chrome.

If the add on is enabled you would be able to see the page but when the you disable it you will be having the issue.

However, this option is something that is set from the publisher side.

Answered by Anutej on February 13, 2021

We too had faced the same issue. If the External Web page that you are trying to include in an iFrame is in your control you can check if you can set X-Frame-Options:ALLOW-FROM https://example.com/

Source - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options

In this case your iFrame may work as expected.

Answered by Nikhil Khivansara on February 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP