function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jfurr_improveit360jfurr_improveit360 

VF Pages on Different Domain than Standard Pages causing cross domain javascript problem in iFrame

We are using a visualforce page as a component in our home page. The page uses AJAX to fill in some values on the page. We're also using jQuery, fullcalendar.js, and moment.js. The page is displayed in an iframe.

 

Problem: Some of our customer's standard pages are on the cloudforce.com domain and their visualforce pages are on the force.com domain causing the following error (I removed some subdomains for security reasons from the message below):

 

Unsafe JavaScript attempt to access frame with URL https://cloudforce.com/home/home.jsp from frame with URL https://visual.force.com/apex/overview. Domains, protocols and ports must match.

 

This code works for a majority of our customers except the ones that are on the cloudforce.com domain. Does anyone have an idea on how to fix?

Vinita_SFDCVinita_SFDC

I believe you are facing this issue on Chrome browser and it must be working on IE and firefox. Mostly this issue occurs because of CSS. For example check if the display:none is set in the CSS which is referred by the page delivered to the browser, if yes try changing it to display:block and hopefully it should work. Please check your CSS being used by the page.

 

Hope this helps!