CB-3360: Set custom inappbrowser user agent for android

github close #95
This commit is contained in:
Connor Pearson 2015-03-13 14:12:40 -04:00 committed by sgrebnov
parent 4f3b4df7d1
commit 98b63cc37e

View File

@ -673,6 +673,16 @@ public class InAppBrowser extends CordovaPlugin {
settings.setMediaPlaybackRequiresUserGesture(mediaPlaybackRequiresUserGesture);
}
String overrideUserAgent = preferences.getString("OverrideUserAgent", null);
String appendUserAgent = preferences.getString("AppendUserAgent", null);
if (overrideUserAgent != null) {
settings.setUserAgentString(overrideUserAgent);
}
if (appendUserAgent != null) {
settings.setUserAgentString(settings.getUserAgentString() + appendUserAgent);
}
//Toggle whether this is enabled or not!
Bundle appSettings = cordova.getActivity().getIntent().getExtras();
boolean enableDatabase = appSettings == null ? true : appSettings.getBoolean("InAppBrowserStorageEnabled", true);