[SalesForce] Old Console and VisualForce Pages

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.

Best Answer

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