-
Notifications
You must be signed in to change notification settings - Fork 25k
Mixed content mode issue fix #8696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
f259dc9
c2a625b
1a302f9
94bc137
c08ab5a
927b8dc
3c0f638
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,6 +153,12 @@ var WebView = React.createClass({ | |
| * start playing. The default value is `false`. | ||
| */ | ||
| mediaPlaybackRequiresUserAction: PropTypes.bool, | ||
|
|
||
| /** | ||
| * Used on Android(5.0+), controls whether Mixed content mode is enabled or not | ||
| * @platform android | ||
| */ | ||
| enableMixedContentMode: PropTypes.bool, | ||
|
||
| }, | ||
|
|
||
| getInitialState: function() { | ||
|
|
@@ -167,6 +173,7 @@ var WebView = React.createClass({ | |
| return { | ||
| javaScriptEnabled : true, | ||
| scalesPageToFit: true, | ||
| enableMixedContentMode: false, | ||
| }; | ||
| }, | ||
|
|
||
|
|
@@ -229,6 +236,7 @@ var WebView = React.createClass({ | |
| onLoadingError={this.onLoadingError} | ||
| testID={this.props.testID} | ||
| mediaPlaybackRequiresUserAction={this.props.mediaPlaybackRequiresUserAction} | ||
| enableMixedContentMode={this.props.enableMixedContentMode} | ||
| />; | ||
|
|
||
| return ( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
| import android.webkit.WebView; | ||
| import android.webkit.WebViewClient; | ||
| import android.webkit.WebChromeClient; | ||
| import android.webkit.WebSettings; | ||
|
|
||
| import com.facebook.react.views.webview.events.TopLoadingErrorEvent; | ||
| import com.facebook.react.views.webview.events.TopLoadingFinishEvent; | ||
|
|
@@ -292,6 +293,13 @@ public void setInjectedJavaScript(WebView view, @Nullable String injectedJavaScr | |
| ((ReactWebView) view).setInjectedJavaScript(injectedJavaScript); | ||
| } | ||
|
|
||
| @ReactProp(name = "enableMixedContentMode") | ||
| public void setMixedContentMode(WebView view, boolean enabled) { | ||
|
||
| if (enabled && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | ||
| view.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry looking at the Android API more closely, I think we want to expose the underlying API: always, never, compatibility as enums. |
||
| } | ||
| } | ||
|
|
||
| @ReactProp(name = "source") | ||
| public void setSource(WebView view, @Nullable ReadableMap source) { | ||
| if (source != null) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no-trailing-spaces: Trailing spaces not allowed.