1

I am using iframe on a visualforce page but only a white screen is coming in its place.

If I use <apex:iframe src="/apex/abc"> then it works properly but if I use <apex:iframe src="https://www.salesforce.com"> then it is not working. I have tried in various browsers but the issue still persists.

Please help.

3 Answers 3

3

Take a look at this : Clickjack protection for Non-Setup Salesforce Pages.

http://docs.releasenotes.salesforce.com/he-il/winter14/release-notes/rn_186_forcecom_cruc_setup_pages.htm

If you had run your critical update by mistake it could be one of the reasons why you are seeing blank pages.

This critical update enables clickjack protection for all non-setup Salesforce pages to protect against user interface redress attacks.

The article in the above reference specifically talks about this issue:

If your organization displays non-setup Salesforce pages within a frame or , it’s possible that the pages will either display as a blank page or without the frame after clickjack protection is enabled. The behavior varies depending on your browser and its version. Although there are reasons to frame pages, framed pages can be used by hackers.

Also the clickjack protection cannot be disabled without contacting support :

In the Spring ’14 release, the ability to disable clickjack protection from the Session Settings page will be removed, so you’ll have to contact salesforce.com Customer Support if you need to disable it. However, disabling clickjack protection is not recommended.

Read more here to know what and how it impacts you ( though much of this was discussed way before this was enabled full scale)

Upcoming "clickjacking" protection

This may be a better guide :

Winter 13 Clickjacking protection - is the following expected or a bug?

1
  • This is painful to deal with, especially since it stops me from being able to have iframes show both domains in salesforce. It feels silly that an <apex:iframe> isn't able to render, say, na15.salesforce, while the domain is c.na15.visual.force. Oct 21, 2014 at 15:35
0

This page:

<apex:page>
    <apex:iframe src="https://www.salesforce.com"/>
    <apex:iframe src="/apex/cve__CaseManagement"/>
</apex:page>

and this page:

<apex:page>
    <iframe src="https://www.salesforce.com"/>
    <iframe src="/apex/cve__CaseManagement"/>
</apex:page>

both displayed both pieces of src content for me so I could not reproduce your problem.

Note that as the page is Visualforce, when the relative URL is used (the one starting /apex) the first part of the URL will be assumed to be the Visualforce https://na15.visual.force.com/ rather than the default UI https://na15.salesforce.com so you would have problems displaying default UI content using relative URLs.

0

Your issue can probably be solved by clicking on the little shield on the top right fo your browser bar and enabling the scripts to load. Chrome's security settings automatically block your content.

1
  • Welcome to SF.SE Michael. The accepted answer above is indeed the correct answer. The problem is caused by XSS clickjack protection built into the SF platform.
    – crmprogdev
    May 29, 2015 at 16:49

You must log in to answer this question.

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