<html>
<head>
<script>
window.addEventListener("online", () => console.log("online event: online = " + navigator.onLine), false);
window.addEventListener("offline", () => console.log("offline event: online = " + navigator.onLine), false);
navigator.connection.onchange = () => console.log("connection change event: type = " + navigator.connection.type
+ "; downlinkMax = " + navigator.connection.downlinkMax
+ "; effectiveType = " + navigator.connection.effectiveType);
</script>
</head>
<body>
</body>
</html>