apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 986 forks source link

(iOS)fix origin is null when I want to use axios to get an JSON from … #1012

Closed micro-sugar closed 3 years ago

micro-sugar commented 3 years ago

Platforms affected

iOS

Motivation and Context

897

Description

add allowUniversalAccessFromFileURLs setting

allowUniversalAccessFromFileURLs Boolean that sets whether JavaScript running in the context of a file scheme URL should be allowed to access content from any origin. Including accessing content from other file scheme URLs. The default value is false.

Checklist

dpogue commented 3 years ago

Thanks for the pull request.

Unfortunately, allowUniversalAccessFromFileURLs is considered private API by Apple, and has been actively discouraged by WebKit developers due to potential for breaking in future iOS versions. Cordova will not adopt this because it introduces too much risk to apps built with Cordova.