Skip to content

Commit

Permalink
1. updated: resolved issue of ignoring allowHTTPSMixedContent setting
Browse files Browse the repository at this point in the history
2. updated: resolved issue with setUserAgent() method call (the change in user agent may break existing app compatibility, see setDefaultUserAgentWithSuffix() method)

Signed-off-by: Jack Cheung <[email protected]>
  • Loading branch information
Jack Cheung committed Aug 5, 2016
1 parent 11f4632 commit c6581f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Project-wide Gradle settings.
VERSION_NAME=1.4.7
VERSION_CODE=38
VERSION_NAME=1.4.8
VERSION_CODE=39
GROUP=com.hkm.ezwebview
PUBLISH_GROUP_ID=com.hkm.ezwebview
POM_DESCRIPTION=A mini elegant webview for fast easy access
Expand Down
10 changes: 8 additions & 2 deletions library/src/main/java/com/hkm/ezwebview/Util/Fx9C.java
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ public Fx9C setProgressBar(CircleProgressBar progressBar) {
return this;
}

public Fx9C setDefaultUserWithSuffix(String suffix) {
public Fx9C setDefaultUserAgentWithSuffix(String suffix) {
this.userAgent = String.format("%s %s", WebSettings.getDefaultUserAgent(context), suffix);
return this;
}
Expand Down Expand Up @@ -761,7 +761,13 @@ protected void updateWebViewSettings() {

WebSettings settings = this.webView.getSettings();
if (userAgent != null) {
settings.setUserAgentString(String.format("%s %s", settings.getUserAgentString(), userAgent));
settings.setUserAgentString(userAgent);
}

if (allowHTTPSMixedContent) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
}
}

settings.setJavaScriptEnabled(isJavaScriptEnabled);
Expand Down

0 comments on commit c6581f4

Please sign in to comment.