`onFileDownload` is called with the URL that you can use to download the file.
When RNCWebView detects that the HTTP response should result in a file download,
`onFileDownload` is called. The client can then provide code to download
the file.
RNCWebView determines that a file download should take place if either of the
following is true:
1. The HTTP response contains a `Content-Disposition` header that is of type
'attachment'
2. The MIME type of the response cannot be rendered by the iOS WebView
feat(macOS): Make podspec compatible with macOS (#1328)
* [apple] Move iOS/macOS src into common apple dir
* [apple] Enable macOS as platform in podspec
* [example] Use CocoaPods & auto-linking on macOS
* [docs] Update setup for macOS
* [package] Include apple dir in distribution
fix(Android): Ensure each mounted WebView binds their personal onMessage handler (#1301)
* Ensure each mounted WebView binds their personal onMessage handler
* Changed unique ref generation to uuid
Uses `uuid` npm package.
Dashes are removed from the ref for sanity.
feat(typescript): Source code rewrite using typescript (#425)
Rewrote the whole repository into typescript. This will provide way better and up to date documentation. This should also add some safety for people contributing 😄 .
Flow types were not working until now which is why this PR doesn't have them but feel free to PR.
This also fixes #384#435#206#171#168.
fix(webviewShared.js): Support all valid URI schemes and add testing (#293)
* Change origin whitelist to allow for all valid URIs
- Now supports +, -, and .
- Prevent whitelist from matching when preceded by unwanted characters
- URI must begin with letter
- URI Scheme syntax: https://tools.ietf.org/html/rfc3986#section-3.1
* Add jest testing framework and run it on CI
* Add tests for WebViewShared's createOnShouldStartLoadWithRequest
Typescript definitions are based on flow
Tested them a bit in my project
I think couple of event types are screwed in flow definitions (synthetic/non-synthetic are mixed), tried my best to test which events are really received.