Discovered a gotcha today: this script needs to be loaded synchronously, ie not with
<script async>, since some browsers (eg Chrome) may fire the DOMContentLoaded event before async scripts are loaded. Just FYI!