Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10341] Android: Webview cannot open links with javascript:window.open call

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-03-14T05:19:08.000+0000
Affected Version/sRelease 2.1.1
Fix Version/sRelease 3.0.2
ComponentsAndroid
Labelsapi
ReporterFederico Casali
Assigneejithinpv
Created2012-06-28T05:34:45.000+0000
Updated2017-03-21T21:32:22.000+0000

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>

Comments

  1. jithinpv 2013-03-13

    .
  2. jithinpv 2013-03-14

    Issue does not reproduces with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Device: Samsung galaxy s duos Android version: 4.0.4
  3. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced.

JSON Source