Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-836] iOS: Ti.* functions fail within webview after additional page loads.

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-06-26T23:22:13.000+0000
Affected Version/sRelease 1.6.0, Release 3.0.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterGabriel Cox
AssigneeIngo Muschenetz
Created2011-04-15T02:37:30.000+0000
Updated2017-06-26T23:22:13.000+0000

Description

Ti.* functions fail within webview after additional page loads. This can be reproduced by creating links with to an additional page with a call like Ti.API.info("message"). I have only tried this on iPhone, but it may be elsewhere. This affects an Oauth implementation since a redirect to a callback url is used at the end of the authorization.

example:

var webview = Ti.UI.createWebView({url:'app://Resources/test2.html'});
Ti.UI.currentWindow.add(webview);

test2.html

<html>
    <head>
        <script>
            Ti.API.info("in test2.html"); // console will show "in test2.html"
    </script>
    </head>
    <body>
        <h1>Test 2</h1>
            <a href='/test3.html'>Click to Test3</a>
    </body>
</html>

test3.html

<html>
    <head>
        <script>
            Ti.API.info("in test3.html"); // PROBLEM: console will show nothing...
    </script>
    </head>
    <body>
        <h1>Test 3</h1>
    </body>
</html>

Comments

  1. Gabriel Cox 2011-04-15

    Sorry, test2.html above didn't encode as I intended. Trying a different method.


    {mkd-extraction-e98647f60da57ec8b80b213d12dc331f}



    {mkd-extraction-bb3970ac74fe1f13090ef8573691f334}
  2. Gabriel Cox 2011-04-15

    Trying "

       "
       
       
       
           
               
           
           
               
       
       
       
       

    Test 2

       
               Click to Test3
           
       
  3. Gabriel Cox 2011-04-15

    Got it -- ignore 2 previous comments (wish I could delete them)

    test2.html

       <head>
           <script>
               Ti.API.info("in test2.html"); // shows "in test2.html"
       </script>
       </head>
       <body>
           <h1>Test 2</h1>
           <a href="test3.html">Click to Test3</a>
       </body>
       

    (now I see the "preview" -- sorry I'm new to this...)

  4. Gabriel Cox 2011-04-15

    Not sure who to assign to -- Assuming Jeff as the distributor.

  5. Stephen Tramer 2011-04-15

    Bumping into triage.

  6. Vikramjeet Singh 2011-08-02

    Bug Scrub: Valid. No Test Case exists. Tested On: Mac OSX Lion TiMob Version: 1.7.2 TiStud Version: 1.0.2 Devices used: iPhone 4.3.4
  7. Junaid Younus 2012-08-13

    Issue still reproducible on the iOS simulator using TiSDK 2.2.0v20120810194112. app.js
       var win = Ti.UI.createWindow({backgroundColor: 'white'});
       
       var webview = Ti.UI.createWebView({url:'test2.html'});
       win.add(webview);
       
       win.open();
       
    test2.html
       <html>
           <head>
               <script>
                   Ti.API.info("in test2.html"); // console will show "in test2.html"
           </script>
           </head>
           <body>
               <h1>Test 2</h1>
                   <a href='test3.html'>Click to Test3</a>
           </body>
       </html>
       
    test3.html
       <html>
           <head>
               <script>
                   Ti.API.info("in test3.html"); // PROBLEM: console will show nothing...
           </script>
           </head>
           <body>
               <h1>Test 3</h1>
           </body>
       </html>
       
  8. Lee Morris 2017-06-26

    I am unable to reproduce this issue with the following environment; iPhone 7 (10.2) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170623141152 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source