<!DOCTYPE html>
<html lang="en">
<head>
<title>Server-sent event testing thingy</title>
<script type="text/javascript">
onload = function () {
if (Notification && Notification.permission !== 'granted') {
Notification.requestPermission();
}
var source = new EventSource('/lab/perl/sse.pl');
source.onmessage = function (e) {
if (Notification.permission === 'granted') {
new Notification('A server-sent event occurred!', {
icon: 'https://pegasus.pimpninjas.org/images/favicon.png',
body: e.data
});
}
}
}
</script>
</head>
</html>