bootstrapMessageHandler = function(e) {
    if (e.origin == window.location.origin &&
        e.data.api == 'e2e-init' &&
        e.ports &&
        e.ports.length == 1) {
      e.ports[0].addEventListener('message', messageHandler, false);
      e.ports[0].start();
      e.ports[0].postMessage({
        api: 'e2e-init',
        version: 1,
        available: isApiAvailable()
      });
      window.removeEventListener('message', bootstrapMessageHandler);
    }
  }
Handles the bootstrap message coming from the extension.
@param {MessageEvent} e bootstrap message sent from the extension.