How to detect if DOMContentLoaded was fired
I'm trying to help developing a library and for it I'm trying to work with page loading. In the process I want to make the library completely compatible with the use of defer and async. What I want is simple: How can I know that DOMContentLoaded was fired by the time the file is executed? Why is this so difficult? In IE, document.readyState show interactive before DOMContentLoaded. I won't use browser detection in any way, it's against the policy of me and the rest of the participants. What's the correct alternative? Edit: Seems like I wasn't clear enough. I'm not interested to know if the