Inject scripts on document ready

Huge speed improvement :-)

In most cases, the document ready event is what a developer want. If necessary, it’s easy to use `window.addEventListener('load', …)` to listen for the window onload event.