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

Android: Gingerbread 2.3.X: Emulator: WebView evalJS crashes app

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Duplicate
    • Affects Version/s: Release 1.7.5, Release 1.8.0.1, Release 2.0.0, Release 1.8.1, Release 1.8.2
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      Description

      When the evalJS method of a WebView is called, the app will crash. Log attached.

      Steps to Reproduce:

      1. Run code on 2.3.3 Emulator (WebViewTest project attached).

      Note: This is a minimal fail case. TIMOB-4885 provides a similar example.

      app.js

      var win = Ti.UI.createWindow();
      var webView = Ti.UI.createWebView({ url:'test.html' });
       
      win.add(webView);
      win.open();
       
      webView.addEventListener('load', function() {
      	webView.evalJS("run()");
      });
      

      test.html

      <!doctype html>
      <html>
      	<head>
      		<title>WebView Test Page</title>
      </head>
      	<body><h1>WebView Test Page</h1>
      	<script type="text/javascript">
      			function run() { alert('WebView JS Eval'); };
      		</script>
      	</body>
      </html>
      

      Expected Result:

      An alert should appear indicating evalJS was successful.

      Actual Result:

      Crash.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hpham Hieu Pham
                Reporter:
                dhyde Dustin Hyde
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code