Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-835] iOS: WebView doesn't change it's "url" dynamic property

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-11-05T15:44:24.000+0000
Affected Version/sRelease 1.6.2
Fix Version/sSprint 2011-24, Release 1.8.0
ComponentsiOS
Labelsn/a
ReporterGabriel Cox
AssigneeBlain Hamon
Created2011-04-15T02:37:28.000+0000
Updated2011-11-05T15:44:24.000+0000

Description

This seems similar for bug #804 (Android), but this also applies to iPhone. After a webview is launched, the URL property does not change when clicking to a link to another URL, or when a redirect happens.

I tried unsuccessfully using this to catch an Oauth redirected callback URL.

Comments

  1. Gabriel Cox 2011-04-15

    Assigning to Jeff for distribution.

  2. Jacob Waller 2011-04-15

    Can we pretty please also have a locationChange event when the url changes (also for remote webviews)?
    This doesn't sound like much, but would be a killer feature for me!

  3. Blain Hamon 2011-06-06

    @Jacob: WebView already has a 'load' event that fires whenever a page loads. This event even has a property called 'url' that, when the webview reflects an url instead of being called with setHtml or setData, is accurate to the new page.
  4. Blain Hamon 2011-06-06

    On a successful page load, we change the proxy's url to reflect the new page.
  5. Eric Merriman 2011-06-06

    There is no sample code attached with this bug, (nor with the original LH ticket), could we get a quick test attached?
  6. Blain Hamon 2011-06-17

    D'oh. Let's add some code, shall we?
       var win = Ti.UI.createWindow();
       var webview = Ti.UI.createWebView({url:'http://www.google.com',bottom:50});
       var button = Ti.UI.createButton({title:'Log URL',height:50,bottom:0});
       
       button.addEventListener('click',function(E){
       	Ti.API.debug('Url is now: '+webview.url);
       });
       
       win.add(webview);
       win.add(button);
       win.open();
       
  7. Blain Hamon 2011-06-21

    Pull request merged.
  8. Natalie Huynh 2011-08-25

    Tested with 1.8.0.v20110819142548 iPhone 4.3.4 iPad2 4.3.2 Motorola Xoom 3.2 Nexus One 2.2.2
  9. Don Thorp 2011-11-05

    Standardizing summary and labels.

JSON Source