CEP-Resources icon indicating copy to clipboard operation
CEP-Resources copied to clipboard

CEP 11: CORS issue "Blocked a frame with origin https://***.com from accessing a cross-origin frame"

Open MayaAnusiya opened this issue 3 years ago • 1 comments

Hi Team, We have a CEP extension which renders web content inside frame and also iframe content will communicate with panel extension ex: top.function() - here top is refered as panel extension. After upgrading to AI25.3.1/CEP 11 we are getting CORS issue in console as "Blocked a frame with origin https://*.com from accessing a cross-origin frame" .

We tried some of the recommended fixes in github. We have added the following parameters to the manifest.xml

<CEFCommandLine>
   <Parameter>--disable-site-isolation-trials</Parameter>
   <Parameter>--disable-features=SameSiteByDefaultCookies,CookiesWithoutSameSiteMustBeSecure</Parameter>
</CEFCommandLine>

After adding the above parameters in our manifest.xml we don't see an error in console but, iframe content is not able to access the panel extension JS methods.

Any thoughts or suggession for the communication between iframe content and panel extension JS methods.

MayaAnusiya avatar Aug 06 '21 13:08 MayaAnusiya

@MayaAnusiya CORS restrictions in the latest CEF are the new web security features enabled. I would recommend that you look at the sites and explicitly allow them to be framed using Access-Control-Allow-Origin header.

If your issue is related to communication between cross-site iFrames you can also solve this using post messages. Do refer: https://github.com/Adobe-CEP/CEP-Resources/issues/365 https://github.com/Adobe-CEP/CEP-Resources/issues/364

sujaisivanandan avatar Aug 09 '21 05:08 sujaisivanandan