Commit Graph

609 Commits

Author SHA1 Message Date
semantic-release-bot 5f7f4a19f2 chore(release): 8.2.0 [skip ci]
# [8.2.0](https://github.com/react-native-community/react-native-webview/compare/v8.1.2...v8.2.0) (2020-03-17)

### Features

* **Windows:** Windows support! ([#1220](https://github.com/react-native-community/react-native-webview/issues/1220)) ([ffee0d4](https://github.com/react-native-community/react-native-webview/commit/ffee0d4))
2020-03-17 02:32:43 +00:00
Kai Guo ffee0d4362
feat(Windows): Windows support! (#1220) 2020-03-16 19:30:25 -07:00
Luciano Lima 86c44588f8
chore(docs): Update React Native links to reactnative.dev (#1233) 2020-02-25 22:54:06 -08:00
semantic-release-bot 19896fc810 chore(release): 8.1.2 [skip ci]
## [8.1.2](https://github.com/react-native-community/react-native-webview/compare/v8.1.1...v8.1.2) (2020-02-21)

### Bug Fixes

* **Android:** Don't log the cookie when downloading file. ([#1224](https://github.com/react-native-community/react-native-webview/issues/1224)) ([2470245](https://github.com/react-native-community/react-native-webview/commit/2470245))
2020-02-21 19:05:47 +00:00
trcoffman 24702450f3
fix(Android): Don't log the cookie when downloading file. (#1224) 2020-02-21 11:02:50 -08:00
semantic-release-bot 118663287a chore(release): 8.1.1 [skip ci]
## [8.1.1](https://github.com/react-native-community/react-native-webview/compare/v8.1.0...v8.1.1) (2020-02-19)

### Bug Fixes

* **Android:** Don't show camera options for a file upload when they can not be used ([#1210](https://github.com/react-native-community/react-native-webview/issues/1210)) ([4093682](https://github.com/react-native-community/react-native-webview/commit/4093682))
2020-02-19 02:42:47 +00:00
Daniel Vicory 4093682e08
fix(Android): Don't show camera options for a file upload when they can not be used (#1210)
* Don't show camera options for a file upload that would result in nothing happening for the user.

On Android, if the application declares the camera permission, then even intents
that use the camera require permission to be granted. This is a problem for apps
that combine an in-app camera with a WebView that has file uploading and the user
has not given permission for the camera.

Note, this will not request permission for camera. This will simply prevent
showing the camera options that would be a no-op action for users. It does this
by checking if the camera permission is declared, and if so, checks that the
user has granted permission.

More information: https://blog.egorand.me/taking-photos-not-so-simply-how-i-got-bitten-by-action_image_capture/

* Add example and documentation about camera option availability in file uploads for Android.
2020-02-18 18:40:30 -08:00
Allan Santos 5024295633
chore(docs): Fix Getting Started Guide link in Breaking History (#1213) 2020-02-17 09:35:05 -08:00
António Goulão 6c8b8fc4b1
chore(docs): Update Android assets path (#1173) 2020-02-14 11:12:19 -08:00
Jason Safaiyeh 327bc6b7de
chore(docs): Update cookie links (#1149) 2020-02-13 05:50:22 -08:00
Dulmandakh e6241cbb6a
chore(Android): Convert RNCWebViewPackage to Kotlin (#1194)
* RN is implementation dependency

* renamed:    RNCWebViewPackage.java -> RNCWebViewPackage.kt

* migrate RNCWebViewPackage to Kotlin

Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com>
2020-02-12 17:12:24 -08:00
semantic-release-bot f65783d348 chore(release): 8.1.0 [skip ci]
# [8.1.0](https://github.com/react-native-community/react-native-webview/compare/v8.0.6...v8.1.0) (2020-02-12)

### Features

* **macOS:** macOS Support ([#1164](https://github.com/react-native-community/react-native-webview/issues/1164)) ([1e57231](https://github.com/react-native-community/react-native-webview/commit/1e57231))
2020-02-12 23:41:15 +00:00
Tom Underhill 1e572318ec
feat(macOS): macOS Support (#1164) 2020-02-12 15:39:11 -08:00
semantic-release-bot 31d015badf chore(release): 8.0.6 [skip ci]
## [8.0.6](https://github.com/react-native-community/react-native-webview/compare/v8.0.5...v8.0.6) (2020-01-30)

### Bug Fixes

* **Android:** Revert "Redirected URLs now redirect correctly. ([#991](https://github.com/react-native-community/react-native-webview/issues/991))" ([#1177](https://github.com/react-native-community/react-native-webview/issues/1177)) ([344aab5](https://github.com/react-native-community/react-native-webview/commit/344aab5))
2020-01-30 03:21:31 +00:00
Daniel Vicory 344aab591a
fix(Android): Revert "Redirected URLs now redirect correctly. (#991)" (#1177)
This reverts commit acf1ad7560.
2020-01-29 19:18:35 -08:00
semantic-release-bot d4efa1e7f5 chore(release): 8.0.5 [skip ci]
## [8.0.5](https://github.com/react-native-community/react-native-webview/compare/v8.0.4...v8.0.5) (2020-01-26)

### Bug Fixes

* **Android:** Redirected URLs now redirect correctly. ([#991](https://github.com/react-native-community/react-native-webview/issues/991)) ([acf1ad7](https://github.com/react-native-community/react-native-webview/commit/acf1ad7))
2020-01-26 08:27:01 +00:00
hanlh1 acf1ad7560 fix(Android): Redirected URLs now redirect correctly. (#991)
Co-authored-by: Jamon Holmgren <jamon@infinite.red>
Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com>
2020-01-26 00:25:24 -08:00
Tom Underhill bf1d645716 chore(example): Added three test examples: Alerts, Scrolling, and Background. 2020-01-21 11:39:40 -08:00
semantic-release-bot a466c0f62d chore(release): 8.0.4 [skip ci]
## [8.0.4](https://github.com/react-native-community/react-native-webview/compare/v8.0.3...v8.0.4) (2020-01-20)

### Bug Fixes

* **iOS:** Meta method 'UIScrollViewContentInsetAdjustmentBehavior:' conflict warning ([e6edc6d](https://github.com/react-native-community/react-native-webview/commit/e6edc6d)), closes [/github.com/facebook/react-native/blob/master/React/Views/ScrollView/RCTScrollViewManager.m#L40](https://github.com//github.com/facebook/react-native/blob/master/React/Views/ScrollView/RCTScrollViewManager.m/issues/L40)
2020-01-20 04:10:24 +00:00
Tommy Nguyen e6edc6dc73 fix(iOS): Meta method 'UIScrollViewContentInsetAdjustmentBehavior:' conflict warning
This converter is already defined in
[RCTScrollViewManager.m](https://github.com/facebook/react-native/blob/master/React/Views/ScrollView/RCTScrollViewManager.m#L40).

Redefining it in react-native-webview can cause undefined behaviour when
used. Since ScrollView is unlikely to go away, we can take a dependency on it.

All current tests should pass.

When building a React Native app with `react-native-webview`, the following
warning can be seen in the build logs:

```
Meta method 'UIScrollViewContentInsetAdjustmentBehavior:' in category from /~/Library/Developer/Xcode/DerivedData/App-geojljebaazfrrgvxfkjjpiwmdlg/Build/Products/Debug-iphonesimulator/React-Core/libReact-Core.a(RCTScrollViewManager.o) conflicts with same method from another category
```

The warning should go away after removing the offending function.

Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com>
2020-01-19 20:07:35 -08:00
Jesse Katsumata 3a9218031f chore(example): Added example app 2020-01-16 14:49:10 -08:00
Jamie Birch 5e8b4d5c2b chore(iOS): Extract wkWebViewConfig setup to setUpWkWebViewConfig function 2020-01-07 22:27:53 -08:00
semantic-release-bot f0cb28ff9a chore(release): 8.0.3 [skip ci]
## [8.0.3](https://github.com/react-native-community/react-native-webview/compare/v8.0.2...v8.0.3) (2020-01-08)

### Bug Fixes

* **whitelisted origins:** Prevent handling of un-whitelisted URLs ([0442126](https://github.com/react-native-community/react-native-webview/commit/0442126))
2020-01-08 01:21:14 +00:00
aarondail 0442126595 fix(whitelisted origins): Prevent handling of un-whitelisted URLs
* Preventing an unhandled promise rejection when: a URL is loaded by the WebView, but the URL isn't in the origin whitelist, so it is handed off to the OS to handle by calling Linking.openURL(), but Linking.openURL has an error.  The code wasn't catching the error, so this would result in an unhandled promise rejection. Now the error is being caught.

* Fixing a problem where a URL is handled to the OS to deal with, via Linking.openURL, and also loaded in the WebView by making those cases mutually exclusive (they weren't previously).  In more detail: when a URL is loaded by the WebView that isn't in the origin whitelist it is handled off to the OS to handle by calling Linking.openURL.  But, if the onShouldStartLoadWithRequest prop is set, then that function would also be called, and then that would determine whether the URL should be loaded.  This can result in a situation where the URL is passed to Linking.openURL and onShouldStartLoadWithRequest returns true so it is also loaded in the WebView.  The client can fix this by duplicating the origin whitelist logic in their onShouldStartLoadWithRequest of course, but this change makes it so they don't have to.

Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com>
2020-01-07 17:18:43 -08:00
Jesse Katsumata 13ae8c9661 chore(README): Lean Core badge
* docs: add Lean core badge

* docs: adjust badge style
2020-01-06 17:34:15 -08:00
dependabot[bot] 07a87131dc chore(deps): bump npm from 6.11.3 to 6.13.4 (#1079)
Bumps [npm](https://github.com/npm/cli) from 6.11.3 to 6.13.4.
- [Release notes](https://github.com/npm/cli/releases)
- [Changelog](https://github.com/npm/cli/blob/latest/CHANGELOG.md)
- [Commits](https://github.com/npm/cli/compare/v6.11.3...v6.13.4)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-27 11:54:35 +01:00
semantic-release-bot c4f8a74763 chore(release): 8.0.2 [skip ci]
## [8.0.2](https://github.com/react-native-community/react-native-webview/compare/v8.0.1...v8.0.2) (2019-12-27)

### Bug Fixes

* **iOS:** WKWebView RetainCycle ([#1096](https://github.com/react-native-community/react-native-webview/issues/1096)) ([4f4644f](https://github.com/react-native-community/react-native-webview/commit/4f4644f))
2019-12-27 10:42:43 +00:00
Jason Safaiyeh 8a9836c703 chore(docs): Add 8.0.0 to Breaking History on README (#1085) 2019-12-27 11:40:37 +01:00
sunzhongliang 4f4644ffd8 fix(iOS): WKWebView RetainCycle (#1096) 2019-12-27 11:39:53 +01:00
semantic-release-bot 7ba1bc5129 chore(release): 8.0.1 [skip ci]
## [8.0.1](https://github.com/react-native-community/react-native-webview/compare/v8.0.0...v8.0.1) (2019-12-17)

### Bug Fixes

* **iOS:** Ignore WebKitDomainError 101 ([#961](https://github.com/react-native-community/react-native-webview/issues/961)) ([adb5608](https://github.com/react-native-community/react-native-webview/commit/adb5608))
2019-12-17 09:57:33 +00:00
Ben Wildeman adb5608116 fix(iOS): Ignore WebKitDomainError 101 (#961) 2019-12-17 10:55:26 +01:00
semantic-release-bot ce565f4832 chore(release): 8.0.0 [skip ci]
# [8.0.0](https://github.com/react-native-community/react-native-webview/compare/v7.6.0...v8.0.0) (2019-12-16)

### Features

* **ios:** Generate history API events on iOS ([#1082](https://github.com/react-native-community/react-native-webview/issues/1082)) ([3615296](https://github.com/react-native-community/react-native-webview/commit/3615296))

### BREAKING CHANGES

* **ios:** if you use onNavigationStateChange on iOS it will now trigger on # changes to the url.

* Hook the `window.history` API on iOS to generate events

The underlying WKWebView doesn't seem to generate any events in response to the `window.history` API - none of the `WKNavigationDelegate` methods fire.

Given this limitation, the only way to know when the location changes via this API is to inject Javascript into the page and have it notify the native code directly when any of these functions are called.

The `setTimeout` call gives up the current tick, allowing the location to change before firing the event.

* Remove the outdated section about hash changes

Now that this bug is fixed, the workaround is no longer required.
2019-12-16 16:55:26 +00:00
Jason Safaiyeh 361529630f feat(ios): Generate history API events on iOS (#1082)
BREAKING CHANGE: if you use onNavigationStateChange on iOS it will now trigger on # changes to the url.

* Hook the `window.history` API on iOS to generate events

The underlying WKWebView doesn't seem to generate any events in response to the `window.history` API - none of the `WKNavigationDelegate` methods fire.

Given this limitation, the only way to know when the location changes via this API is to inject Javascript into the page and have it notify the native code directly when any of these functions are called.

The `setTimeout` call gives up the current tick, allowing the location to change before firing the event.

* Remove the outdated section about hash changes

Now that this bug is fixed, the workaround is no longer required.
2019-12-16 17:52:54 +01:00
semantic-release-bot c4001338c1 chore(release): 7.6.0 [skip ci]
# [7.6.0](https://github.com/react-native-community/react-native-webview/compare/v7.5.2...v7.6.0) (2019-12-06)

### Bug Fixes

* **ios:** Make allowFileAccessFromFileURLs work in iOS. ([#1061](https://github.com/react-native-community/react-native-webview/issues/1061)) ([88b6498](https://github.com/react-native-community/react-native-webview/commit/88b6498))

### Features

* **iOS:** new prop injectedJavaScriptBeforeContentLoaded ([#1038](https://github.com/react-native-community/react-native-webview/issues/1038)) ([604495e](https://github.com/react-native-community/react-native-webview/commit/604495e))
2019-12-06 10:19:05 +00:00
StasD 88b64981f4 fix(ios): Make allowFileAccessFromFileURLs work in iOS. (#1061) 2019-12-06 11:16:56 +01:00
Salvatore Randazzo 604495e399 feat(iOS): new prop injectedJavaScriptBeforeContentLoaded (#1038)
* Run the injectedJavaScript on DocumentStart for iOS

* Add new prop injectedJavaScriptBeforeContentLoaded
Update types
Update docs

* Self review
2019-12-06 11:15:02 +01:00
semantic-release-bot 5ddd6c6fc2 chore(release): 7.5.2 [skip ci]
## [7.5.2](https://github.com/react-native-community/react-native-webview/compare/v7.5.1...v7.5.2) (2019-11-26)

### Bug Fixes

* **android:** Added fallback poster image to prevent crashes ([#1036](https://github.com/react-native-community/react-native-webview/issues/1036)) ([d8acd90](https://github.com/react-native-community/react-native-webview/commit/d8acd90))
* **build:** Android build errors when using Gradle 6.0 ([#1037](https://github.com/react-native-community/react-native-webview/issues/1037)) ([5b0c634](https://github.com/react-native-community/react-native-webview/commit/5b0c634))
2019-11-26 09:44:12 +00:00
Conner Owen 5b0c634f15 fix(build): Android build errors when using Gradle 6.0 (#1037)
* Fix Android build errors when using Gradle 6.0

* Update gradle.properties

* Remove newline at end of file

* newline
2019-11-26 10:41:16 +01:00
Vladimir d8acd9086c fix(android): Added fallback poster image to prevent crashes (#1036) 2019-11-26 10:40:38 +01:00
Andrei Pfeiffer 71a375f898 chore(cleaning): Remove old comments (#1019) 2019-11-14 10:48:58 +01:00
Stanislav Shakirov 351adba284 chore(buildtools): enable --frozen-lockfile yarn flag (#1005)
that is required for reproducible dependencies which is usually common on CI
2019-11-13 10:58:27 +01:00
Stanislav Shakirov 30d63a1773 chore(buildtools): Use fixed version of cocoapods gem on ci (#1006)
install exact version instead of latest one
2019-11-13 10:57:52 +01:00
Thibault Malbranche ef5c36c88e
chore(docs): Document request focus method 2019-11-13 10:43:25 +01:00
semantic-release-bot 4c2feefbcc chore(release): 7.5.1 [skip ci]
## [7.5.1](https://github.com/react-native-community/react-native-webview/compare/v7.5.0...v7.5.1) (2019-11-13)

### Bug Fixes

* **android:** Fix ClassCastException when doing native things([#987](https://github.com/react-native-community/react-native-webview/issues/987)) ([7e68da4](https://github.com/react-native-community/react-native-webview/commit/7e68da4))
2019-11-13 09:38:56 +00:00
Nikhil Chitlur Navakiran 7e68da4ffe fix(android): Fix ClassCastException when doing native things(#987) 2019-11-13 10:36:08 +01:00
semantic-release-bot 9dff31258d chore(release): 7.5.0 [skip ci]
# [7.5.0](https://github.com/react-native-community/react-native-webview/compare/v7.4.4...v7.5.0) (2019-11-12)

### Features

* **android:** add clearHistory, clearCache and clearFormData ([#450](https://github.com/react-native-community/react-native-webview/issues/450)) ([4a4f4a2](https://github.com/react-native-community/react-native-webview/commit/4a4f4a2))
2019-11-12 09:11:34 +00:00
Stanislav Shakirov 4a4f4a2c45 feat(android): add clearHistory, clearCache and clearFormData (#450)
* add clearHistory, clearCache and clearFormData android webview api.

* remove pointless `async`

* add docs for new android webview methods

* Update Reference.md

* update commands types

* add more strict type for RNCWebViewUIManager `Commands` property
2019-11-12 10:09:16 +01:00
semantic-release-bot 5d6128909c chore(release): 7.4.4 [skip ci]
## [7.4.4](https://github.com/react-native-community/react-native-webview/compare/v7.4.3...v7.4.4) (2019-11-12)

### Bug Fixes

* **android:** crash problem while loading local html resource ([#1010](https://github.com/react-native-community/react-native-webview/issues/1010)) ([05c286f](https://github.com/react-native-community/react-native-webview/commit/05c286f))
2019-11-12 09:08:48 +00:00
Dani Akash 6088dd9f06 chore(docs): Steps to load local HTML files into the webview (#1008)
Fixes #746 

These steps are based on my other project React native draftjs which requires loading a local HTML file. The code can be found in the following line - bc51410117/index.js (L113)
2019-11-12 10:06:35 +01:00
小米-余乐 05c286fc23 fix(android): crash problem while loading local html resource (#1010) 2019-11-12 10:05:29 +01:00