Network Information
<div data-controller="network-info">
<p id="network-status">Loading network info...</p>
</div>
<script type="module">
const el = document.querySelector('[data-controller="network-info"]');
el.addEventListener('network-info:change', (e) => {
const c = e.detail.connection;
document.getElementById('network-status').textContent =
`Type: ${c.effectiveType}, Downlink: ${c.downlink} Mbps, RTT: ${c.rtt} ms`;
});
</script>Parameters
Actions
Targets
Events
Last updated
Was this helpful?