Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-16082

Android: WebView.evalJS always returns null on Android 4.2.2 device

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Invalid
    • Affects Version/s: Release 3.2.0
    • Fix Version/s: Release 6.2.0
    • Component/s: Android
    • Environment:

      Tested on Nexus 5 (Android 4.4.2) and Nexus 7 (Android 4.4.2)

    • Sprint:
      2017 Sprint 02 SDK

      Description

      WebView.evalJS appears to always return null on devices running Android Kit-Kat, regardless of the provided script.

      Example app:

      app.js

       
      var win = Titanium.UI.createWindow({  
          title:'EvalJS kit-kat test',
          backgroundColor:'#fff'
      });
      var webView = Ti.UI.createWebView({
          url : 'http://www.google.com'
      });
      webView.addEventListener('load', function(evt){
          //Expected behavior is for an alert saying 'google' to be shown
          //On Android Kit-Kat, an empty alert is shown instead.
          alert(evt.source.evalJS('document.title'));
      });
       
      win.add(webView);
      win.open();
      

      Reproduces on 3.1.3.GA and 3.2.0.v20131210191510

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              shockoe SHOCKOE TEAM
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-18105
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code