cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabriele Mondada (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CB-3293) some CordovaWebView constructors do not initialize the web client correctly
Date Sun, 28 Apr 2013 13:36:15 GMT
Gabriele Mondada created CB-3293:
------------------------------------

             Summary: some CordovaWebView constructors do not initialize the web client correctly
                 Key: CB-3293
                 URL: https://issues.apache.org/jira/browse/CB-3293
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android
    Affects Versions: 2.6.0
         Environment: CordovaWebView embedded in an android app
            Reporter: Gabriele Mondada
            Assignee: Joe Bowser


The CordovaWebView constructor used by classic phonegap apps initializes the web client as
following:
this.setWebChromeClient(new CordovaChromeClient(this.cordova, this));
this.initWebViewClient(this.cordova);

Some constructors (I guess those that pretty nobody use) miss this initialization. Here are
these constructors: 
public CordovaWebView(Context context)
public CordovaWebView(Context context, AttributeSet attrs, int defStyle)

Proposed patch:
--- a/src/org/apache/cordova/CordovaWebView.java
+++ b/src/org/apache/cordova/CordovaWebView.java
@@ -135,6 +135,8 @@
         {
             Log.d(TAG, "Your activity must implement CordovaInterface to work");
         }
+        this.setWebChromeClient(new CordovaChromeClient(this.cordova, this));
+        this.initWebViewClient(this.cordova);
         this.loadConfiguration();
         this.setup();
     }
@@ -180,6 +182,7 @@
             Log.d(TAG, "Your activity must implement CordovaInterface to work");
         }
         this.setWebChromeClient(new CordovaChromeClient(this.cordova, this));
+        this.initWebViewClient(this.cordova);
         this.loadConfiguration();
         this.setup();
     }


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message