Closed jakearchibald closed 8 years ago
I should add it as a known limitation. BTW, how did you even find this?
How did I find the problem: the HTML spec. How did I find this repo? https://twitter.com/lucasmazza/status/790918537716047873
There may be other cases where contentLoaded
fires at the wrong time btw, but as far as I can tell it'll only ever be early, not late or never-happening.
If this runs in a script that has
defer
,contentLoaded
will resolve before theDOMContentLoaded
event.I'm not sure if there's a way around this, since
readyState
can equal"interactive"
both before and afterDOMContentLoaded
.It's at least worth noting it isn't accurate.