Issue
When app bring up the webview on iOS, we can see one beforeload and one load event. After calling webview.reload(), it can be seen 2 beforeload and load events.
Steps to reproduce are as follows:
1. start app
2. notice 1x beforeload and 1x load events
3. tap [reload] button
4. notice 2x beforeload and 2x load events
load
[INFO] app.js: webview.beforeload: uuid: na, url: file:///Users/gary.fong/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/64CBE284-753E-47FC-BA3A-ED78C03BF2A2/AndroidWebViewReload2.app/test.html
[INFO] test.html: window.load
[INFO] test.html: dump: uuid: na, isReady: false
[INFO] app.js: webview.load: uuid: na, url: file:///Users/gary.fong/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/64CBE284-753E-47FC-BA3A-ED78C03BF2A2/AndroidWebViewReload2.app/test.html
reload
[INFO] app.js: resetting url
[INFO] reloading...
[INFO] app.js: webview.beforeload: uuid: na, url: file:///Users/gary.fong/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/64CBE284-753E-47FC-BA3A-ED78C03BF2A2/AndroidWebViewReload2.app/test.html
[INFO] app.js: webview.beforeload: uuid: na, url: file:///Users/gary.fong/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/64CBE284-753E-47FC-BA3A-ED78C03BF2A2/AndroidWebViewReload2.app/test.html
[INFO] test.html: window.load
[INFO] test.html: dump: uuid: na, isReady: false
[INFO] app.js: webview.load: uuid: na, url: file:///Users/gary.fong/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/64CBE284-753E-47FC-BA3A-ED78C03BF2A2/AndroidWebViewReload2.app/test.html
Provided example sets url and then calls reload(). Both generate 'beforeload' events.
Why this bug still exists?
[~yiluxiangbei] You may find you get better support on a free, open-source product if you remain professional. One of the bugs you commented on was invalid, the other is still open, but does not have many watchers. What is the exact problem you are experiencing? Do you have sample test code?
hello,@Ingo Muschenetz.I'm sorry about the word.I use both method setUrl and reload.They triggered twice beforeload and once load.I use beforeload event to show activityIndicator and load event to get data from database.The code like this: Now I'm only use setUrl no reload method.It can work well.I sugguest you to describe it on the docs. webview.addEventListener('beforeload', function(e) { logger.info("beforeload"); activityIndicator.show(); }); webview.addEventListener('load', function(e) { //change content webUtil = require('utils/webUtil'); var beginDate = new Date(); logger.info("---------------getContent start:" + beginDate.getTime()); content = webUtil.getContent(this); logger.info(content); var endDate = new Date(); logger.info("---------------getContent end:" + endDate.getTime() + " use time:" + (endDate.getTime() - beginDate.getTime())); var date = new Date(); Ti.App.fireEvent('app:changeContent', { time: date.getTime(), type: this.menu.type, code: this.menu.code, pageId: this.menu.pageId, newsId: this.menu.newsId, content: content }); logger.info("load"); activityIndicator.hide(); });
Closing ticket as invalid.