diff --git a/Libraries/Components/WebView/WebView.android.js b/Libraries/Components/WebView/WebView.android.js index 18491d52c..872e2b3bd 100644 --- a/Libraries/Components/WebView/WebView.android.js +++ b/Libraries/Components/WebView/WebView.android.js @@ -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', });