diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java index b9da5d7..3a4a6a4 100644 --- a/src/android/InAppBrowser.java +++ b/src/android/InAppBrowser.java @@ -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);