document.onload doesn't trigger with browser cache enabled
When browser cache is enabled (and thus, the loaded .html document is loaded from cache), Browser.document.addEventListener('load',foo) never triggers foo...
Ok, the load event is dispatched from here : https://github.com/silexlabs/Cocktail/blob/master/cocktail/core/html/HTMLDocument.hx#LC591
Do you add the event listener before setting the document content ?
Yes, I'm still using Cocktail.boot( url ).
The problem is, before that, Browser.window is null so I just can't add the event listener
(It was Browser.window and not Browser.document BTW)
It seems actually impossible to access either window or document before loading the file,
so I guess if the file is loaded synchronously, the 'load' event cannot be used...
I guess both window and document should be created in the constructor, and never reinitialized...
What do you think ?
I couldn't see what's wrong by looking at cocktail's code. The samples also add the onload callback after calling "boot". I remember I fixed bugs similar to yours months ago, but I probably didn't fix everything.
If you can share a sample reproducing the bug, I can take a look this weekend