Use pdf.js: Cross domain access error | Community
Skip to main content
Level 2
July 6, 2017
Solved

Use pdf.js: Cross domain access error

  • July 6, 2017
  • 1 reply
  • 3444 views

I like to insert a pdf in a HTML article with the help of pdf.js.

It works perfectly in the aem preflight app, but not in our own developper test app.

In our app there is the following error:

XMLHttpRequest cannot load file:///var/mobile/Containers/Data/..../test.pdf. Cross origin requests are only supported for HTTP.

So is it possible to set <access origin="*" /> or somithing like this on our own app, so it can load local files?

Or what is the difference from our own app to the preflight app?

Thanks, David

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by brucelef

Hi David,

I've seen this library work in other applications so I believe that this is due to a known issue [1] with using the WKWebViewEngine in iOS.

Can you try creating a new app with the WKWebView plugin disabled?

[1] [CB-10143] Local file:// url XmlHttpRequests are not allowed in WKWebViewEngine - ASF JIRA

1 reply

brucelefAdobe EmployeeAccepted solution
Adobe Employee
July 14, 2017

Hi David,

I've seen this library work in other applications so I believe that this is due to a known issue [1] with using the WKWebViewEngine in iOS.

Can you try creating a new app with the WKWebView plugin disabled?

[1] [CB-10143] Local file:// url XmlHttpRequests are not allowed in WKWebViewEngine - ASF JIRA