window.addEventListener('load', (function(){
if (['', 'hub.octt.eu.org'].includes(location.host)) {
if (('serviceWorker' in navigator) && (location.protocol.slice(0, 4) === 'http')) {
navigator.serviceWorker.register('/ServiceWorker.js');
}
} else {
var noticeElem = document.createElement('p');
noticeElem.style = `
position: fixed;
z-index: 1000;
top: 0;
left: 0;
margin: 0;
width: 100%;
color: black;
background-color: thistle;
font-size: initial;
font-size: smaller;
text-align: center;
`;
noticeElem.innerHTML = `You are viewing this page on a secondary/backup domain. Open it on hub.octt.eu.org.
`;
document.body.appendChild(noticeElem);
}
if (["www.octt.eu.org", "hub.octt.eu.org"].includes(location.hostname)) {
fetch('https://private-analytics-not-for-public-use.octt.eu.org/octospacchub/count?p=' + location.href /* + '&rnd=' + Date.now() */)
.catch(function(err){
console.error(err);
fetch('https://octospacchub.goatcounter.com/count?p=' + location.href);
});
}
}));