[whatwg] should we add beforeload/afterload events to the web platform?

Boris Zbarsky bzbarsky at MIT.EDU
Thu Jan 12 18:59:41 PST 2012

On 1/12/12 9:23 PM, Roman Rudenko wrote:
> Blocking is possible under some circumstances. Webkit differentiates
> between normal parser and speculative parser. Speculative parser is
> launched only if normal parser is blocked on execution of a script.
> So, one could use beforeload to block resources in Webkit, for as long
> as no synchronous scripts are allowed to slip through. Unfortunately,
> one runaway script blocks the parser and spoils blocking for anything
> after itself.

I just thought about this some more...  This caveat makes beforeload not 
very helpful for blocking or redirecting loads from only part of a 
document, and for blocking loads from the whole document there are the 
better solutions mentioned earlier in this thread.


More information about the whatwg mailing list