1

We developed a very simple visualforce page with JavaScript to be used as an action in the service cloud console for the case object.

Here is the page:

<apex:page standardController="Case" >
<apex:includeScript value="/support/console/36.0/integration.js"/>

<script type="text/javascript">

    function selectMacro() 
    {
        sforce.console.selectMacro('0JZ8E000000007M', runMacro);
    }

    function runMacro(result)
    {
        sforce.console.runSelectedMacro();
    }

    selectMacro();

    </script>
</apex:page>

This action runs smoothly on one environment but after moving it to another environment (and changing the ID of the macro), we get the following javascript error, as shown in the chrome console:

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

We found these issues online:

SecurityError: Blocked a frame with origin from accessing a cross-origin frame

iframe: Protocols, domains, and ports must match error

but it didn't help us to find a solution - We do not have a controller and we do not have control on both pages.
Do you have any idea why we are getting this error on one environment and not on the other?

  • Is there a difference in the Clickjack protection setting between the two environments? – Antonio Manente Jun 8 '16 at 20:40
  • Have you white listed the viaualforce fomain in the original org and not the new one ? – CloudHugger Jun 8 '16 at 21:25
  • @AntonioManente - I checked about clickjack protection and it's relevant only to sites which is not the case. In my case, it's a visualforce page with only javascript on it, running as an action within the service cloud console feed view. – Dagish Jun 9 '16 at 4:45
  • @CloudHugger - As far as i know, I didn't white listed anything in our dev environment. I tried adding CORS on the problematic environment but it didn't help. – Dagish Jun 9 '16 at 4:59
  • I see you hardcoded the Id there -- is that the new macro id or the old one ? – CloudHugger Jun 9 '16 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.