Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17936] Implement onLoadResource event for Android WebViews

GitHub Issuen/a
TypeImprovement
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.4.0
Fix Version/sn/a
ComponentsAndroid
LabelsTCSupportTriage, android, triageSupport, webview
ReporterMarcel Pociot
AssigneeUnknown
Created2014-07-14T11:20:27.000+0000
Updated2018-02-28T20:03:46.000+0000

Description

The TiWebviewClient.java overrides the "onPageStarted" method to trigger the "beforeload" event. As the Android API states: bq. This method is called once for each main frame load so a page with iframes or framesets will call onPageStarted one time for the main frame. This means, that the method won't get triggered, when a URL inside an iFrame/Frame changes. Implementing an "onLoadResource" function and triggering a new "beforeresourceload" event would solve this issue. The problem does not exist on iOS devices, as the event gets triggered with iFrames as well.

Comments

  1. Mauro Parra-Miranda 2014-07-24

    Hello Marcel, can you please provide a testcase that shows the issue? Best Regards, Mauro
  2. Marcel Pociot 2014-08-28

    Hi Mauro, sorry for the late reply. Haven't seen your response. I created a gist demonstrating the issue: https://gist.github.com/mpociot/9d95def1037fd1d83b42 When clicking the link in the webview iOS fires the "beforeload" event. Android doesn't. I could also provide a PR if you want. Regards, Marcel
  3. Marcel Pociot 2014-09-03

    Here's my PR: https://github.com/appcelerator/titanium_mobile/pull/6011

JSON Source