blob: 1dad1c82f11487b39a8209d4e9274f2052d40ffb [file] [log] [blame]
<script>
// Set authentication info
var port;
var w;
window.addEventListener("message", function(evt) {
if (evt.ports[0]) {
port = evt.ports[0];
document.cookie = 'cookie=' + evt.data.cookie;
w = window.open(window.location.protocol + "//" + evt.data.username + ":" + evt.data.password + "@" + window.location.hostname + ":" + window.location.port + "/serviceworker/resources/fetch-access-control.php?Auth&WINDOW", evt.data.username);
} else {
w.close();
w = null;
port.postMessage({msg: 'LOGIN FINISHED'});
}
}, false);
</script>