Commit Graph

637 Commits

Author SHA1 Message Date
Bill Xie 283fe124b3
fix(ios): error on iOS < 13(#1843)
* fix:iOS13  scrollView.automaticallyAdjustsScrollIndicatorInsets default value YES which make the webview vertical indicator position in wrong offset

* added types and doc

* fix: breaking bug for props not include under iOS13

Co-authored-by: BillHsieh <xietian@meitunmama.com>
Co-authored-by: xietian <xietian@innotechx.com>
Co-authored-by: Thibault Malbranche <thibault.malbranche@epitech.eu>
Co-authored-by: Thibault Malbranche <malbranche.thibault@gmail.com>
2021-01-25 13:54:42 +01:00
semantic-release-bot 359ef90ddc chore(release): 11.2.0 [skip ci]
# [11.2.0](https://github.com/react-native-webview/react-native-webview/compare/v11.1.0...v11.2.0) (2021-01-20)

### Features

* **iOS & MacOS:** allowUniversalAccessFromFileURLs property([#1730](https://github.com/react-native-webview/react-native-webview/issues/1730)) ([8d098ef](8d098efce7))
2021-01-20 18:34:49 +00:00
RecianuCiprian 8d098efce7
feat(iOS & MacOS): allowUniversalAccessFromFileURLs property(#1730)
* Added allowUniversalAccessFromFileURLs property to iOS and macOS
Updated the types to include allowUniversalAccessFromFileURLs and allowFileAccessFromFileURLs for iOS and macOS
Updated the Reference.md to include in the allowUniversalAccessFromFileURLs section iOS and macOS

* Updated platform in the type definition
2021-01-20 19:31:42 +01:00
semantic-release-bot b2f9ed228e chore(release): 11.1.0 [skip ci]
# [11.1.0](https://github.com/react-native-webview/react-native-webview/compare/v11.0.3...v11.1.0) (2021-01-20)

### Features

* **iOS 13+:** automaticallyAdjustsScrollIndicatorInsets prop ([#1077](https://github.com/react-native-webview/react-native-webview/issues/1077)) ([d46a6d3](d46a6d3c69))
2021-01-20 18:12:08 +00:00
Bill Xie d46a6d3c69
feat(iOS 13+): automaticallyAdjustsScrollIndicatorInsets prop (#1077)
* fix:iOS13  scrollView.automaticallyAdjustsScrollIndicatorInsets default value YES which make the webview vertical indicator position in wrong offset

* added types and doc

Co-authored-by: BillHsieh <xietian@meitunmama.com>
Co-authored-by: xietian <xietian@innotechx.com>
Co-authored-by: Thibault Malbranche <thibault.malbranche@epitech.eu>
Co-authored-by: Thibault Malbranche <malbranche.thibault@gmail.com>
2021-01-20 19:09:27 +01:00
Joshua Smith 4b479d6d3f
chore(docs): update repo references with new repo location (#1657)
Co-authored-by: Thibault Malbranche <thibault.malbranche@epitech.eu>
2021-01-20 18:49:11 +01:00
Kevin Tuazon 43443d8ca8
chore(docs): Update Custom-Android.md (#1787)
Updates ReactWebViewClient to RNCWebViewClient
2021-01-20 18:45:45 +01:00
Ralph Maamari 808762f8bb
chore(docs): Update README.md (#1788)
Updated README for V11
2021-01-20 18:45:17 +01:00
inokawa cf1f3a9917
chore(docs): Fix link to v2.0.0 (#1806) 2021-01-20 18:44:49 +01:00
semantic-release-bot 6880289796 chore(release): 11.0.3 [skip ci]
## [11.0.3](https://github.com/react-native-community/react-native-webview/compare/v11.0.2...v11.0.3) (2021-01-13)

### Bug Fixes

* **iOS:** restore cookie handling for iOS <= 10 ([#1728](https://github.com/react-native-community/react-native-webview/issues/1728)) ([d338cae](d338cae57a))
2021-01-13 14:01:19 +00:00
Jacob Müller d338cae57a
fix(iOS): restore cookie handling for iOS <= 10 (#1728) 2021-01-13 14:55:36 +01:00
semantic-release-bot 816c4a4038 chore(release): 11.0.2 [skip ci]
## [11.0.2](https://github.com/react-native-community/react-native-webview/compare/v11.0.1...v11.0.2) (2020-12-08)

### Bug Fixes

* **android:** changed initial value of nextLockIdentifier from 0 to 1 ([#1689](https://github.com/react-native-community/react-native-webview/issues/1689)) ([53c0382](53c0382cd0))
2020-12-08 04:01:49 +00:00
Christian Nilsson 53c0382cd0
fix(android): changed initial value of nextLockIdentifier from 0 to 1 (#1689)
Co-authored-by: Jamon Holmgren <jamonholmgren@gmail.com>
2020-12-08 04:56:28 +01:00
semantic-release-bot f1e7f3dc4a chore(release): 11.0.1 [skip ci]
## [11.0.1](https://github.com/react-native-community/react-native-webview/compare/v11.0.0...v11.0.1) (2020-12-05)

### Bug Fixes

* **ts:** onScroll event type ([#1631](https://github.com/react-native-community/react-native-webview/issues/1631)) ([84b7177](84b7177d21))
2020-12-05 19:32:13 +00:00
Nizomiddin Toshpulatov 84b7177d21
fix(ts): onScroll event type (#1631)
* Fix onScroll event type

* Update documentation

* Address PR feedback
2020-12-05 20:29:37 +01:00
Thibault Malbranche d08d000a54
Update windows-ci.yml 2020-11-27 17:56:01 +01:00
Thibault Malbranche 321d9bdfb6
Update windows-ci.yml 2020-11-27 12:51:41 +01:00
Thibault Malbranche 187dd0a835
Update stale.yml 2020-11-27 12:39:21 +01:00
semantic-release-bot aaf788169b chore(release): 11.0.0 [skip ci]
# [11.0.0](https://github.com/react-native-community/react-native-webview/compare/v10.10.2...v11.0.0) (2020-11-24)

### Features

* **android:** Introduce setSupportMultipleWindows to mitigate CVE-2020-6506 ([#1747](https://github.com/react-native-community/react-native-webview/issues/1747) by [@mrcoinbase](https://github.com/mrcoinbase) and [@kelset](https://github.com/kelset) -- THANK YOU!) ([194c6a2](194c6a2335))

### BREAKING CHANGES

* **android:** This release introduces the `setSupportMultipleWindows` prop for Android. This sets the underlying Android WebView setting `setSupportMultipleWindows`. This prop defaults to `true` (previously `false`), and serves to mitigate the security advisory [CVE-2020-6506](https://github.com/react-native-webview/react-native-webview/security/advisories/GHSA-36j3-xxf7-4pqg).

The primary way this new behavior changes existing React Native WebView implementations on Android is that links that open in new tabs/windows (such as `<a target="_blank">`) will now prompt to open in the system browser, rather than re-using the current WebView.

If this behavior is not desirable, you can set this new prop to `false`, but be aware that this exposes your app to the security vulnerability listed above. Make sure you have read and understand the whole advisory and relevant links.

iOS & Windows are unaffected.

```jsx
<WebView
  // ...
  setSupportMultipleWindows={true} // default: true
/>
```

Thanks to @mrcoinbase, @kelset, and @Titozzz for their work on this.
2020-11-24 17:20:20 +00:00
Lorenzo Sciandra 194c6a2335
feat(android): Introduce setSupportMultipleWindows to mitigate CVE-2020-6506 (#1747 by @mrcoinbase and @kelset -- THANK YOU!)
BREAKING CHANGE:

This release introduces the `setSupportMultipleWindows` prop for Android. This sets the underlying Android WebView setting `setSupportMultipleWindows`. This prop defaults to `true` (previously `false`), and serves to mitigate the security advisory [CVE-2020-6506](https://github.com/react-native-webview/react-native-webview/security/advisories/GHSA-36j3-xxf7-4pqg).

The primary way this new behavior changes existing React Native WebView implementations on Android is that links that open in new tabs/windows (such as `<a target="_blank">`) will now prompt to open in the system browser, rather than re-using the current WebView.

If this behavior is not desirable, you can set this new prop to `false`, but be aware that this exposes your app to the security vulnerability listed above. Make sure you have read and understand the whole advisory and relevant links.

iOS & Windows are unaffected.

```jsx
<WebView
  // ...
  setSupportMultipleWindows={true} // default: true
/>
```

Thanks to @mrcoinbase, @kelset, and @Titozzz for their work on this.
2020-11-24 09:15:19 -08:00
semantic-release-bot 1b009dd746 chore(release): 10.10.2 [skip ci]
## [10.10.2](https://github.com/react-native-community/react-native-webview/compare/v10.10.1...v10.10.2) (2020-11-06)

### Bug Fixes

* **android:** Unset mWebChromeClient on WebViewManager rather than WebView ([#1720](https://github.com/react-native-community/react-native-webview/issues/1720)) ([c95c0ea](c95c0ea923))
2020-11-06 23:08:39 +00:00
Harsh Chokshi c95c0ea923
fix(android): Unset mWebChromeClient on WebViewManager rather than WebView (#1720) 2020-11-07 00:05:18 +01:00
semantic-release-bot 4ec290d3f5 chore(release): 10.10.1 [skip ci]
## [10.10.1](https://github.com/react-native-community/react-native-webview/compare/v10.10.0...v10.10.1) (2020-11-06)

### Bug Fixes

* **windows:** Resolve Missing Deploy Target ([#1716](https://github.com/react-native-community/react-native-webview/issues/1716) by [@chiaramooney](https://github.com/chiaramooney)) ([8bd0b41](8bd0b41381))
2020-11-06 20:26:46 +00:00
Chiara Mooney 8bd0b41381
fix(windows): Resolve Missing Deploy Target (#1716 by @chiaramooney) 2020-11-06 12:22:48 -08:00
semantic-release-bot 74872a1f02 chore(release): 10.10.0 [skip ci]
# [10.10.0](https://github.com/react-native-community/react-native-webview/compare/v10.9.3...v10.10.0) (2020-10-26)

### Features

* **windows:** JS-WebView messaging bridge & multiple WebViews fixes ([#1617](https://github.com/react-native-community/react-native-webview/issues/1617)) ([b930e25](b930e25a8f))
2020-10-26 13:07:46 +00:00
Tero Paananen b930e25a8f
feat(windows): JS-WebView messaging bridge & multiple WebViews fixes (#1617)
* Manage to build webview using Visual Studio

* WebView in content of UserControl

* Destructor not needed

* Example app tested

* Add messagingEnabled prop

* WebViewBridge

* Message posting

* Store bridge as instance variable

* Use bridge if messagingEnabled

* Free event delegate

* PostMessage api uses string message

* script.notify() usage removed

* Debug log removed

* Bridge reference added

* Base for web allowed object implemented c++/winrt

* Bribge works

* "Microsoft.Windows.CppWinRT" version="2.0.200729.8"

* Update bridge implementation

* version changes

* Reference fix

* WebView prj builds

* yarn lock update

* Platfrom version update

* NuGet package reference updated

* Messaging test added into example app

* Typo fix

* try_as() to as() calls

* WebView.PostMessage() not supported anymore, use injectJavaScript

* Fix WebView.postMessage to work using injectJavascript

* Eval postMessage fix

* postMessage via injectJavascript

* Example fixed to handle postMessage call
2020-10-26 14:01:40 +01:00
semantic-release-bot 63984157fa chore(release): 10.9.3 [skip ci]
## [10.9.3](https://github.com/react-native-community/react-native-webview/compare/v10.9.2...v10.9.3) (2020-10-22)

### Bug Fixes

* **android:** Update SSL error handling ([#1466](https://github.com/react-native-community/react-native-webview/issues/1466)) ([ef48d35](ef48d35e95))
2020-10-22 07:40:02 +00:00
Alesandro Ortiz ef48d35e95
fix(android): Update SSL error handling (#1466)
* Update SSL error handling for Android WebView

Update SSL error handling to call onReceivedError() only on top-level navigations. This prevents iframes and other subresources from causing user-visible SSL error messages. The desired behavior is only to have top-level navigations show user-visible error messages. All other requests should be cancelled automatically with no user-visible error message.

* Update RNCWebViewManager.java

Clarify comments and add warning on blocked subresource

Co-authored-by: Thibault Malbranche <thibault.malbranche@epitech.eu>
2020-10-22 09:35:31 +02:00
Christopher Pfohl 1bc38da53f
docs: update injectedJavascript ios docs (#1704 bu @Crisfole) 2020-10-21 08:52:28 -07:00
semantic-release-bot 4d8a76f369 chore(release): 10.9.2 [skip ci]
## [10.9.2](https://github.com/react-native-community/react-native-webview/compare/v10.9.1...v10.9.2) (2020-10-05)

### Bug Fixes

* **macOS:** Don't include iOS pull-to-refresh control ([#1636](https://github.com/react-native-community/react-native-webview/issues/1636)) ([dbf4659](dbf46593fa))
* **podspec:** Lowered deployment target for MacOS to 10.13 ([#1673](https://github.com/react-native-community/react-native-webview/issues/1673)) ([f204195](f2041955a2))
2020-10-05 15:20:28 +00:00
Brandon Lax dbf46593fa
fix(macOS): Don't include iOS pull-to-refresh control (#1636)
* Update RNCWebView.h

Limit methods relating to pull to refresh to only iOS

* Update RNCWebView.m

Block methods relating to pull to refresh when the target is macOS as macOS does not have the UIRefreshControl

Co-authored-by: Eloy Durán <eloy.de.enige@gmail.com>
2020-10-05 17:14:42 +02:00
Matteo Pagani f2041955a2
fix(podspec): Lowered deployment target for MacOS to 10.13 (#1673) 2020-10-05 17:12:56 +02:00
semantic-release-bot 2d24131910 chore(release): 10.9.1 [skip ci]
## [10.9.1](https://github.com/react-native-community/react-native-webview/compare/v10.9.0...v10.9.1) (2020-09-29)

### Bug Fixes

* **ios:** Xcode 12 compatibility ([#1643](https://github.com/react-native-community/react-native-webview/issues/1643)) ([08b7099](08b709967f))
2020-09-29 17:23:14 +00:00
Radek Czemerys 08b709967f
fix(ios): Xcode 12 compatibility (#1643)
* fix: add React-Core to podspec for Xcode 12 compatibility

https://github.com/facebook/react-native/issues/29633

* chore: remove React dependency
2020-09-29 19:18:15 +02:00
Jamon Holmgren a83596eac2
chore(docs): Add other breaking changes to README
[skip ci]
2020-09-25 09:27:30 -07:00
semantic-release-bot a482a74108 chore(release): 10.9.0 [skip ci]
# [10.9.0](https://github.com/react-native-community/react-native-webview/compare/v10.8.3...v10.9.0) (2020-09-15)

### Features

* **iOS:** Add prop autoManageStatusBarEnabled ([#914](https://github.com/react-native-community/react-native-webview/issues/914)) ([22a60fd](22a60fd23a))
2020-09-15 00:45:42 +00:00
Kesha Antonov 22a60fd23a
feat(iOS): Add prop autoManageStatusBarEnabled (#914)
Co-authored-by: Jamon Holmgren <jamon@infinite.red>
Co-authored-by: Jamon Holmgren <jamonholmgren@gmail.com>
Co-authored-by: Thibault Malbranche <thibault.malbranche@epitech.eu>
2020-09-15 02:42:09 +02:00
Dominic Lee 40814101be
chore(docs): remove hash url change note (#1622) 2020-09-08 23:55:50 +02:00
iou90 4c4399cd57
Fix(types): Update Typescript definition file, declaring WebView class as a generic class (#1604)
Co-authored-by: iou90kant <dekang.liu@guokr.com>
2020-09-05 13:19:50 +02:00
semantic-release-bot 4840eeb588 chore(release): 10.8.3 [skip ci]
## [10.8.3](https://github.com/react-native-community/react-native-webview/compare/v10.8.2...v10.8.3) (2020-08-31)

### Bug Fixes

* **types:** Update Typescript definition file ([#1597](https://github.com/react-native-community/react-native-webview/issues/1597)) ([9dcd108](9dcd108b1f))
2020-08-31 13:23:56 +00:00
Mathieu Bruguier 9dcd108b1f
fix(types): Update Typescript definition file (#1597) 2020-08-31 15:18:57 +02:00
Daniel Vicory 4d4b5e2387
Synchronously decide if Android WebView should load a URL or not. (#1590)
This solves a class of issues when the WebView loses "context"
that a subsequent page load is the same as what was attempted
to be loaded previously. This solves a bug where a HTTP redirect
in combination with history manipulations causes a user to be
stuck and prevented from going back. Since WebView requests are
allowed to happen normally, debugging the WebView and tracking
redirects and page load initiators is more accurate and easier.
This will also bypass bridge latency and provide a faster navigation.

To do this, we must lock in the shouldOverrideUrlLoading callback
and send an event to JS. Currently, this callback is ran on
the main UI thread, of which we have no control over. This is
problematic as using the bridge in most ways seems to require
the main UI thread, which will cause a deadlock. However, using
BatchedBridge for Java->JS and a synchronous method for JS->Java
doesn't cause any problems. Additionally, it's been designed so
that if WebView suddenly runs the callback on a different thread
allowing for concurrency, it will continue to work.
2020-08-26 08:59:51 +02:00
semantic-release-bot 3a6d966e50 chore(release): 10.8.2 [skip ci]
## [10.8.2](https://github.com/react-native-community/react-native-webview/compare/v10.8.1...v10.8.2) (2020-08-25)

### Bug Fixes

* **deps:** Update package.json ([#1583](https://github.com/react-native-community/react-native-webview/issues/1583)) ([8dd9969](8dd9969288))
2020-08-25 23:30:28 +00:00
Jason Safaiyeh 8dd9969288
fix(deps): Update package.json (#1583)
* Update package.json

* Remove react version from peerDependencies

* Update package.json

Co-authored-by: Thibault Malbranche <thibault.malbranche@epitech.eu>
2020-08-26 01:26:13 +02:00
semantic-release-bot c2395bfec2 chore(release): 10.8.1 [skip ci]
## [10.8.1](https://github.com/react-native-community/react-native-webview/compare/v10.8.0...v10.8.1) (2020-08-25)

### Bug Fixes

* **iOS:** changed the way the top view controller is obtained. ([#1592](https://github.com/react-native-community/react-native-webview/issues/1592)) ([2cb2113](2cb2113c29))
* **ts:** Convert ContentInsetAdjustmentBehavior from an enum back to a string union type ([#1536](https://github.com/react-native-community/react-native-webview/issues/1536)) ([a48c981](a48c9819c5))
2020-08-25 23:20:58 +00:00
Caleb Clarke a48c9819c5
fix(ts): Convert ContentInsetAdjustmentBehavior from an enum back to a string union type (#1536)
ContentInsetAdjustmentBehavior was originally added as a string union type. The change to support MacOS replaced it with an enum, which was a bit of a breaking change, especially as the enum was not exported from the main library. Exporting the enum would probably also help, but since this was the only enum and the rest of react-native-webview uses string unions instead, it seems best to revert it to a string union.

Co-authored-by: Jamon Holmgren <jamonholmgren@gmail.com>
2020-08-26 01:16:18 +02:00
cristianoccazinsp 2cb2113c29
fix(iOS): changed the way the top view controller is obtained. (#1592)
Co-authored-by: Cristiano Coelho <cristianocca@hotmail.com>
2020-08-26 01:13:00 +02:00
Leonardo Russo db529e265f
Updated Guide.md for using injectedJavaScript (#1578)
https://github.com/react-native-community/react-native-webview/issues/1554
2020-08-25 15:02:13 +02:00
semantic-release-bot 6598325940 chore(release): 10.8.0 [skip ci]
# [10.8.0](https://github.com/react-native-community/react-native-webview/compare/v10.7.0...v10.8.0) (2020-08-24)

### Features

* **android:** Add androidLayerType as prop ([#1588](https://github.com/react-native-community/react-native-webview/issues/1588)) ([9ffca8f](9ffca8f9db))
2020-08-24 12:29:54 +00:00
oliviacaraiman 9ffca8f9db
feat(android): Add androidLayerType as prop (#1588)
* Add androidLayerType as a prop

* Deprecate "androidHardwareAccelerationDisabled" prop

* Update reference

Co-authored-by: Olivia Caraiman <olcaraim@microsoft.com>
2020-08-24 14:23:38 +02:00