[ 
https://issues.apache.org/jira/browse/CB-3360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14391360#comment-14391360
 ] 

ASF GitHub Bot commented on CB-3360:
------------------------------------

Github user agrieve commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/162#discussion_r27606969
  
    --- Diff: framework/src/org/apache/cordova/engine/SystemWebViewEngine.java 
---
    @@ -199,7 +199,19 @@ private void initWebViewSettings() {
             
             // Fix for CB-1405
             // Google issue 4641
    -        settings.getUserAgentString();
    +        String defaultUserAgent = settings.getUserAgentString();
    +
    +        // Fix for CB-3360
    +        String overrideUserAgent = 
getCordovaWebView().getPreferences().getString("OverrideUserAgent", null);
    --- End diff --
    
    I'd like to avoid circular dependency if possible on CordovaWebView.
    
    Rather than depending on CordovaWebView here, could you save the instance 
of CordovaPreferences passed to the constructor and use that instead? Would 
also need to add CordovaPreferences as a 2nd arg to the other constructor as 
well.


> Set custom InAppBrowser user-agent
> ----------------------------------
>
>                 Key: CB-3360
>                 URL: https://issues.apache.org/jira/browse/CB-3360
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Android, BlackBerry, Plugin InAppBrowser, WP8
>    Affects Versions: 2.7.0
>         Environment: iOS, Android, WP8, BlackBerry
>            Reporter: Kevin Simpson
>            Assignee: Joe Bowser
>            Priority: Minor
>              Labels: Cordova, InAppBrowser, android
>
> Currently you can set a custom user-agent for the main Cordova webview by 
> overriding the init method for the DroidGap class. However, when opening a 
> page in the InAppBrowser, that webview will still contain the default 
> user-agent.
> There are two solutions that I have thought of to this:
> 1. Set the user-agent of the InAppBrowser webview to whatever the user-agent 
> in the Cordova webview is set to. (This is what I am currently doing, as it 
> was a one line change, but it requires rebuilding Cordova manually)
> 2. Have some sort of configuration option to set the user-agent for the 
> InAppBrowser. This would allow a different user-agent from the main webview, 
> but is also a more involved change.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to