CB-3360: Set custom inappbrowser user agent for android
github close #95
This commit is contained in:
parent
4f3b4df7d1
commit
98b63cc37e
@ -673,6 +673,16 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
settings.setMediaPlaybackRequiresUserGesture(mediaPlaybackRequiresUserGesture);
|
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!
|
//Toggle whether this is enabled or not!
|
||||||
Bundle appSettings = cordova.getActivity().getIntent().getExtras();
|
Bundle appSettings = cordova.getActivity().getIntent().getExtras();
|
||||||
boolean enableDatabase = appSettings == null ? true : appSettings.getBoolean("InAppBrowserStorageEnabled", true);
|
boolean enableDatabase = appSettings == null ? true : appSettings.getBoolean("InAppBrowserStorageEnabled", true);
|
||||||
|
Loading…
Reference in New Issue
Block a user