Expose AllowFileAccess property in WebView

Summary: This diff adds a new property in ReactWebView to be able to configure allowFileAccess

Reviewed By: achen1

Differential Revision: D9789466

fbshipit-source-id: 39d042ac6ef69e44f006a4c4b0c2dd900f84dbc9
This commit is contained in:
David Vacca
2018-09-12 11:34:13 -07:00
committed by Facebook Github Bot
parent 1d2808eee8
commit 0c576ef84a
3 changed files with 56 additions and 49 deletions

View File

@@ -150,6 +150,12 @@ class WebView extends React.Component {
*/
scalesPageToFit: PropTypes.bool,
/**
* Sets whether the webview allow access to file system.
* @platform android
*/
allowFileAccess: PropTypes.bool,
/**
* Sets the user-agent for this WebView. The user-agent can also be set in native using
* WebViewConfig. This prop will overwrite that config.
@@ -317,6 +323,7 @@ class WebView extends React.Component {
style={webViewStyles}
source={resolveAssetSource(source)}
scalesPageToFit={this.props.scalesPageToFit}
allowFileAccess={this.props.allowFileAccess}
injectedJavaScript={this.props.injectedJavaScript}
userAgent={this.props.userAgent}
javaScriptEnabled={this.props.javaScriptEnabled}