Add DOMContentLoaded event support

Fixes a bug on iOS 8 when the "load" event was not correctly received.