[react_native] JS files from D2139723: [react_native] Set WebView user-agent from JS

This commit is contained in:
Andrei Coman 2015-06-12 02:40:49 -07:00
parent 95050e4658
commit 3ff6abb6d1
1 changed files with 7 additions and 0 deletions

View File

@ -43,6 +43,11 @@ var WebView = React.createClass({
startInLoadingState: PropTypes.bool, // force WebView to show loadingView on first load
style: View.propTypes.style,
javaScriptEnabledAndroid: PropTypes.bool,
/**
* Sets the user-agent for this WebView. The user-agent can also be set in native through
* WebViewConfig, but this can and will overwrite that config.
*/
userAgent: PropTypes.string,
/**
* Used to locate this view in end-to-end tests.
*/
@ -91,6 +96,7 @@ var WebView = React.createClass({
key="webViewKey"
style={webViewStyles}
url={this.props.url}
userAgent={this.props.userAgent}
javaScriptEnabledAndroid={this.props.javaScriptEnabledAndroid}
contentInset={this.props.contentInset}
automaticallyAdjustContentInsets={this.props.automaticallyAdjustContentInsets}
@ -172,6 +178,7 @@ var RCTWebView = createReactNativeComponentClass({
validAttributes: merge(ReactNativeViewAttributes.UIView, {
url: true,
javaScriptEnabledAndroid: true,
userAgent: true,
}),
uiViewClassName: 'RCTWebView',
});