I tried to show PDF file inside frame window. Many approaches and ways but still same result:
Blocked a frame with origin “https://fe-url.com” from accessing a frame with origin “https://api.fe-url.com”. Protocols, domains, and ports must match.
FE TypeScript APP is app domain.
From this domain I need to load file from media server (it is subdomain of app domain)
something like this:
test.com (app domain)
api.test.com/medias/pdfresizer.com-pdf-resize.pdf?context=bWFzdGVyfGF6dXJlaW1hZ2VzfDg1Nzc4N3xhcHBsaWNhdGlvbi9wZGZ8YUdJMkwyaGpNeTh4TWpNd01UTTRORE14T1RBd05pOXdaR1p5WlhOcGVtVnlMbU52YlMxd1pHWXRjbVZ6YVhwbExuQmtaZ3w5Y2M3MTQ5ZTY5YjFiZTJkNmExODg4ZGYyZjY0MjQ4MmI2NDgwNjhjY2FjYTIxY2YyNDI0OWMzYmFjODgwYTQz&attachment=false#navpanes=0&view=Fit&scrollbar=1&toolbar=0&statusbar=0 (media server)
But on iOS I still get error about blocked request.
Port and protocols are same.
The PDF sometimes shows sometimes not.
Web page is stuck when try to load PDF file.
Thanks for any advice.
I already tried:
ngx-doc-viewer (3rd party library)
(pure HTML approach)
postMessage (this could works if the source of iFrame will be another web app/page and I can set message event handler) but second side is rest-api media server without FE/GUI.)
I expect that PDF file is loaded normally in iFrame without freeze the web page.