[TIMOB-17936] Implement onLoadResource event for Android WebViews
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | None |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 3.4.0 |
Fix Version/s | n/a |
Components | Android |
Labels | TCSupportTriage, android, triageSupport, webview |
Reporter | Marcel Pociot |
Assignee | Unknown |
Created | 2014-07-14T11:20:27.000+0000 |
Updated | 2018-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.
Hello Marcel, can you please provide a testcase that shows the issue? Best Regards, Mauro
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
Here's my PR: https://github.com/appcelerator/titanium_mobile/pull/6011