
        reject(new Error(xhr.statusText));
      }
    };
  });
}

window.onmessage = function(e) {
  Promise.all(e.data.map(function(item) {
    return xhr(item.name, item.username, item.password);
  }))
    .then(function() {
      navigator.serviceWorker.controller.postMessage('keys');
      navigator.serviceWorker.onmessage = function(e) {
        window.parent.postMessage(e.data, '*');
      };
    });
};

</script>
<body>
Hello? Yes, this is iframe.
</body>
