beecomci / today_i_learned

0 stars 0 forks source link

NetworkInformation API #18

Open beecomci opened 2 years ago

beecomci commented 2 years ago

NetworkInformation API #

properties

NetworkInformation.type

NetworkInformation.effectiveType

NetworkInformation.rtt

NetworkInformation.downlink

NetworkInformation.saveData

Event Handler

onchange

// Browser Support
const connection = navigator.connection
|| navigator.mozConnection
|| navigator.webkitConnection;

function updateConnectionStatus() {
  alert("Connection bandwidth: " + connection.effectiveType + " MB/s");
}

connection.addEventListener("change", updateConnectionStatus);

주의점

그 외 네이버앱의 경우 ?