in web app, use applicationcache feature. register appcache events like
appcache.addeventlistener(<event_name>, handlecacheevent, false); function handlecacheevent(e) { console.log('handlecacheevent appcache event: '+ e.type+' appcache.status: '+appcache.status); } (in event_name register events - 'cached', 'checking', 'downloading', etc). however, in chrome logs, see these logs:
application cache progress event (1 of 15)
...
application cache progress event (15 of 15)
at beginning of run, of js business logic, , after few seconds see logs
appcache event: progress appcache.status: 1
...
it seems event listener not triggered right when status of appcache changes, rather later @ point. so?
yes, i've seen same thing. when add event listeners events , log them, log message appears after of browser's log message. think because browser starts loading appcache before contents of page done loading, since appcache work in background. still gives chance handle appcache events programmatically while letting browser thing honor specification.
Comments
Post a Comment