Commit Graph

45 Commits

Author SHA1 Message Date
Jian Wei 08cc600eb8 feat(WKWebView): add prop `directionalLockEnabled` for iOS (#389) 2019-03-07 10:27:29 +01:00
Thibault Malbranche 2cef5cbb3f
fix(WKWebView Scrolling): fixed broken scroll (#372)
fixes #371
2019-03-01 10:46:53 +01:00
Chet Corcos 0e6e92a7f1 fix(WKWebview Scroll): Don't allow the scrollView to scroll when `scrollEnabled={false}`. (#158)
* Don't allow the scrollview to scroll the WebView body.

* Readme comment

* Remove duplicate protocol def
2019-02-28 22:01:42 +01:00
Christoph Jerolimov f27f13e931 fix(WKWebView): resolved crash with WebKit on iOS 9.x. (#342)
This PR fixes two crashes when enableWebKit is true (which was the default) on iOS 9.x. The first one when the WebView component was mounted (fixes issue #150) and the second one, when the component was unmounted (fixes issue #213).

The first problem happen when the RNCWKWebView.m was loaded:

The programming guide for WebKit (version 2006) ([pdf](http://mirror.informatimago.com/next/developer.apple.com/documentation/Cocoa/Conceptual/DisplayWebContent/WebKit_DisplayWebContent.pdf)) from Apple said, that it is (was) required to check if the 'new' WebKit Framework was available. This was required when the WebKit framework was only available on Mac OS X (10.2) when the Safari was installed. 😆

Because WebKit is (currently..) a fix part of iOS we didn't need this check this anymore to determinate if WebKit is available. I also see no other reference that this is required in iOS so I just remove this code. Without this code the WebView works also on iOS 9.x.

The second issue happen when the WKWebView was removed from the native view hierarchy. Its required (only on iOS 9) to remove the UIScrollView delegate before cleaning up the webview.

Its possible to try this PR with:

```
npm install --save "react-native-webview@jerolimov/react-native-webview#fix-ios9-crash"
# or
yarn add "react-native-webview@jerolimov/react-native-webview#fix-ios9-crash"
```

If you use CocoaPods, you should also update your Pods with

```
cd ios && pod update && cd ..
```
2019-02-14 15:18:15 +01:00
Jordan Sexton 92c20581ae feat(toggle scroll bar): added new props showsVerticalScrollIndicator / showsHorizontalScrollIndicator (#250) 2019-02-12 14:47:24 +01:00
Maosen Jason Hu fc5fd242e2 feat(wkwebview): create api to allow clients to present a client credential for authentication (#141)
* In order for TLS Mutual Auth to work for webviews, the caller must present a credential. Expose a setter that can be called to set a credential.
2019-02-12 10:35:14 +01:00
Alexander Stammbach 3f58b0e597 fix(WKWebView.m): Reapplied #134 with additional checks to tackle unintentional scrolls (#296) 2019-02-06 15:29:59 +01:00
Thibault Malbranche d5fc028383 fix(PostMessage): Renamed ReactNativeWebview to ReactNativeWebView
fixes #304
2019-02-01 22:04:11 +01:00
Thibault Malbranche f3bdab5a22
feat(Android/iOS postMessage): refactoring the old postMessage implementation (#303)
fixes #29
fixes #272
fixes #221
fixes #105
fixes #66

BREAKING CHANGE: Communication from webview to react-native has been completely rewritten. React-native-webview will not use or override window.postMessage anymore. Reasons behind these changes can be found throughout so many issues that it made sense to go that way.

Instead of using window.postMessage(data, *), please now use window.ReactNativeWebView.postMessage(data).

Side note: if you wish to keep compatibility with the old version when you upgrade, you can use the injectedJavascript prop to do that:

const injectedJavascript = `(function() {
  window.postMessage = function(data) {
    window.ReactNativeWebView.postMessage(data);
  };
})()`;

Huge thanks to @jordansexton and @KoenLav!
2019-02-01 18:37:28 +01:00
Benjos Antony 6643a8e38d feat(WKwebview): Allow _target links to be opened up in the same way as UIWebView. (#270)
Fixes #139
2019-02-01 02:18:02 +01:00
Michael Diarmid 83ce79ff89 feat(iOS/Android): Add `cacheEnabled` prop (#152)
Added a new cacheEnabled prop to toggle Android & iOS webview caching behavior.

BREAKING CHANGE:  This change makes caching enabled by default when previously there was no caching behavior which may cause unexpected behaviour changes in your existing implementations.
2019-01-30 10:32:46 +01:00
Chet Corcos 4bc1dc20fd fix(WKWebview): Update webview property when allowsBackForwardNavigationGestures prop changes (#173) 2019-01-11 19:53:55 +01:00
José Luis Pereira 6f612242fe fix(WKWebView): Add "Frame load interrupted" error handling for OAuth (#147) 2019-01-11 15:01:49 +01:00
José Luis Pereira 62f871c186 feat(WKWebview): Add incognito prop to iOS WKWebview
Allows the webview to be opened with an ephemeral data storage.
2019-01-11 14:59:03 +01:00
kylemantesso afadc62ada feat(WKWebview): Add shared process pool so cookies and localStorage are shared across webviews in iOS (#138)
* fix(WKWebview): [iOS] Add shared process pool so cookies and localStorage are shared across webviews (#68)

* Add optional shared process pool

BREAKING CHANGE: useSharedProcessPool prop is set to true by default. If you want the old behavior, please use useSharedProcessPool={false}
2019-01-07 15:19:32 +01:00
Ryan Linton 9f37ddea61 fix(WKWebview): Reverts #134, fixes issue where keyboard dismiss would scroll to top (#210) 2018-12-14 15:01:58 -08:00
Ryan Linton ec469cf00d fix(WKWebview): Surface evaluateJavaScript errors (#179)
In the current code using `startInLoadingState` and `injectedJavaScript` will result in an infinite loading state if `injectedJavaScript` fails to evaluate for some reason. This adds a red box error explaining there was a failure to evaluate javascript. In my case this was do to the JS string not returning a valid type so I've added a that as a potential solution in the error message and added some documentation to the API Reference with some additional warnings.

To reproduce the existing behavior setup a webview with `startInLoadingState` and `injectedJavaScript` that returns an invalid type (in my case it returned a function). You should see an infinite loading state as `onLoadEnd` is never called.

Try the same with this branch and you'll get a nice red box error suggesting one potential solution to the problem.

![simulator screen shot - iphone 8 plus - 2018-11-28 at 15 09 25](https://user-images.githubusercontent.com/1944151/49193714-fccde100-f334-11e8-89dc-bf220e0adf23.png)
2018-12-14 11:24:52 +01:00
npm-ued 41d9bdcce4 fix(WKWebview): Fixed non-working iOS alert. (#188) 2018-12-14 11:18:48 +01:00
Jermaine Oosterling 731dd03fc6 feat(WKWebView): [ios] Add allowsLinkPreview property to WKWebView (#170)
* [ios] Add ‘allowsLinkPreview’ property to iOS WKWebView.

* Add divider in docs

* Typo: add hyphen -> _allowsLinkPreview
2018-11-25 11:17:28 +01:00
wiscat 4870e1f06a feat(WKWebview): [ios] Add 'pagingEnabled' property to the iOS WKWebview (#165) 2018-11-22 13:58:07 +01:00
Neil 2b9292ed1c fix(WKWebView): Fix the message handle bug. (#143)
* fix webview always recreate

* fix webview always recreate

* code format

* Update RNCWKWebView.m

* @bugfix fix the message handle problem
2018-11-20 01:48:26 +01:00
Tom 5425039ff4 feat(WKWebview): Add fix for keyboard dismiss leaving viewport shifted in iOS 12 (#134) 2018-11-19 11:21:36 +01:00
ifsnow c0c0116c80 fix(WKWebview): Fixed for supporting mediaPlaybackRequiresUserAction option under iOS 10. (#129) 2018-11-19 11:17:57 +01:00
Bae Hyeonseung 2ec5fa514e feat(WKWebview): Add 'userAgent' property to the iOS WKWebView. (#112)
* Add 'userAgent' property to the iOS WKWebView

* Update 'userAgent' reference docs.
2018-11-19 11:13:31 +01:00
Bae Hyeonseung 7f35344632 feat(WKWebview): [iOS] Add 'allowsBackForwardNavigationGestures' property (#97) 2018-10-21 23:12:59 +02:00
Neil 3c4f78df2e feat(WKWebView): Fix recreate bug when moving to window (#84)
* Fixes #81 
* Fixes #72
2018-10-18 08:34:00 +02:00
marcelkalveram 34512f3c38 feat(New WebView Prop): [iOS] add hideKeyboardAccessoryView option (#67)
* add hideKeyboardAccessoryView option

* add hideKeyboardAccessoryView prop to reference
2018-10-17 16:59:19 +02:00
黎明 b5aaf5c800 feat(webview props) onLoadProgresss property (#53)
* Added the onLoadProgress property to the iOS wkwebview and Android webview
2018-10-17 15:08:52 +02:00
phonezawphyo 02521f542c
Update RNCWKWebView.m 2018-09-29 01:10:12 +09:00
Thibault Malbranche 15c529a333 RNCWorkspace 2018-09-18 18:33:51 +02:00
Thibault Malbranche 8650098581 Revert "Last native change"
This reverts commit 2444940540.
2018-09-18 18:33:22 +02:00
Thibault Malbranche 2444940540 Last native change 2018-09-18 18:33:06 +02:00
Thibault Malbranche 0de29728a6 Native Changes 2018-09-18 18:32:16 +02:00
Thibault Malbranche f486eb2dde FIX build iOS 2018-09-18 14:56:43 +02:00
Jamon Holmgren 922151ec42 WIP: WebView extraction - iOS working both UI and WK versions 2018-09-08 14:50:13 -07:00
Jamon Holmgren 6123deaf12 WIP: WebView extraction - renamed RNC to RCTWebView 2018-09-08 14:17:19 -07:00
Jamon Holmgren 2fd5612422 WIP: Migrating to WKWebView 2018-09-08 14:11:42 -07:00
Jamon Holmgren ba4912595d Remove WebTest 2018-09-07 21:16:30 -07:00
Jamon Holmgren fafed77456 Update xcode files 2018-09-07 21:15:25 -07:00
Jamon Holmgren 52fbf09e29 🦅 WIP: Update to WKWebView - Replace UIWebView with WKWebView 2018-09-07 21:11:49 -07:00
Jamon Holmgren bc3be5ecaa Removes copyright notices from file headers 2018-08-15 19:25:15 -07:00
Jamon Holmgren bd2c3bc8c2 iOS Webview now using local RNCWebView 2018-08-03 00:12:40 -07:00
Jamon Holmgren 52ba380e4a Added RNCWebViewManager to xcode proj 2018-08-02 23:52:31 -07:00
Jamon Holmgren e9a6c6134f Rename back to RCT 2018-08-02 22:00:43 -07:00
Jamon Holmgren af0057a321 Reshuffling 2018-08-02 21:41:20 -07:00