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

Android: Webview cannot open links with javascript:window.open call

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Cannot Reproduce
    • Affects Version/s: Release 2.1.1
    • Fix Version/s: Release 3.0.2
    • Component/s: Android
    • Labels:
    • Environment:

      TiSDK Version 2.1.1
      Platform OS: Android
      Platform OS Version: 2.3.3 (GB), 4.0.3 (ICS)
      Device details: Emulator, Samsung Galaxy S2

      Description

      Problem description

      On Android OS, a Webview can't open links using 'javascript:window.open' call

      Sample code and steps to reproduce

      Run the sample code and click on the link.
      Link it's not opened.

      This works in iOS, and the link gets opened in the same webView.

      'app.js' file

      var win1 = Titanium.UI.createWindow({  
          backgroundColor:'#fff',
          navBarHidden : false,
          exitOnClose : true
      });
       
      var privacywebView = Titanium.UI.createWebView({
          top : 0,
          left : 0,
          url : 'hello.html'
      });
       
      win1.add(privacywebView);
      win1.open();
      

      ------

      'hello.html' file

      <html>
          <head>
              <title> Test Page </title>
          </head>
       
          <body>
              This is a hello world page. <br />
              <a href="#" onclick="javascript:window.open('http://google.com');return false;">Open Google</a>
          </body>
      </html>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jithinv@exalture.com jithinpv
                Reporter:
                fcasali Federico Casali
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration