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
Manindar NManindar N 

iFrame from Salesforce will not render

Hello,

We have an iFrame in Salesforce that directs to an IIS 7.x server running an asp.net site.  This has been working fine until earlier Mid july 2020.  No changes on IIS server or site.


The site will render fine on Opera, Firefox and Edge browsers.

A look at the console shows one error being thrown: 

Access to manifest at 'https://hr-mysite.my.salesforce.com/visualforce/session?url=https%3A%2F%2Fhr-mysite--fhcm2.um5.visual.force.com%2Fresource%2F1595939225000%2Ffhcm2__collaborationportal%2Fmanifest.json' (redirected from 'https://hr-mysite--fhcm2.um5.visual.force.com/resource/1595939225000/fhcm2__collaborationportal/manifest.json') from origin 'https://hr-mysite--fhcm2.um5.visual.force.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.


Could this be preventing the page from being rendered?  I see the same message in the consoles of the other browsers, and they have no problem.

If that is not the issue, what steps do I need to take to debug further?

Thanks.

Manindar N
 
AnudeepAnudeep (Salesforce Developers) 
CORS does not support requests for unauthenticated resources, including OAuth endpoints. 

I recommend adding the blocked URL to SFDC’s CORS whitelist

If whitelisting does not help, you can try adding the header "Access-Control-Allow-Origin" to the request you forward to the salesforce

Reference Articles:
-------------------------
https://developer.salesforce.com/forums/?id=9060G000000I7mfQAC 
 
xhr.setRequestHeader("Access-Control-Allow-Origin", "*");

https://salesforce.stackexchange.com/questions/137172/possible-to-set-access-control-allow-origin-in-an-sfmc-landingpage 
 
<script runat=server> Platform.Load("core","1"); HTTPHeader.SetValue("Access-Control-Allow-Methods","POST"); HTTPHeader.SetValue("Access-Control-Allow-Origin","*"); </script>

If you find this information helpful, please mark this answer as Best. It may help others in the community. Thank you
Manindar NManindar N
Hi Anudeep,
Thanks for your quick response!

The thing is its not working on chrome browser, apart from chrome site will work on other browsers like Firefox and Microsoft edge.

As you mentioned above steps Whitelisting and Adding the Header "Access-control-allow-origin" where can i implement these steps. My IIS server or SalesForce configuration.

If Salesforce I don't have any control in my hand for this case to whom i need to contact.