11

My requirement is to show a standard VF page into a Custom Visualforce page. I am using apex:iframe with 'src' parameter and the value as relative url to the standard VF page. However it does not give any error at compile time but at the runtime it only shows a blank page. Then I opened the developer console on the browser, it shows an error. That says "Refused to display 'https://ap2.salesforce.com/001' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'".

This is my iframe.

<apex:iframe src="https://ap2.salesforce.com/001" scrolling="true"/>
2

4 Answers 4

4

I had a similar issue and the solution was to uncheck

"Enable clickjack protection for customer Visualforce pages with headers disabled"

in Setup > Security Controls > Session Settings

Session Settings

2
  • 1
    Hello, I am having the same error. I tried to uncheck the Clickjack protection settings. But it still gives the same error. I also added a similar question: salesforce.stackexchange.com/questions/249474/… could you please have a look and suggest something ? :) Commented Feb 7, 2019 at 11:23
  • 2
    doesn't work for me either both of the options are unchecked for me
    – Sandeep
    Commented Feb 26, 2020 at 20:51
0

In my case, with a url from Google, adding '&output=embed' to the url made the trick

-2

I've experienced this issue before and found that having the Salesforce Developer Mode on was causing the issue.

This can be turned off by navigating to Setup -> Users -> Your User -> Turn Developer Mode off

-2

keep showHeader = false in apex:page

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .