I have a backend on jsf + spring.

On the front side, I need to create an iframe, insert the contents of the jsf page into it, and adjust the iframe to the size of the content.

Content changes dynamically and at intervals, if the content has changed - I adjust the size.

Faced the problem that when trying to get content, a cross-domain error occurs:

iFrameID.height = `${iFrameID.contentWindow.document.body.scrollHeight}`; 

Error code itself

IFrameArea.jsx: 9 Uncaught DOMException: Blocked frame with origin " http: // localhost: 8081 " from accessing a cross-origin frame. at http: // localhost: 8081 / js / bundle.336623a4042d4655f806.hot-update.js: 53: 55

The problem is that it is not clear how to determine who is blocking this request, backend or browser? If the browser, then how to fix it?

I use localhost: 8080 for backend, localhost: 8081 for fronend, google-chrome browser. The situation is similar to firefox, but the error is written there not in the console, but in the iframe content.

0