4

I have a relatively simple Visualforce page that just uses the apex:detail to show the cases detail on the page. With that comes the out of the box change owner and change record type links and related record links. None of the links work due to the following security error:

Uncaught SecurityError: Blocked a frame with origin "https://c.myinstance.visual.force.com" from accessing a frame with origin "https://myinstance.salesforce.com". Protocols, domains, and ports must match.

I have scoured the internet for a solution to this problem and have tried the suggestions for using the salesforce console integration toolkit. However, even the very first example in the SCIT guide does not work. When in the console and using the links on the example page I get the following error:

"Uncaught TypeError: Cannot read property 'Listener' of undefined iframeinterface.js:1 Sfdc.xdomain.IframeInterface.handleOnload iframeinterface.js:1 window.onload"

When not in the console I get the security error like the initial issue with a basic Visualforce page with standard links in the console.

Any help on this would be greatly appreciated!

On a side note, I have been able to get simple functions to work, like testIsInConsole.

6
  • Hello, @jjbennett530, I don't think you're doing anything wrong in this case. I recommend you log this as a case with Salesforce Support and pursue it as a possible bug.
    – Marty C.
    Jul 9, 2014 at 15:26
  • I did and they said I needed premier support for development questions :(
    – Jenny B
    Jul 9, 2014 at 15:30
  • That's ridiculous... can you post the details (including case number) of the case you logged? I assume you'd have written out detailed instructions for reproducing the problem.
    – Marty C.
    Jul 9, 2014 at 15:35
  • Case #10745267; Case Description: We are using the legacy console and have a visualforce page overriding the cases view page. We are getting the following error when attempting to use the hyperlinks on the page(standard hyperlinks, like change recordType and change owner) using the apex:detail page: "Uncaught TypeError: undefined is not a function VFState.js:5 Uncaught ReferenceError: SfdcCmp is not defined Zen.js:8 Uncaught SecurityError: Blocked a frame with origin "instance" from accessing a frame with origin "instance". Protocols, domains, and ports must match. desktopMain.js:6"
    – Jenny B
    Jul 9, 2014 at 16:14
  • 1
    @MartyC. - par for the course. sfdc support is useless unless you pay, even reporting bugs.
    – Eric
    Oct 4, 2015 at 2:45

2 Answers 2

2

Jenny B,

I have a workaround that works for me. You can below code inserting into your visualforce page that overrides your standard page.

apex:includeScript value="/support/console/37.0/integration.js"

script type="text/javascript"
var accId = '{!account.ID}';
if (sforce.console.isInConsole()) 
{
    window.location.href = '/' + accId + '?nooverride=1&isdtp=mn'; 
} 
script
6
  • Thanks but I was trying to just include the apex:detail tag and not recreate the standard page in vf.
    – Jenny B
    Jul 21, 2016 at 21:27
  • I meant you can insert the above code in the same page where you have detail tag. just make sure script tags are properly written. Let me know if you still have questions. I also had the same issue as you had. I just worked out this today. Works great for me.
    – Magnetism
    Jul 21, 2016 at 21:32
  • There are links on the detail page, I believe it was the change owner link on the standard page layout.
    – Jenny B
    Jul 21, 2016 at 21:34
  • Jenny, it will work for all links. The key is even though the standard view page is overriden by visualforce page, by inserting the code I provided, you will not override the standard page with visualforce page in the salesforce console(only). Thus, all your links including change owner will work normal as in a standard view page. Thanks.
    – Magnetism
    Jul 21, 2016 at 21:39
  • Ok, sorry didn't look at it that close, I'll have to test that out and get back to you. Thanks!
    – Jenny B
    Jul 21, 2016 at 21:40
2

As a workaround you can log a case and ask the SF support to "Disable clickjack protection for non-setup Salesforce pages"

This is a setting located at Setup > Security Settings > Session Settings. You have to log a ticket and can't change it on your own. Fortunately you'll need no premier to get it done. And it's reversible, support can change it back.

But please keep in mind that this setting is for a reason and disabling it could reduce the security level. So please see this just as an interim solution.

3
  • I have been working with someone at salesforce and they don't believe disabling clickjack protection for non-setup Salesforce pages will fix the issue and do not recommend us disabling it. So far it looks like I will not be able to use the apex:detail tag on visualforce pages if they appear in the console.
    – Jenny B
    Jul 25, 2014 at 17:25
  • You can try if it helps or not in a sandbox or developer org. I'm pretty sure it will help. But as said earlier, security impacts has to be considered on production orgs.
    – Uwe Heim
    Jul 25, 2014 at 17:29
  • I went ahead and had them disable it in our sandbox and tested it out and unfortunately it didn't make a difference.
    – Jenny B
    Jul 26, 2014 at 14:25

You must log in to answer this question.

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