Skip to content

Reading big media files make WKWebView crash with cordova-ios-6.x #1033

Closed
@gerhardsletten

Description

@gerhardsletten

Bug Report

After migration from cordova-ios-5.x to cordova-ios-6.x we now see that the cordova no longer support reading files in chunks. Instead the whole file is loaded into memory, which will limit file access to what is available on your device.

Problem

After what I can see, it looks like CDVURLSchemeHandler is handling access of local files in a cordova app, and it does not support delivering files with range headers so WKWebView don't need to load the whole file at once.

What is expected to happen?

Earlier with UIWebView we did not experience this so I guess that cordova on UIWebView handled this by reading these files in chunks. (Or it was packed with the default file-reading that UIWebView had)

What does actually happen?

Running simulator or a device attached to xcode we see a memory spike at the same size as the file you try to access. If you are on a device that can not handle this, it will result in a restart of the webview.

Information

Think the same problem is reported here for cordova-plugin-ionic-webview

Version information

cordova-ios@6.1.1

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions