From 980fe00a74a9ad013b945755415ace2e5429c3c2 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Wed, 27 Oct 2021 02:31:24 +0300 Subject: [RU] Remove notranslate (#2874) --- files/ru/web/api/network_information_api/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'files/ru/web/api/network_information_api') diff --git a/files/ru/web/api/network_information_api/index.html b/files/ru/web/api/network_information_api/index.html index ca66acea26..808ca544f1 100644 --- a/files/ru/web/api/network_information_api/index.html +++ b/files/ru/web/api/network_information_api/index.html @@ -15,7 +15,7 @@ translation_of: Web/API/Network_Information_API

Данный пример отслеживает изменение подключения пользователя.

-
var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
+
var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
 var type = connection.effectiveType;
 
 function updateConnectionStatus() {
@@ -30,7 +30,7 @@ connection.addEventListener('change', updateConnectionStatus);
 
 

The connection object is useful for deciding whether to preload resources that take large amounts of bandwidth or memory. This example would be called soon after page load to check for a connection type where preloading a video may not be desirable. If a cellular connection is found, then the preloadVideo flag is set to false. For simplicity and clarity, this example only tests for one connection type. A real-world use case would likely use a switch statement or some other method to check all of the possible values of {{domxref("NetworkInformation.type")}}. Regardless of the type value you can get an estimate of connection speed through the {{domxref("NetworkInformation.effectiveType")}} property.

-
let preloadVideo = true;
+
let preloadVideo = true;
 var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
 if (connection) {
   if (connection.effectiveType === 'slow-2g') {
-- 
cgit v1.2.3-54-g00ecf