Skip to content

Commit

Permalink
[react_native] JS files from D2139723: [react_native] Set WebView use…
Browse files Browse the repository at this point in the history
…r-agent from JS
  • Loading branch information
andreicoman11 authored and sahrens committed Jun 12, 2015
1 parent 38f76b3 commit 778e23e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Libraries/Components/WebView/WebView.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -172,6 +178,7 @@ var RCTWebView = createReactNativeComponentClass({
validAttributes: merge(ReactNativeViewAttributes.UIView, {
url: true,
javaScriptEnabledAndroid: true,
userAgent: true,
}),
uiViewClassName: 'RCTWebView',
});
Expand Down

0 comments on commit 778e23e

Please sign in to comment.