Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-14121

Cannot load index.html on cdvfile:// protocol

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cordova-ios
    • Labels:
      None
    • Environment:

      iOS 11.4

      Description

      In the most recent versions of iOS, the cross-domain restrictions on file: have been tightened up. It is impossible to do things like play a video which qualifies as same-origin (and therefore can e.g. be uploaded as a WebGL texture). Accessing the video via the file: protocol counts it as cross-origin; even if you use cordova-plugin-file to read it in to a blob and then use createObjectURL(), it still counts as cross-origin and ends up blocking some features.

      If we could load index.html on the cdvfile:// protocol, then we should be able to load all subresources as relative to cdvfile:// which should then count them as same-origin. This would also simplify development since things like fetch() calls should work (they are blocked on the file: protocol).

      However I cannot find any way to navigate to a cdvfile:// URL on iOS. Even with 

      <allow-navigation href="cdvfile://*" />

      in config.xml, trying to navigate to cdvfile:// throws an "unsupported URL" error. This ought to be supported.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ashleyscirra Ashley Gullen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: