Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load local files with XHR on iOS #785

Closed
NonSpicyBurrito opened this issue Mar 4, 2022 · 2 comments
Closed

Unable to load local files with XHR on iOS #785

NonSpicyBurrito opened this issue Mar 4, 2022 · 2 comments

Comments

@NonSpicyBurrito
Copy link

NonSpicyBurrito commented Mar 4, 2022

I'm unable to load local files (file://...) with XMLHttpRequest in JS, to files in either Application.persistentDataPath or Application.temporaryCachePath. The same code works fine on Android.

Possibly relevant: https://stackoverflow.com/questions/35554814/wkwebview-xmlhttprequest-with-file-url
It seems that the solution is to add allowFileAccessFromFileURLs and allowUniversalAccessFromFileURLs to configuration preferences.

@KojiNakamaru
Copy link
Member

I introduced UNITYWEBVIEW_IOS_ALLOW_FILE_URLS in #788 for enabling allowFileAccessFromFileURLs and allowUniversalAccessFromFileURLs, and updated binaries. You can enable these settings by defining UNITYWEBVIEW_IOS_ALLOW_FILE_URLS. Please note, however, that these are private APIs so the app enabling them may be rejected.

@NonSpicyBurrito
Copy link
Author

Thank you for the swift work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants