function onReady(callback) {
    if (
      document.readyState === 'complete' ||
      document.readyState === 'interactive'
    ) {
      setTimeout(completed);
    } else {
      document.addEventListener('DOMContentLoaded', completed, false);
      // For some reason DOMContentLoaded doesn't always work
      window.addEventListener('load', completed, false);
    }

    function completed() {
      document.removeEventListener('DOMContentLoaded', completed, false);
      window.removeEventListener('load', completed, false);
      callback();
    }
  }
The Chrome and Firefox extensions inject the in-page-script into the
page to determine the version of Ember the ClientApp is running.

An iife runs to gather the data and uses postMessage to send the data back
to the extension.

@namespace EmberInspector/Shared
@class InPageScript