Cross-browser DOMContentLoaded event handling