aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/api/windoworworkerglobalscope
diff options
context:
space:
mode:
authorMDN <actions@users.noreply.github.com>2021-09-01 00:52:00 +0000
committerMDN <actions@users.noreply.github.com>2021-09-01 00:52:00 +0000
commitaf3288b106f44aaaa2c80d499ec669383d6f7203 (patch)
tree6d5a402249e4e8a83820c2592887062ec9202d79 /files/ru/web/api/windoworworkerglobalscope
parent1768b43f574673545e1f2a20e92a27b050a2bb53 (diff)
downloadtranslated-content-af3288b106f44aaaa2c80d499ec669383d6f7203.tar.gz
translated-content-af3288b106f44aaaa2c80d499ec669383d6f7203.tar.bz2
translated-content-af3288b106f44aaaa2c80d499ec669383d6f7203.zip
[CRON] sync translated content
Diffstat (limited to 'files/ru/web/api/windoworworkerglobalscope')
-rw-r--r--files/ru/web/api/windoworworkerglobalscope/atob/index.html70
-rw-r--r--files/ru/web/api/windoworworkerglobalscope/btoa/index.html94
-rw-r--r--files/ru/web/api/windoworworkerglobalscope/caches/index.html79
-rw-r--r--files/ru/web/api/windoworworkerglobalscope/cleartimeout/index.html94
-rw-r--r--files/ru/web/api/windoworworkerglobalscope/fetch/index.html168
-rw-r--r--files/ru/web/api/windoworworkerglobalscope/setinterval/index.html641
-rw-r--r--files/ru/web/api/windoworworkerglobalscope/settimeout/index.html261
7 files changed, 0 insertions, 1407 deletions
diff --git a/files/ru/web/api/windoworworkerglobalscope/atob/index.html b/files/ru/web/api/windoworworkerglobalscope/atob/index.html
deleted file mode 100644
index 689abf3503..0000000000
--- a/files/ru/web/api/windoworworkerglobalscope/atob/index.html
+++ /dev/null
@@ -1,70 +0,0 @@
----
-title: WindowOrWorkerGlobalScope.atob()
-slug: Web/API/WindowOrWorkerGlobalScope/atob
-translation_of: Web/API/WindowOrWorkerGlobalScope/atob
----
-<div>{{APIRef("HTML DOM")}}</div>
-
-<p>Функция <strong><code>WindowOrWorkerGlobalScope.atob()</code></strong> декодирует строку данных, которая была закодирована с использованием  base-64. Вы можете использовать метод {{domxref("WindowOrWorkerGlobalScope.btoa","btoa()")}}, чтобы декодировать и передать данные, которые в исходном виде могут вызвать проблемы  передачи, затем отправить их, и использовать метод <code>atob()</code> чтобы декодировать даны снова. Например, вы можете закодировать, передать, и декодировать управляющие символы, такие как ASCII значения от 0 до 31.</p>
-
-<p>В случаях использования с Unicode или UTF-8 строками, смотрите <a href="/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding#The_.22Unicode_Problem.22">this note at Base64 encoding and decoding</a> и <a href="/en-US/docs/Web/API/window.btoa#Unicode_Strings">this note at <code>btoa()</code></a>.</p>
-
-<h2 id="Синтаксис">Синтаксис</h2>
-
-<pre class="syntaxbox">var decodedData = scope.atob(<em>encodedData</em>);</pre>
-
-<h3 id="Throws">Throws</h3>
-
-<p>Выбрасывает {{jsxref("DOMException")}}, если длина переданной строки не кратна 4.</p>
-
-<h2 id="Пример">Пример</h2>
-
-<pre class="brush:js">var encodedData = window.btoa('Hello, world'); // кодирует строку
-var decodedData = window.atob(encodedData); // декодирует строку</pre>
-
-<h2 id="Спецификации">Спецификации</h2>
-
-<table class="standard-table">
- <thead>
- <tr>
- <th scope="col">Спецификация</th>
- <th scope="col">Статус</th>
- <th scope="col">Комментарий</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>{{SpecName('HTML WHATWG', 'webappapis.html#dom-btoa', 'WindowOrWorkerGlobalScope.atob()')}}</td>
- <td>{{Spec2('HTML WHATWG')}}</td>
- <td>Method moved to the <code>WindowOrWorkerGlobalScope</code> mixin in the latest spec.</td>
- </tr>
- <tr>
- <td>{{SpecName('HTML WHATWG', '#dom-windowbase64-atob', 'WindowBase64.atob()')}}</td>
- <td>{{Spec2('HTML WHATWG')}}</td>
- <td>No change since the latest snapshot, {{SpecName("HTML5.1")}}.</td>
- </tr>
- <tr>
- <td>{{SpecName('HTML5.1', '#dom-windowbase64-atob', 'WindowBase64.atob()')}}</td>
- <td>{{Spec2('HTML5.1')}}</td>
- <td>Snapshot of {{SpecName("HTML WHATWG")}}. No change.</td>
- </tr>
- <tr>
- <td>{{SpecName("HTML5 W3C", "#dom-windowbase64-atob", "WindowBase64.atob()")}}</td>
- <td>{{Spec2('HTML5 W3C')}}</td>
- <td>Snapshot of {{SpecName("HTML WHATWG")}}. Creation of <code>WindowBase64</code> (properties were on the target before it).</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Совместимость_с_браузерами">Совместимость с браузерами</h2>
-
-<p>{{Compat("api.WindowOrWorkerGlobalScope.atob")}}</p>
-
-<h2 id="Смотрите_также">Смотрите также</h2>
-
-<ul>
- <li><a href="/Web/API/WindowBase64/Base64_encoding_and_decoding">Base64 encoding and decoding</a></li>
- <li><a href="/en-US/docs/data_URIs"><code>data</code> URIs</a></li>
- <li>{{domxref("WindowOrWorkerGlobalScope.btoa","window.btoa()")}}</li>
- <li><a href="/en-US/docs/Components.utils.importGlobalProperties">Components.utils.importGlobalProperties</a></li>
-</ul>
diff --git a/files/ru/web/api/windoworworkerglobalscope/btoa/index.html b/files/ru/web/api/windoworworkerglobalscope/btoa/index.html
deleted file mode 100644
index 24f0c7ab38..0000000000
--- a/files/ru/web/api/windoworworkerglobalscope/btoa/index.html
+++ /dev/null
@@ -1,94 +0,0 @@
----
-title: WindowBase64.btoa()
-slug: Web/API/WindowOrWorkerGlobalScope/btoa
-translation_of: Web/API/WindowOrWorkerGlobalScope/btoa
-original_slug: Web/API/WindowBase64/btoa
----
-<div>{{APIRef("HTML DOM")}}</div>
-
-<p>Создаёт ASCII строку закодированную в base-64 из "строки" бинарных данных.</p>
-
-<p>Будьте внимательней этот способ не подходит для <a href="http://www.unicode.org/standard/WhatIsUnicode.html">Unicode</a> строк! Описание работы с Unicode в секции ниже.</p>
-
-<h2 id="Синтаксис">Синтаксис</h2>
-
-<pre class="syntaxbox">var encodedData = window.btoa(<em>stringToEncode</em>);</pre>
-
-<h2 id="Пример">Пример</h2>
-
-<pre class="brush:js">var encodedData = window.btoa("Hello, world"); // encode a string
-var decodedData = window.atob(encodedData); // decode the string
-</pre>
-
-<h2 id="Замечания">Замечания</h2>
-
-<p>Вы можете воспользоваться этим способом, чтобы избежать проблем при передаче данных через сетевое соединение. Для этого нужно перекодировать данные в base64 и отправить их, и на другой стороне с помощью метода <code>{{domxref("WindowBase64.atob","window.atob()")}}</code> декодировать полученные данные в исходный вид. Например, вы можете перекодировать управляющие символы ASCII с 0 до 31.</p>
-
-<p><code>btoa()</code> также доступна для XPCOM компонентов реализованных в JavaScript, даже если <a href="/en-US/docs/DOM/window" title="DOM/window"><code>window</code></a> не является глобальным объектом в компонентах.</p>
-
-<h2 id="Строки_Юникод">Строки Юникод</h2>
-
-<p>В большинстве браузеров, вызов <code>window.btoa()</code> на Unicode строке выбросит исключение Character Out Of Range (Символ вне допустимого диапазона).</p>
-
-<p>Чтобы избежать этого, воспользуйтесь паттерном, предложенным <a class="external" href="http://ecmanaut.blogspot.com/2006/07/encoding-decoding-utf8-in-javascript.html">Johan Sundström</a>:</p>
-
-<pre class="brush:js">function utf8_to_b64(str) {
- return window.btoa(unescape(encodeURIComponent(str)));
-}
-
-function b64_to_utf8(str) {
- return decodeURIComponent(escape(window.atob(str)));
-}
-
-// Usage:
-utf8_to_b64('✓ à la mode'); // JTI1dTI3MTMlMjUyMCUyNUUwJTI1MjBsYSUyNTIwbW9kZQ==
-b64_to_utf8('JTI1dTI3MTMlMjUyMCUyNUUwJTI1MjBsYSUyNTIwbW9kZQ=='); // "✓ à la mode"
-
-utf8_to_b64('I \u2661 Unicode!'); // SSUyNTIwJTI1dTI2NjElMjUyMFVuaWNvZGUlMjUyMQ==
-b64_to_utf8('SSUyNTIwJTI1dTI2NjElMjUyMFVuaWNvZGUlMjUyMQ=='); // "I ♡ Unicode!"
-
-</pre>
-
-<p>Более правильный и производительный способ - это конвертировать <a href="/en-US/docs/Web/API/DOMString" title="/en-US/docs/Web/API/DOMString"><code>DOMString</code></a> в UTF-8 строку передав <a href="/en-US/docs/Web/JavaScript/Typed_arrays" title="/en-US/docs/Web/JavaScript/Typed_arrays">typed arrays</a>. Как это сделать узнать можно здесь<strong> <a href="/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding#Solution_.232_.E2.80.93_rewriting_atob()_and_btoa()_using_TypedArrays_and_UTF-8" title="/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding#Solution_.232_.E2.80.93_rewriting_atob()_and_btoa()_using_TypedArrays_and_UTF-8">в этом параграфе</a></strong>.</p>
-
-<h2 id="Спецификации">Спецификации</h2>
-
-<table class="standard-table">
- <thead>
- <tr>
- <th scope="col">Specification</th>
- <th scope="col">Status</th>
- <th scope="col">Comment</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>{{SpecName('HTML WHATWG', '#dom-windowbase64-btoa', 'WindowBase64.btoa()')}}</td>
- <td>{{Spec2('HTML WHATWG')}}</td>
- <td>No change since the latest snapshot, {{SpecName("HTML5.1")}}.</td>
- </tr>
- <tr>
- <td>{{SpecName('HTML5.1', '#dom-windowbase64-btoa', 'WindowBase64.btoa()')}}</td>
- <td>{{Spec2('HTML5.1')}}</td>
- <td>Snapshot of {{SpecName("HTML WHATWG")}}. No change.</td>
- </tr>
- <tr>
- <td>{{SpecName("HTML5 W3C", "#dom-windowbase64-btoa", "WindowBase64.btoa()")}}</td>
- <td>{{Spec2('HTML5 W3C')}}</td>
- <td>Snapshot of {{SpecName("HTML WHATWG")}}. Creation of <code>WindowBase64</code> (properties where on the target before it).</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Совместимость_браузеров">Совместимость браузеров</h2>
-
-<p>{{Compat("api.WindowOrWorkerGlobalScope.btoa")}}</p>
-
-<h2 id="Смотрите_также">Смотрите также</h2>
-
-<ul>
- <li><a href="/Web/API/WindowBase64/Base64_encoding_and_decoding">Base64 encoding and decoding</a></li>
- <li><a href="/en-US/docs/data_URIs"><code>data</code> URIs</a></li>
- <li>{{domxref("WindowBase64.atob","window.atob()")}}</li>
- <li><a href="/en-US/docs/Components.utils.importGlobalProperties">Components.utils.importGlobalProperties</a></li>
-</ul>
diff --git a/files/ru/web/api/windoworworkerglobalscope/caches/index.html b/files/ru/web/api/windoworworkerglobalscope/caches/index.html
deleted file mode 100644
index 107d43f6a4..0000000000
--- a/files/ru/web/api/windoworworkerglobalscope/caches/index.html
+++ /dev/null
@@ -1,79 +0,0 @@
----
-title: WindowOrWorkerGlobalScope.caches
-slug: Web/API/WindowOrWorkerGlobalScope/caches
-translation_of: Web/API/WindowOrWorkerGlobalScope/caches
----
-<div>{{APIRef()}}{{SeeCompatTable}}</div>
-
-<p><code><strong>caches</strong></code> {{domxref("WindowOrWorkerGlobalScope")}}  свойство только для чтения интерфейса возвращающее  объект ассоциированный с текущим контекстом {{domxref("CacheStorage")}}.</p>
-
-<p>Этот объект реализует такую  функциональность как строгое соответствие для офлайн-использования  и генерирование пользовательских ответов на запросы.</p>
-
-<h2 id="Синтаксис">Синтаксис</h2>
-
-<pre class="syntaxbox notranslate">var <em>myCacheStorage</em> = self.caches; // or just caches
-</pre>
-
-<h3 id="Значение">Значение</h3>
-
-<p>Возвращает значение {{domxref("CacheStorage")}} .</p>
-
-<h2 id="Пример">Пример</h2>
-
-<p>Данный пример показывает как надо использовать кеш в контексте <a href="/en-US/docs/Web/API/Service_Worker_API">service worker</a> для хранения в автономном режиме</p>
-
-<pre class="brush: js notranslate">this.addEventListener('install', function(event) {
- event.waitUntil(
- caches.open('v1').then(function(cache) {
- return cache.addAll([
- '/sw-test/',
- '/sw-test/index.html',
- '/sw-test/style.css',
- '/sw-test/app.js',
- '/sw-test/image-list.js',
- '/sw-test/star-wars-logo.jpg',
- '/sw-test/gallery/',
- '/sw-test/gallery/bountyHunters.jpg',
- '/sw-test/gallery/myLittleVader.jpg',
- '/sw-test/gallery/snowTroopers.jpg'
- ]);
- })
- );
-});</pre>
-
-<h2 id="Спецификации">Спецификации</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th scope="col">Specification</th>
- <th scope="col">Status</th>
- <th scope="col">Comment</th>
- </tr>
- <tr>
- <td>{{SpecName('Service Workers', '#self-caches', 'caches')}}</td>
- <td>{{Spec2('Service Workers')}}</td>
- <td>Объявлена частичная поддержка в новейшей спецификации <code>WindowOrWorkerGlobalScope</code>.</td>
- </tr>
- <tr>
- <td>{{SpecName('Service Workers')}}</td>
- <td>{{Spec2('Service Workers')}}</td>
- <td>Начальное определение.</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Совместимость_с_браузерами">Совместимость с браузерами</h2>
-
-
-
-<p>{{Compat("api.WindowOrWorkerGlobalScope.caches")}}</p>
-
-<h2 id="Также_смотрите">Также смотрите</h2>
-
-<ul>
- <li><a href="/en-US/docs/Web/API/ServiceWorker_API">Service Workers</a></li>
- <li><a href="/en-US/docs/Web/API/Web_Workers_API">Web Workers</a></li>
- <li>{{domxref("CacheStorage")}}</li>
- <li>{{domxref("Cache")}}</li>
-</ul>
diff --git a/files/ru/web/api/windoworworkerglobalscope/cleartimeout/index.html b/files/ru/web/api/windoworworkerglobalscope/cleartimeout/index.html
deleted file mode 100644
index aeedb7435c..0000000000
--- a/files/ru/web/api/windoworworkerglobalscope/cleartimeout/index.html
+++ /dev/null
@@ -1,94 +0,0 @@
----
-title: WindowOrWorkerGlobalScope.clearTimeout()
-slug: Web/API/WindowOrWorkerGlobalScope/clearTimeout
-translation_of: Web/API/WindowOrWorkerGlobalScope/clearTimeout
----
-<div>{{APIRef("HTML DOM")}}</div>
-
-<p><strong><code>clearTimeout()</code></strong> метод {{domxref("WindowOrWorkerGlobalScope")}} отменяет таймаут, ранее установленный вызовом {{domxref("WindowOrWorkerGlobalScope.setTimeout", "setTimeout()")}}.</p>
-
-<h2 id="Syntax" name="Syntax">Синтаксис</h2>
-
-<pre class="syntaxbox notranslate"><em>scope</em>.clearTimeout(<em>timeoutID</em>)
-</pre>
-
-<h3 id="Параметры">Параметры</h3>
-
-<dl>
- <dt><code><em>timeoutID</em></code></dt>
- <dd></dd>
- <dd>Идентификатор таймаута, который вы хотите отменить. Этот идентификатор был возвращён соответствующим вызовом <code>setTimeout()</code>.</dd>
-</dl>
-
-<p>It's worth noting that the pool of IDs used by {{domxref("WindowOrWorkerGlobalScope.setTimeout", "setTimeout()")}} and {{domxref("WindowOrWorkerGlobalScope.setInterval", "setInterval()")}} are shared, which means you can technically use <code>clearTimeout()</code> and {{domxref("WindowOrWorkerGlobalScope.clearInterval", "clearInterval()")}} interchangeably. However, for clarity, you should avoid doing so.</p>
-
-<h2 id="Example" name="Example">Пример использования:</h2>
-
-<p>Запустите приведённый ниже скрипт в контакте веб-страницы и кликните один раз. Вы увидите всплывающее сообщение через 1 секунду. Если вы щёлкните страницу несколько раз за одну секунду, предупреждение появится только один раз.</p>
-
-<pre class="brush: js notranslate">var alarm = {
-  remind: function(aMessage) {
-    alert(aMessage);
-    this.timeoutID = undefined;
-  },
-
-  setup: function() {
-    if (typeof this.timeoutID === 'number') {
-      this.cancel();
-    }
-
-    this.timeoutID = window.setTimeout(function(msg) {
-  this.remind(msg);
-  }.bind(this), 1000, 'Wake up!');
-  },
-
-  cancel: function() {
-    window.clearTimeout(this.timeoutID);
-  }
-};
-window.onclick = function() { alarm.setup(); };
-</pre>
-
-<h2 id="Notes" name="Notes">Примечания</h2>
-
-<p>Передача недействительного ID <code>clearTimeout()</code> ни к чему не приведёт. Исключение не создается.</p>
-
-<h2 id="Specification" name="Specification">Спецификация</h2>
-
-<table class="standard-table">
- <thead>
- <tr>
- <th scope="col">Specification</th>
- <th scope="col">Status</th>
- <th scope="col">Comment</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>{{SpecName('HTML WHATWG', 'webappapis.html#dom-cleartimeout', 'WindowOrWorkerGlobalScope.clearTimeout()')}}</td>
- <td>{{Spec2("HTML WHATWG")}}</td>
- <td>Method moved to the <code>WindowOrWorkerGlobalScope</code> mixin in the latest spec.</td>
- </tr>
- <tr>
- <td>{{SpecName('HTML WHATWG', 'webappapis.html#dom-cleartimeout', 'clearTimeout()')}}</td>
- <td>{{Spec2('HTML WHATWG')}}</td>
- <td></td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Совместимость_с_браузером">Совместимость с браузером</h2>
-
-
-
-<p>{{Compat("api.WindowOrWorkerGlobalScope.clearTimeout")}}</p>
-
-<h2 id="Смотрите_также">Смотрите также</h2>
-
-<ul>
- <li>{{domxref("WindowOrWorkerGlobalScope.setTimeout()")}}</li>
- <li>{{domxref("WindowOrWorkerGlobalScope.setInterval()")}}</li>
- <li>{{domxref("WindowOrWorkerGlobalScope.clearInterval()")}}</li>
- <li>{{domxref("Window.requestAnimationFrame()")}}</li>
- <li><a href="/en-US/docs/JavaScript/Timers/Daemons" title="JavaScript/Timers/Daemons"><em>Daemons</em> management</a></li>
-</ul>
diff --git a/files/ru/web/api/windoworworkerglobalscope/fetch/index.html b/files/ru/web/api/windoworworkerglobalscope/fetch/index.html
deleted file mode 100644
index 22b188e0bd..0000000000
--- a/files/ru/web/api/windoworworkerglobalscope/fetch/index.html
+++ /dev/null
@@ -1,168 +0,0 @@
----
-title: WindowOrWorkerGlobalScope.fetch()
-slug: Web/API/WindowOrWorkerGlobalScope/fetch
-tags:
- - Справка
- - запрос
- - метод
-translation_of: Web/API/WindowOrWorkerGlobalScope/fetch
----
-<div>{{APIRef("Fetch API")}}</div>
-
-<p>Метод <code><strong>fetch()</strong></code> , относящийся к миксину {{domxref("WindowOrWorkerGlobalScope")}}, запускает процесс извлечения ресурса из сети. Возвращает promise, содержащий {{domxref("Response")}} объект (ответ на запрос).</p>
-
-<p><code>WorkerOrGlobalScope</code> относится к {{domxref("Window")}} и {{domxref("WorkerGlobalScope")}} сразу. Это означает, что метод <code>fetch()</code> доступен практически в любом контексте, в котором бы вы не захотели получить ресурсы.</p>
-
-<p>Промис {{domxref("WindowOrWorkerGlobalScope.fetch","Fetch()")}} завершается {{jsxref("TypeError")}}, если возникает сетевая ошибка, хотя обычно это означает проблему с доступами или аналогичную ей. Для успешного завершения <code>fetch()</code> достаточно удостовериться в том, что промис выполнен и что свойство {{domxref("Response.ok")}} имеет значение <code>true</code>. HTTP статус 404 не является сетевой ошибкой.</p>
-
-<p>Метод <code>fetch()</code> контролируется директивой <code>connect-src</code> directive of <a href="/en-US/docs/Security/CSP/CSP_policy_directives">Content Security Policy</a> (политика безопасности контента), а не директивой ресурсов, которые извлекает.</p>
-
-<div class="note">
-<p><strong>На Заметку</strong>: Аргументы метода <code>fetch()</code> идентичны аргументам {{domxref("Request.Request","Request()")}} конструктора.</p>
-</div>
-
-<h2 id="Синтаксис">Синтаксис</h2>
-
-<pre class="syntaxbox">Promise&lt;Response&gt; fetch(input[, init]);</pre>
-
-<h3 id="Аргументы">Аргументы</h3>
-
-<dl>
- <dt><em>input</em></dt>
- <dd>Определяет желаемый для получения ресурс. Это может быть:
- <ul>
- <li>{{domxref("USVString")}} (строка), содержащая прямую URL ссылку на ресурс. Некоторые браузеры принимают <code>blob:</code> и <code>data:</code> , как схемы.</li>
- <li>{{domxref("Request")}} объект (объект ответа).</li>
- </ul>
- </dd>
- <dt><em>init</em> {{optional_inline}}</dt>
- <dd>Объект с опциями, содержащий пользовательские настройки, которые вы желаете применить к запросу. Возможные варианты:
- <ul>
- <li><code>method</code>: Метод запроса, например, <code>GET</code>, <code>POST</code>.</li>
- <li><code>headers</code>: Заголовки, содержащиеся в объекте {{domxref("Headers")}} или в объекте литерале с побитовыми значениями ({{domxref("ByteString")}}).</li>
- <li><code>body</code>: Тело запроса, которое может быть: {{domxref("Blob")}}, {{domxref("BufferSource")}}, {{domxref("FormData")}}, {{domxref("URLSearchParams")}}, или {{domxref("USVString")}} объектами. Обратите внимание, что <code>GET</code> или <code>HEAD</code> запрос не может иметь тела.</li>
- <li><code>mode</code>: Режим, например, <code>cors</code>, <code>no-cors</code> или <code>same-origin</code>.</li>
- <li><code>credentials</code>: Полномочия: <code>omit</code>, <code>same-origin</code> или <code>include</code>. Для автоматической отправки куки для текущего домена, эта опция должна быть указана. Начиная с Chrome 50, это свойство также принимает экземпляр класса {{domxref("FederatedCredential")}} или  {{domxref("PasswordCredential")}}.</li>
- <li><code>cache</code>: Режим кеширования запроса <code>default</code>, <code>no-store</code>, <code>reload</code>, <code>no-cache</code>, <code>force-cache</code> или <code>only-if-cached</code>.</li>
- <li><code>redirect</code>: Режим редиректа: <code>follow</code> (автоматически переадресовывать), <code>error</code> (прерывать перенаправление ошибкой) или <code>manual</code> (управлять перенаправлениями вручную). В Chrome по дефолту стоит <code>follow</code> (ранее, в Chrome 47, стояло <code>manual</code>).</li>
- <li><code>referrer</code>: {{domxref("USVString")}}, определяющая <code>no-referrer</code>, <code>client</code> или a URL. Дефолтное значение - <code>client</code>.</li>
- <li><code>referrerPolicy</code>: Определяет значение HTTP заголовка реферера. Может быть: <code>no-referrer</code>, <code>no-referrer-when-downgrade</code>, <code>origin</code>, <code>origin-when-cross-origin</code>, <code>unsafe-url</code>.</li>
- <li><code>integrity</code>: Содержит значение целостности субресурсов (<a href="/en-US/docs/Web/Security/Subresource_Integrity">subresource integrity</a>) запроса (например, <code>sha256-BpfBw7ivV8q2jLiT13fxDYAe2tJllusRSZ273h2nFSE=</code>).</li>
- <li><code>keepalive</code>: Эта опция может быть использована, чтобы разрешить запросу "пережить" страницу. Получение ресурсов с флагом <code>keepalive</code> - это альтернатива {{domxref("Navigator.sendBeacon()")}} API. </li>
- <li><code>signal</code>: Экземпляр объекта {{domxref("AbortSignal")}}; позволяет коммуницировать с fetch запросом и, если нужно, отменять его с помощью {{domxref("AbortController")}}.</li>
- </ul>
- </dd>
-</dl>
-
-<h3 id="Возвращаемое_значение">Возвращаемое значение</h3>
-
-<p>{{domxref("Promise")}}, содержащий {{domxref("Response")}} объект (ответ на запрос).</p>
-
-<h3 id="Исключения">Исключения</h3>
-
-<table class="standard-table">
- <thead>
- <tr>
- <th scope="col"><strong>Тип</strong></th>
- <th scope="col"><strong>Описание</strong></th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><code>AbortError</code></td>
- <td>Запрос был отменён (используя {{domxref("AbortController.abort()")}}).</td>
- </tr>
- <tr>
- <td><code>TypeError</code></td>
- <td>Начиная с версии <a href="/en-US/docs/Mozilla/Firefox/Releases/43">Firefox 43</a>, <code>fetch()</code> завершится ошибкой <code>TypeError</code>, если URL имеет такие полномочия, как <code>http://user:password@example.com</code>.</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Пример">Пример</h2>
-
-<p>В нашем <a href="https://github.com/mdn/fetch-examples/tree/master/fetch-request">Fetch Request примере</a> (см. <a href="https://mdn.github.io/fetch-examples/fetch-request/">Fetch Request live</a>) мы создаём новый объект {{domxref("Request")}} (запроса), используя релевантный конструктор, а затем получаем его вызовом <code>fetch()</code>. Так как запрашиваемый ресурс - изображение, для того, чтобы присвоить ему подходящий MIME тип и обработать должным образом, мы применяем к ответу метод {{domxref("Body.blob()")}}, после чего создаём для него Object URL и передаём её в элемент {{htmlelement("img")}}.</p>
-
-<pre class="brush: js">var myImage = document.querySelector('img');
-
-var myRequest = new Request('flowers.jpg');
-
-fetch(myRequest).then(function(response) {
- return response.blob();
-}).then(function(response) {
- var objectURL = URL.createObjectURL(response);
- myImage.src = objectURL;
-});</pre>
-
-<p>В нашем <a href="https://github.com/mdn/fetch-examples/blob/master/fetch-with-init-then-request/index.html">Fetch with init then Request примере</a> (см. <a href="https://mdn.github.io/fetch-examples/fetch-with-init-then-request/">Fetch Request init live</a>) мы делаем тоже самое, за исключением того, что передаём в качестве аргумента для <code>fetch()</code> объект init:</p>
-
-<pre class="brush: js">var myImage = document.querySelector('img');
-
-var myHeaders = new Headers();
-myHeaders.append('Content-Type', 'image/jpeg');
-
-var myInit = { method: 'GET',
- headers: myHeaders,
- mode: 'cors',
- cache: 'default' };
-
-var myRequest = new Request('flowers.jpg');
-
-fetch(myRequest,myInit).then(function(response) {
- ...
-});</pre>
-
-<p>Обратите внимание, что объект init в качестве аргумента можно передать и в конструктор <code>Request</code> для получения аналогичного результата, например:</p>
-
-<pre class="brush: js">var myRequest = new Request('flowers.jpg', myInit);</pre>
-
-<p>Допустимо использования объекта литерала в качестве <code>headers</code> в <code>init</code>.</p>
-
-<pre class="brush: js">var myInit = { method: 'GET',
- headers: {
- 'Content-Type': 'image/jpeg'
- },
- mode: 'cors',
- cache: 'default' };
-
-var myRequest = new Request('flowers.jpg', myInit);
-</pre>
-
-<h2 id="Спецификации">Спецификации</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th scope="col">Спецификация</th>
- <th scope="col">Статус</th>
- <th scope="col">Комментарий</th>
- </tr>
- <tr>
- <td>{{SpecName('Fetch','#fetch-method','fetch()')}}</td>
- <td>{{Spec2('Fetch')}}</td>
- <td>Частично определена в новейшей спецификации <code>WindowOrWorkerGlobalScope</code>.</td>
- </tr>
- <tr>
- <td>{{SpecName('Fetch','#dom-global-fetch','fetch()')}}</td>
- <td>{{Spec2('Fetch')}}</td>
- <td>Первоначальное определение</td>
- </tr>
- <tr>
- <td>{{SpecName('Credential Management')}}</td>
- <td>{{Spec2('Credential Management')}}</td>
- <td>Добавлена возможность установить экземпляр класса {{domxref("FederatedCredential")}} или {{domxref("PasswordCredential")}} как возможное значение для <code>init.credentials</code>.</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Совместимость_с_браузерами">Совместимость с браузерами</h2>
-<p>{{Compat("api.WindowOrWorkerGlobalScope.fetch")}}</p>
-
-<h2 id="Смотрите_также">Смотрите также</h2>
-
-<ul>
- <li><a href="/en-US/docs/Web/API/Fetch_API">Fetch API</a></li>
- <li><a href="/en-US/docs/Web/API/ServiceWorker_API">ServiceWorker API</a></li>
- <li><a href="/en-US/docs/Web/HTTP/Access_control_CORS">HTTP access control (CORS)</a></li>
- <li><a href="/en-US/docs/Web/HTTP">HTTP</a></li>
-</ul>
diff --git a/files/ru/web/api/windoworworkerglobalscope/setinterval/index.html b/files/ru/web/api/windoworworkerglobalscope/setinterval/index.html
deleted file mode 100644
index c77c422bf1..0000000000
--- a/files/ru/web/api/windoworworkerglobalscope/setinterval/index.html
+++ /dev/null
@@ -1,641 +0,0 @@
----
-title: WindowOrWorkerGlobalScope.setInterval()
-slug: Web/API/WindowOrWorkerGlobalScope/setInterval
-translation_of: Web/API/WindowOrWorkerGlobalScope/setInterval
----
-<div>{{APIRef("HTML DOM")}}</div>
-
-<p><span class="seoSummary">Метод <strong><code>setInterval()</code></strong> предложен для {{domxref("Window")}} и {{domxref("Worker")}} интерфейсов. Он циклически вызывает функцию или участок кода с фиксированной паузой между каждым вызовом.</span> Уникальный идентификатор intervalID, возвращаемый методом, позволяет впоследствии удалить запущенный <span class="seoSummary"><strong><code>setInterval</code></strong></span> c помощью {{domxref("WindowOrWorkerGlobalScope.clearInterval", "clearInterval()")}}. Метод определён с помощью миксина {{domxref("WindowOrWorkerGlobalScope")}}.</p>
-
-<h2 id="Синтаксис">Синтаксис</h2>
-
-<pre class="syntaxbox notranslate"><em>var intervalID</em> = scope.setInterval(<em>func</em>, <em>delay</em>[, <em>param1</em>, <em>param2</em>, ...]);
-<em>var intervalID</em> = scope.setInterval(<em>code</em>, <em>delay</em>);
-</pre>
-
-<h3 id="Параметры">Параметры</h3>
-
-<dl>
- <dt><code>func</code></dt>
- <dd>{{jsxref("function")}} - функция, которая будет вызываться каждые <code>delay</code> миллисекунд. Ожидается, что функция не принимает параметры и ничего не возвращает.</dd>
- <dt><code>code</code></dt>
- <dd>Этот необязательный синтаксис позволяет вам включать строку вместо функции, которая компилируется и выполняется каждые <code>delay</code> миллисекунд. Однако такая форма не рекомендуется по тем же причинам, которые делают {{jsxref("eval", "eval()")}} угрозой безопасности.</dd>
- <dt><code>delay</code></dt>
- <dd>Время в миллисекундах (одна тысячная секунды), на которое таймер выполнит задержку между вызовом функции. Если задано значение меньше 10, то будет использовано число 10. На самом деле задержка может быть больше чем указано, дополнительное объяснение приведено здесь:  {{SectionOnPage("/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout", "Reasons for delays longer than specified")}}.</dd>
- <dt><code>param1, ..., paramN</code> {{optional_inline}}</dt>
- <dd>Дополнительные параметры, передаваемые в функцию <em>func</em>.</dd>
-</dl>
-
-<div class="note">
-<p><strong>Примечание</strong>: Передача дополнительных аргументов в <code>setInterval()</code> в первом синтаксисе не работает в Internet Explorer 9 и более ранних версиях.Если вы хотите включить эту функцию в этом браузере, вам следует использовать polyfill (смотрите раздел <a href="#Callback_arguments">Callback аргументы</a>).</p>
-</div>
-
-<h3 id="Возвращаемое_значение">Возвращаемое значение</h3>
-
-<p>Возвращаемый <code>intervalID</code> представляет из себя ненулевое числовое значение, которое идентифицирует таймер, созданный вызовом <code>setInterval()</code>; Это значение может быть передано в {{domxref("WindowOrWorkerGlobalScope.clearInterval()")}} для отмены таймера.</p>
-
-<p>It may be helpful to be aware that <code>setInterval()</code> and {{domxref("WindowOrWorkerGlobalScope.setTimeout", "setTimeout()")}} share the same pool of IDs, and that <code>clearInterval()</code> and {{domxref("WindowOrWorkerGlobalScope.clearTimeout", "clearTimeout()")}} can technically be used interchangeably. For clarity, however, you should try to always match them to avoid confusion when maintaining your code.</p>
-
-<div class="note"><strong>Note</strong>: The <code>delay</code> parameter is converted to a signed 32-bit integer. This effectively limits <code>delay</code> to 2147483647 ms, since it's specified as a signed integer in the IDL.</div>
-
-<h2 id="Примеры">Примеры</h2>
-
-<h3 id="Пример_1_Базовый_синтаксис">Пример 1: Базовый синтаксис</h3>
-
-<p>The following example demonstrates <code>setInterval()</code>'s basic syntax.</p>
-
-<pre class="brush:js notranslate">var intervalID = window.setInterval(myCallback, 500);
-
-function myCallback() {
- // Your code here
-}
-</pre>
-
-<h3 id="Пример_2_Чередование_двух_цветов">Пример 2: <span class="VIiyi" lang="ru"><span class="ChMk0b JLqJ4b"><span>Чередование двух цветов</span></span></span></h3>
-
-<p>В следующем примере вызывается функция <code>flashtext()</code> раз в секунду, до того момента, как будет нажата кнопка Stop.</p>
-
-<pre class="brush:html notranslate">&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
- &lt;meta charset="UTF-8" /&gt;
- &lt;title&gt;setInterval/clearInterval example&lt;/title&gt;
-
- &lt;script&gt;
- var nIntervId;
-
- function changeColor() {
- nIntervId = setInterval(flashText, 1000);
- }
-
- function flashText() {
- var oElem = document.getElementById('my_box');
- oElem.style.color = oElem.style.color == 'red' ? 'blue' : 'red';
- // oElem.style.color == 'red' ? 'blue' : 'red' это тернарный оператор.
- }
-
- function stopTextColor() {
- clearInterval(nIntervId);
- }
- &lt;/script&gt;
-&lt;/head&gt;
-
-&lt;body onload="changeColor();"&gt;
- &lt;div id="my_box"&gt;
- &lt;p&gt;Hello World&lt;/p&gt;
- &lt;/div&gt;
-
- &lt;button onclick="stopTextColor();"&gt;Stop&lt;/button&gt;
-&lt;/body&gt;
-&lt;/html&gt;
-</pre>
-
-<h3 id="Пример_3_Симуляция_пишущей_машинки"><span class="VIiyi" lang="ru"><span class="ChMk0b JLqJ4b"><span>Пример 3: Симуляция пишущей машинки</span></span></span></h3>
-
-<p>The following example simulates typewriter by first clearing and then slowly typing content into the <a href="/en-US/docs/DOM/NodeList"><code>NodeList</code></a> that matches a specified group of selectors.</p>
-
-<pre class="brush:html notranslate">&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset="UTF-8" /&gt;
-&lt;title&gt;JavaScript Typewriter - MDN Example&lt;/title&gt;
-&lt;script&gt;
- function Typewriter (sSelector, nRate) {
-
- function clean () {
- clearInterval(nIntervId);
- bTyping = false;
- bStart = true;
- oCurrent = null;
- aSheets.length = nIdx = 0;
- }
-
- function scroll (oSheet, nPos, bEraseAndStop) {
- if (!oSheet.hasOwnProperty('parts') || aMap.length &lt; nPos) { return true; }
-
- var oRel, bExit = false;
-
- if (aMap.length === nPos) { aMap.push(0); }
-
- while (aMap[nPos] &lt; oSheet.parts.length) {
- oRel = oSheet.parts[aMap[nPos]];
-
- scroll(oRel, nPos + 1, bEraseAndStop) ? aMap[nPos]++ : bExit = true;
-
- if (bEraseAndStop &amp;&amp; (oRel.ref.nodeType - 1 | 1) === 3 &amp;&amp; oRel.ref.nodeValue) {
- bExit = true;
- oCurrent = oRel.ref;
- sPart = oCurrent.nodeValue;
- oCurrent.nodeValue = '';
- }
-
- oSheet.ref.appendChild(oRel.ref);
- if (bExit) { return false; }
- }
-
- aMap.length--;
- return true;
- }
-
- function typewrite () {
- if (sPart.length === 0 &amp;&amp; scroll(aSheets[nIdx], 0, true) &amp;&amp; nIdx++ === aSheets.length - 1) { clean(); return; }
-
- oCurrent.nodeValue += sPart.charAt(0);
- sPart = sPart.slice(1);
- }
-
- function Sheet (oNode) {
- this.ref = oNode;
- if (!oNode.hasChildNodes()) { return; }
- this.parts = Array.prototype.slice.call(oNode.childNodes);
-
- for (var nChild = 0; nChild &lt; this.parts.length; nChild++) {
- oNode.removeChild(this.parts[nChild]);
- this.parts[nChild] = new Sheet(this.parts[nChild]);
- }
- }
-
- var
- nIntervId, oCurrent = null, bTyping = false, bStart = true,
- nIdx = 0, sPart = "", aSheets = [], aMap = [];
-
- this.rate = nRate || 100;
-
- this.play = function () {
- if (bTyping) { return; }
- if (bStart) {
- var aItems = document.querySelectorAll(sSelector);
-
- if (aItems.length === 0) { return; }
- for (var nItem = 0; nItem &lt; aItems.length; nItem++) {
- aSheets.push(new Sheet(aItems[nItem]));
- /* Uncomment the following line if you have previously hidden your elements via CSS: */
- // aItems[nItem].style.visibility = "visible";
- }
-
- bStart = false;
- }
-
- nIntervId = setInterval(typewrite, this.rate);
- bTyping = true;
- };
-
- this.pause = function () {
- clearInterval(nIntervId);
- bTyping = false;
- };
-
- this.terminate = function () {
- oCurrent.nodeValue += sPart;
- sPart = "";
- for (nIdx; nIdx &lt; aSheets.length; scroll(aSheets[nIdx++], 0, false));
- clean();
- };
-}
-
-/* usage: */
-var oTWExample1 = new Typewriter(/* elements: */ '#article, h1, #info, #copyleft', /* frame rate (optional): */ 15);
-
-/* default frame rate is 100: */
-var oTWExample2 = new Typewriter('#controls');
-
-/* you can also change the frame rate value modifying the "rate" property; for example: */
-// oTWExample2.rate = 150;
-
-onload = function () {
- oTWExample1.play();
- oTWExample2.play();
-};
-&lt;/script&gt;
-&lt;style type="text/css"&gt;
-span.intLink, a, a:visited {
- cursor: pointer;
- color: #000000;
- text-decoration: underline;
-}
-
-#info {
- width: 180px;
- height: 150px;
- float: right;
- background-color: #eeeeff;
- padding: 4px;
- overflow: auto;
- font-size: 12px;
- margin: 4px;
- border-radius: 5px;
- /* visibility: hidden; */
-}
-&lt;/style&gt;
-&lt;/head&gt;
-
-&lt;body&gt;
-
-&lt;p id="copyleft" style="font-style: italic; font-size: 12px; text-align: center;"&gt;CopyLeft 2012 by &lt;a href="https://developer.mozilla.org/" target="_blank"&gt;Mozilla Developer Network&lt;/a&gt;&lt;/p&gt;
-&lt;p id="controls" style="text-align: center;"&gt;[&amp;nbsp;&lt;span class="intLink" onclick="oTWExample1.play();"&gt;Play&lt;/span&gt; | &lt;span class="intLink" onclick="oTWExample1.pause();"&gt;Pause&lt;/span&gt; | &lt;span class="intLink" onclick="oTWExample1.terminate();"&gt;Terminate&lt;/span&gt;&amp;nbsp;]&lt;/p&gt;
-&lt;div id="info"&gt;
-Vivamus blandit massa ut metus mattis in fringilla lectus imperdiet. Proin ac ante a felis ornare vehicula. Fusce pellentesque lacus vitae eros convallis ut mollis magna pellentesque. Pellentesque placerat enim at lacus ultricies vitae facilisis nisi fringilla. In tincidunt tincidunt tincidunt.
-&lt;/div&gt;
-&lt;h1&gt;JavaScript Typewriter&lt;/h1&gt;
-
-&lt;div id="article"&gt;
-&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ultrices dolor ac dolor imperdiet ullamcorper. Suspendisse quam libero, luctus auctor mollis sed, malesuada condimentum magna. Quisque in ante tellus, in placerat est. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec a mi magna, quis mattis dolor. Etiam sit amet ligula quis urna auctor imperdiet nec faucibus ante. Mauris vel consectetur dolor. Nunc eget elit eget velit pulvinar fringilla consectetur aliquam purus. Curabitur convallis, justo posuere porta egestas, velit erat ornare tortor, non viverra justo diam eget arcu. Phasellus adipiscing fermentum nibh ac commodo. Nam turpis nunc, suscipit a hendrerit vitae, volutpat non ipsum.&lt;/p&gt;
-&lt;form&gt;
-&lt;p&gt;Phasellus ac nisl lorem: &lt;input type="text" /&gt;&lt;br /&gt;
-&lt;textarea style="width: 400px; height: 200px;"&gt;Nullam commodo suscipit lacus non aliquet. Phasellus ac nisl lorem, sed facilisis ligula. Nam cursus lobortis placerat. Sed dui nisi, elementum eu sodales ac, placerat sit amet mauris. Pellentesque dapibus tellus ut ipsum aliquam eu auctor dui vehicula. Quisque ultrices laoreet erat, at ultrices tortor sodales non. Sed venenatis luctus magna, ultricies ultricies nunc fringilla eget. Praesent scelerisque urna vitae nibh tristique varius consequat neque luctus. Integer ornare, erat a porta tempus, velit justo fermentum elit, a fermentum metus nisi eu ipsum. Vivamus eget augue vel dui viverra adipiscing congue ut massa. Praesent vitae eros erat, pulvinar laoreet magna. Maecenas vestibulum mollis nunc in posuere. Pellentesque sit amet metus a turpis lobortis tempor eu vel tortor. Cras sodales eleifend interdum.&lt;/textarea&gt;&lt;/p&gt;
-&lt;p&gt;&lt;input type="submit" value="Send" /&gt;
-&lt;/form&gt;
-&lt;p&gt;Duis lobortis sapien quis nisl luctus porttitor. In tempor semper libero, eu tincidunt dolor eleifend sit amet. Ut nec velit in dolor tincidunt rhoncus non non diam. Morbi auctor ornare orci, non euismod felis gravida nec. Curabitur elementum nisi a eros rutrum nec blandit diam placerat. Aenean tincidunt risus ut nisi consectetur cursus. Ut vitae quam elit. Donec dignissim est in quam tempor consequat. Aliquam aliquam diam non felis convallis suscipit. Nulla facilisi. Donec lacus risus, dignissim et fringilla et, egestas vel eros. Duis malesuada accumsan dui, at fringilla mauris bibStartum quis. Cras adipiscing ultricies fermentum. Praesent bibStartum condimentum feugiat.&lt;/p&gt;
-&lt;p&gt;Nam faucibus, ligula eu fringilla pulvinar, lectus tellus iaculis nunc, vitae scelerisque metus leo non metus. Proin mattis lobortis lobortis. Quisque accumsan faucibus erat, vel varius tortor ultricies ac. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nec libero nunc. Nullam tortor nunc, elementum a consectetur et, ultrices eu orci. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque a nisl eu sem vehicula egestas.&lt;/p&gt;
-&lt;/div&gt;
-&lt;/body&gt;
-&lt;/html&gt;</pre>
-
-<p><a href="/files/3997/typewriter.html">View this demo in action</a>. See also: <a href="/en-US/docs/DOM/window.clearInterval"><code>clearInterval()</code></a>.</p>
-
-<h2 id="Аргументы_колбэк-функции">Аргументы колбэк-функции</h2>
-
-<p>As previously discussed, Internet Explorer versions 9 and below do not support the passing of arguments to the callback function in either <code>setTimeout()</code> or <code>setInterval()</code>. The following <strong>IE-specific</strong> code demonstrates a method for overcoming this limitation.  To use, simply add the following code to the top of your script.</p>
-
-<pre class="brush:js notranslate">/*\
-|*|
-|*| IE-specific polyfill that enables the passage of arbitrary arguments to the
-|*| callback functions of javascript timers (HTML5 standard syntax).
-|*|
-|*| https://developer.mozilla.org/en-US/docs/Web/API/window.setInterval
-|*| https://developer.mozilla.org/User:fusionchess
-|*|
-|*| Syntax:
-|*| var timeoutID = window.setTimeout(func, delay[, param1, param2, ...]);
-|*| var timeoutID = window.setTimeout(code, delay);
-|*| var intervalID = window.setInterval(func, delay[, param1, param2, ...]);
-|*| var intervalID = window.setInterval(code, delay);
-|*|
-\*/
-
-if (document.all &amp;&amp; !window.setTimeout.isPolyfill) {
- var __nativeST__ = window.setTimeout;
- window.setTimeout = function (vCallback, nDelay /*, argumentToPass1, argumentToPass2, etc. */) {
- var aArgs = Array.prototype.slice.call(arguments, 2);
- return __nativeST__(vCallback instanceof Function ? function () {
- vCallback.apply(null, aArgs);
- } : vCallback, nDelay);
- };
- window.setTimeout.isPolyfill = true;
-}
-
-if (document.all &amp;&amp; !window.setInterval.isPolyfill) {
- var __nativeSI__ = window.setInterval;
- window.setInterval = function (vCallback, nDelay /*, argumentToPass1, argumentToPass2, etc. */) {
- var aArgs = Array.prototype.slice.call(arguments, 2);
- return __nativeSI__(vCallback instanceof Function ? function () {
- vCallback.apply(null, aArgs);
- } : vCallback, nDelay);
- };
- window.setInterval.isPolyfill = true;
-}
-</pre>
-
-<p>Another possibility is to use an anonymous function to call your callback, although this solution is a bit more expensive. Example:</p>
-
-<pre class="brush:js notranslate">var intervalID = setInterval(function() { myFunc('one', 'two', 'three'); }, 1000);</pre>
-
-<p>Another possibility is to use <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind">function's bind</a>. Example:</p>
-
-<pre class="brush:js notranslate">var intervalID = setInterval(function(arg1) {}.bind(undefined, 10), 1000);</pre>
-
-<p>{{h3_gecko_minversion("Inactive tabs", "5.0")}}</p>
-
-<p>Starting in Gecko 5.0 {{geckoRelease("5.0")}}, intervals are clamped to fire no more often than once per second in inactive tabs.</p>
-
-<h2 id="Проблема_с_this">Проблема с "<a href="/en-US/docs/Web/JavaScript/Reference/Operators/this"><code>this</code></a>"</h2>
-
-<p>When you pass a method to <code>setInterval()</code> or any other function, it is invoked with the wrong <a href="/en-US/docs/Web/JavaScript/Reference/Operators/this"><code>this</code></a> value. This problem is explained in detail in the <a href="/en-US/docs/Web/JavaScript/Reference/Operators/this#As_an_object_method">JavaScript reference</a>.</p>
-
-<h3 id="Объяснение">Объяснение</h3>
-
-<p>Code executed by <code>setInterval()</code> runs in a separate execution context than the function from which it was called. As a consequence, the <a href="/en-US/docs/Web/JavaScript/Reference/Operators/this"><code>this</code></a> keyword for the called function is set to the <code>window</code> (or <code>global</code>) object, it is not the same as the <code>this</code> value for the function that called <code>setTimeout</code>. See the following example (which uses <code>setTimeout()</code> instead of <code>setInterval()</code> – the problem, in fact, is the same for both timers):</p>
-
-<pre class="brush:js notranslate">myArray = ['zero', 'one', 'two'];
-
-myArray.myMethod = function (sProperty) {
- alert(arguments.length &gt; 0 ? this[sProperty] : this);
-};
-
-myArray.myMethod(); // prints "zero,one,two"
-myArray.myMethod(1); // prints "one"
-setTimeout(myArray.myMethod, 1000); // prints "[object Window]" after 1 second
-setTimeout(myArray.myMethod, 1500, "1"); // prints "undefined" after 1,5 seconds
-// passing the 'this' object with .call won't work
-// because this will change the value of this inside setTimeout itself
-// while we want to change the value of this inside myArray.myMethod
-// in fact, it will be an error because setTimeout code expects this to be the window object:
-setTimeout.call(myArray, myArray.myMethod, 2000); // error: "NS_ERROR_XPC_BAD_OP_ON_WN_PROTO: Illegal operation on WrappedNative prototype object"
-setTimeout.call(myArray, myArray.myMethod, 2500, 2); // same error
-</pre>
-
-<p>As you can see there are no ways to pass the <code>this</code> object to the callback function in the legacy JavaScript.</p>
-
-<h3 id="Возможное_решение">Возможное решение</h3>
-
-<p>A possible way to solve the "<code>this</code>" problem is to replace the two native <code>setTimeout()</code> or <code>setInterval()</code> global functions with two <em>non-native</em> ones that enable their invocation through the <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Function/call"><code>Function.prototype.call</code></a> method. The following example shows a possible replacement:</p>
-
-<pre class="brush:js notranslate">// Enable the passage of the 'this' object through the JavaScript timers
-
-var __nativeST__ = window.setTimeout, __nativeSI__ = window.setInterval;
-
-window.setTimeout = function (vCallback, nDelay /*, argumentToPass1, argumentToPass2, etc. */) {
- var oThis = this, aArgs = Array.prototype.slice.call(arguments, 2);
- return __nativeST__(vCallback instanceof Function ? function () {
- vCallback.apply(oThis, aArgs);
- } : vCallback, nDelay);
-};
-
-window.setInterval = function (vCallback, nDelay /*, argumentToPass1, argumentToPass2, etc. */) {
- var oThis = this, aArgs = Array.prototype.slice.call(arguments, 2);
- return __nativeSI__(vCallback instanceof Function ? function () {
- vCallback.apply(oThis, aArgs);
- } : vCallback, nDelay);
-};</pre>
-
-<div class="note">These two replacements also enable the HTML5 standard passage of arbitrary arguments to the callback functions of timers in IE. So they can be used as <em>non-standard-compliant</em> polyfills also. See the <a href="#Callback_arguments">callback arguments paragraph</a> for a <em>standard-compliant</em> polyfill.</div>
-
-<p>Новое тестируемое свойство:</p>
-
-<pre class="brush:js notranslate">myArray = ['zero', 'one', 'two'];
-
-myArray.myMethod = function (sProperty) {
- alert(arguments.length &gt; 0 ? this[sProperty] : this);
-};
-
-setTimeout(alert, 1500, 'Hello world!'); // the standard use of setTimeout and setInterval is preserved, but...
-setTimeout.call(myArray, myArray.myMethod, 2000); // prints "zero,one,two" after 2 seconds
-setTimeout.call(myArray, myArray.myMethod, 2500, 2); // prints "two" after 2,5 seconds
-</pre>
-
-<p>Another, more complex, solution for<strong> </strong>the <a href="/en-US/docs/Web/JavaScript/Reference/Operators/this"><code>this</code></a> problem<strong> </strong>is <a href="#A_little_framework">the following framework</a>.</p>
-
-<div class="note">JavaScript 1.8.5 introduces the <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind">Function.prototype.bind()</a></code> method, which lets you specify the value that should be used as <code>this</code> for all calls to a given function. This lets you easily bypass problems where it's unclear what this will be, depending on the context from which your function was called. Also, ES2015 supports <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions">arrow functions</a>, with lexical this allowing us to write setInterval( () =&gt; this.myMethod) if we're inside myArray method.</div>
-
-<h2 id="MiniDaemon_-_фреймворк_для_управления_таймерами">MiniDaemon - фреймворк для управления таймерами</h2>
-
-<p>In pages requiring many timers, it can often be difficult to keep track of all of the running timer events. One approach to solving this problem is to store information about the state of a timer in an object. Following is a minimal example of such an abstraction. The constructor architecture explicitly avoids the use of closures. It also offers an alternative way to pass the <a href="/en-US/docs/Web/JavaScript/Reference/Operators/this"><code>this</code></a> object to the callback function (see <a href="#The_.22this.22_problem">The "this" problem</a> for details). The following code is also <a href="https://github.com/madmurphy/minidaemon.js">available on GitHub</a>.</p>
-
-<div class="note">For a more complex but still modular version of it (<code><em>Daemon</em></code>) see <a href="/en-US/Add-ons/Code_snippets/Timers/Daemons">JavaScript Daemons Management</a>. This more complex version is nothing but a big and scalable collection of methods for the <code><em>Daemon</em></code> constructor. However, the <code><em>Daemon</em></code> constructor itself is nothing but a clone of <code><em>MiniDaemon</em></code> with an added support for <em>init</em> and <em>onstart</em> functions declarable during the instantiation of the <code><em>daemon</em></code>. <strong>So the <code><em>MiniDaemon</em></code> framework remains the recommended way for simple animations</strong>, because <code><em>Daemon</em></code> without its collection of methods is essentially a clone of it.</div>
-
-<h3 id="minidaemon.js">minidaemon.js</h3>
-
-<pre class="brush:js notranslate">/*\
-|*|
-|*| :: MiniDaemon ::
-|*|
-|*| Revision #2 - September 26, 2014
-|*|
-|*| https://developer.mozilla.org/en-US/docs/Web/API/window.setInterval
-|*| https://developer.mozilla.org/User:fusionchess
-|*| https://github.com/madmurphy/minidaemon.js
-|*|
-|*| This framework is released under the GNU Lesser General Public License, version 3 or later.
-|*| http://www.gnu.org/licenses/lgpl-3.0.html
-|*|
-\*/
-
-function MiniDaemon (oOwner, fTask, nRate, nLen) {
- if (!(this &amp;&amp; this instanceof MiniDaemon)) { return; }
- if (arguments.length &lt; 2) { throw new TypeError('MiniDaemon - not enough arguments'); }
- if (oOwner) { this.owner = oOwner; }
- this.task = fTask;
- if (isFinite(nRate) &amp;&amp; nRate &gt; 0) { this.rate = Math.floor(nRate); }
- if (nLen &gt; 0) { this.length = Math.floor(nLen); }
-}
-
-MiniDaemon.prototype.owner = null;
-MiniDaemon.prototype.task = null;
-MiniDaemon.prototype.rate = 100;
-MiniDaemon.prototype.length = Infinity;
-
- /* These properties should be read-only */
-
-MiniDaemon.prototype.SESSION = -1;
-MiniDaemon.prototype.INDEX = 0;
-MiniDaemon.prototype.PAUSED = true;
-MiniDaemon.prototype.BACKW = true;
-
- /* Global methods */
-
-MiniDaemon.forceCall = function (oDmn) {
- oDmn.INDEX += oDmn.BACKW ? -1 : 1;
- if (oDmn.task.call(oDmn.owner, oDmn.INDEX, oDmn.length, oDmn.BACKW) === false || oDmn.isAtEnd()) { oDmn.pause(); return false; }
- return true;
-};
-
- /* Instances methods */
-
-MiniDaemon.prototype.isAtEnd = function () {
- return this.BACKW ? isFinite(this.length) &amp;&amp; this.INDEX &lt; 1 : this.INDEX + 1 &gt; this.length;
-};
-
-MiniDaemon.prototype.synchronize = function () {
- if (this.PAUSED) { return; }
- clearInterval(this.SESSION);
- this.SESSION = setInterval(MiniDaemon.forceCall, this.rate, this);
-};
-
-MiniDaemon.prototype.pause = function () {
- clearInterval(this.SESSION);
- this.PAUSED = true;
-};
-
-MiniDaemon.prototype.start = function (bReverse) {
- var bBackw = Boolean(bReverse);
- if (this.BACKW === bBackw &amp;&amp; (this.isAtEnd() || !this.PAUSED)) { return; }
- this.BACKW = bBackw;
- this.PAUSED = false;
- this.synchronize();
-};
-</pre>
-
-<div class="note">MiniDaemon passes arguments to the callback function. If you want to work on it with browsers that natively do not support this feature, use one of the methods proposed above.</div>
-
-<h3 id="Синтаксис_2">Синтаксис</h3>
-
-<p><code>var myDaemon = new MiniDaemon(<em>thisObject</em>, <em>callback</em>[</code><code>, <em>rate</em></code><code>[, <em>length</em>]]);</code></p>
-
-<h3 id="Описание">Описание</h3>
-
-<p>Returns a JavaScript <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object"><code>Object</code></a> containing all information needed by an animation (like the <a href="/en-US/docs/Web/JavaScript/Reference/Operators/this"><code>this</code></a> object, the callback function, the length, the frame-rate).</p>
-
-<h4 id="Параметры_2">Параметры</h4>
-
-<dl>
- <dt><code>thisObject</code></dt>
- <dd>The <a href="/en-US/docs/Web/JavaScript/Reference/Operators/this"><code>this</code></a> object on which the <em>callback</em> function is called. It can be an <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object"><code>object</code></a> or <code>null</code>.</dd>
- <dt><code>callback</code></dt>
- <dd>The function that is repeatedly invoked . <strong>It is called with three parameters</strong>: <em>index</em> (the iterative index of each invocation), <em>length</em> (the number of total invocations assigned to the <em>daemon</em> - finite or <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Infinity"><code>Infinity</code></a>) and <em>backwards</em> (a boolean expressing whether the <em>index</em> is increasing or decreasing). It is something like <em>callback</em>.call(<em>thisObject</em>, <em>index</em>, <em>length</em>, <em>backwards</em>). <strong>If the callback function returns a <code>false</code> value the <em>daemon</em> is paused</strong>.</dd>
- <dt><code>rate (optional)</code></dt>
- <dd>The time lapse (in number of milliseconds) between each invocation. The default value is 100.</dd>
- <dt><code>length (optional)</code></dt>
- <dd>The total number of invocations. It can be a positive integer or <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity"><code>Infinity</code></a>. The default value is <code>Infinity</code>.</dd>
-</dl>
-
-<h4 id="MiniDaemon_instances_properties"><code>MiniDaemon</code> instances properties</h4>
-
-<dl>
- <dt><code>myDaemon.owner</code></dt>
- <dd>The <a href="/en-US/docs/Web/JavaScript/Reference/Operators/this"><code>this</code></a> object on which is executed the daemon (read/write). It can be an <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object"><code>object</code></a> or <code>null</code>.</dd>
- <dt><code>myDaemon.task</code></dt>
- <dd>The function that is repeatedly invoked (read/write). It is called with three arguments: <em>index</em> (the iterative index of each invocation), <em>length</em> (the number of total invocations assigned to the daemon - finite or <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Infinity"><code>Infinity</code></a>) and backwards (a boolean expressing whether the <em>index</em> is decreasing or not) – see above. If the <code>myDaemon.task</code> function returns a <code>false</code> value the <em>daemon</em> is paused.</dd>
- <dt><code>myDaemon.rate</code></dt>
- <dd>Промежуток времени (в миллисекундах) между каждым вызовом (чтение / запись).</dd>
- <dt><code>myDaemon.length</code></dt>
- <dd>Итоговое количество вызовов. Это может быть положительное целое число или бесконечность <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity"><code>Infinity</code></a> (чтение / запись).</dd>
-</dl>
-
-<h4 id="MiniDaemon_instances_methods"><code>MiniDaemon</code> instances methods</h4>
-
-<dl>
- <dt><code>myDaemon.isAtEnd()</code></dt>
- <dd>Возвращает логическое значение (true или false), в зависимости от того, находится ли <em>daemon</em> в начальной / конечной позиции или нет.  </dd>
- <dt><code>myDaemon.synchronize()</code></dt>
- <dd>Synchronize the timer of a started daemon with the time of its invocation.</dd>
- <dt><code>myDaemon.pause()</code></dt>
- <dd>Pauses the daemon.</dd>
- <dt><code>myDaemon.start([<em>reverse</em>])</code></dt>
- <dd>Starts the daemon forward (<em>index</em> of each invocation increasing) or backwards (<em>index</em> decreasing).</dd>
-</dl>
-
-<h4 id="MiniDaemon_global_object_methods"><code>MiniDaemon</code> global object methods</h4>
-
-<dl>
- <dt><code>MiniDaemon.forceCall(<em>minidaemon</em>)</code></dt>
- <dd>Forces a single callback to the <code><em>minidaemon</em>.task</code> function regardless of the fact that the end has been reached or not. In any case the internal <code>INDEX</code> property is increased/decreased (depending on the actual direction of the process).</dd>
-</dl>
-
-<h3 id="Пример_использования">Пример использования</h3>
-
-<p>Ваша HTML страница:</p>
-
-<pre class="brush:html notranslate">&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
- &lt;meta charset="UTF-8" /&gt;
- &lt;title&gt;MiniDaemin Example - MDN&lt;/title&gt;
- &lt;script type="text/javascript" src="minidaemon.js"&gt;&lt;/script&gt;
- &lt;style type="text/css"&gt;
- #sample_div {
- visibility: hidden;
- }
- &lt;/style&gt;
-&lt;/head&gt;
-
-&lt;body&gt;
- &lt;p&gt;
-  &lt;input type="button" onclick="fadeInOut.start(false /* optional */);" value="fade in" /&gt;
- &lt;input type="button" onclick="fadeInOut.start(true);" value="fade out"&gt;
-  &lt;input type="button" onclick="fadeInOut.pause();" value="pause" /&gt;
-  &lt;/p&gt;
-
- &lt;div id="sample_div"&gt;Some text here&lt;/div&gt;
-
- &lt;script type="text/javascript"&gt;
- function opacity (nIndex, nLength, bBackwards) {
- this.style.opacity = nIndex / nLength;
- if (bBackwards ? nIndex === 0 : nIndex === 1) {
- this.style.visibility = bBackwards ? 'hidden' : 'visible';
- }
- }
-
- var fadeInOut = new MiniDaemon(document.getElementById('sample_div'), opacity, 300, 8);
- &lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;</pre>
-
-<p><a href="/files/3995/minidaemon_example.html" title="MiniDaemon Example">View this example in action</a></p>
-
-<h2 id="Примечания">Примечания</h2>
-
-<p>The <code>setInterval()</code> function is commonly used to set a delay for functions that are executed again and again, such as animations.</p>
-
-<p>You can cancel the interval using {{domxref("WindowOrWorkerGlobalScope.clearInterval()")}}.</p>
-
-<p>If you wish to have your function called <em>once</em> after the specified delay, use {{domxref("WindowOrWorkerGlobalScope.setTimeout()")}}.</p>
-
-<h3 id="Ensure_that_execution_duration_is_shorter_than_interval_frequency">Ensure that execution duration is shorter than interval frequency</h3>
-
-<p>If there is a possibility that your logic could take longer to execute than the interval time, it is recommended that you recursively call a named function using {{domxref("WindowOrWorkerGlobalScope.setTimeout")}}. For example, if using <code>setInterval</code> to poll a remote server every 5 seconds, network latency, an unresponsive server, and a host of other issues could prevent the request from completing in its allotted time. As such, you may find yourself with queued up XHR requests that won't necessarily return in order.</p>
-
-<p>In these cases, a recursive <code>setTimeout()</code> pattern is preferred:</p>
-
-<pre class="brush:js notranslate">(function loop(){
- setTimeout(function() {
- // Your logic here
-
- loop();
- }, delay);
-})();
-</pre>
-
-<p>In the above snippet, a named function <code>loop()</code> is declared and is immediately executed. <code>loop()</code> is recursively called inside <code>setTimeout()</code> after the logic has completed executing. While this pattern does not guarantee execution on a fixed interval, it does guarantee that the previous interval has completed before recursing.</p>
-
-<h3 id="Throttling_of_intervals">Throttling of intervals</h3>
-
-<p><code>setInterval()</code> is subject to the same throttling restrictions in Firefox as {{domxref("WindowOrWorkerGlobalScope.setTimeout","setTimeout()")}}; see <a href="/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout#Reasons_for_delays_longer_than_specified">Reasons for delays longer than specified</a>.</p>
-
-<h2 id="Спецификации">Спецификации</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Specification</th>
- <th>Status</th>
- <th>Comment</th>
- </tr>
- <tr>
- <td>{{SpecName('HTML WHATWG', 'webappapis.html#dom-setinterval', 'WindowOrWorkerGlobalScope.setInterval()')}}</td>
- <td>{{Spec2("HTML WHATWG")}}</td>
- <td>Method moved to the <code>WindowOrWorkerGlobalScope</code> mixin in the latest spec.</td>
- </tr>
- <tr>
- <td>{{SpecName("HTML WHATWG", "webappapis.html#dom-setinterval", "WindowTimers.setInterval()")}}</td>
- <td>{{Spec2("HTML WHATWG")}}</td>
- <td>Initial definition (DOM Level 0)</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Совместимость_с_браузерами">Совместимость с браузерами</h2>
-
-<div>
-
-
-<p>{{Compat("api.WindowOrWorkerGlobalScope.setInterval")}}</p>
-</div>
-
-<h2 id="Смотрите_также">Смотрите также</h2>
-
-<ul>
- <li><a href="/en-US/Add-ons/Code_snippets/Timers">JavaScript timers</a></li>
- <li>{{domxref("WindowOrWorkerGlobalScope.setTimeout")}}</li>
- <li>{{domxref("WindowOrWorkerGlobalScope.clearTimeout")}}</li>
- <li>{{domxref("WindowOrWorkerGlobalScope.clearInterval")}}</li>
- <li>{{domxref("window.requestAnimationFrame")}}</li>
- <li><a href="/en-US/Add-ons/Code_snippets/Timers/Daemons"><em>Daemons</em> management</a></li>
-</ul>
-
-<div id="simple-translate">
-<div>
-<div class="simple-translate-button isShow" style="height: 22px; width: 22px; top: 1554px; left: 525px;"></div>
-
-<div class="simple-translate-panel " style="width: 300px; height: 200px; top: 0px; left: 0px; font-size: 13px; background-color: rgb(255, 255, 255);">
-<div class="simple-translate-result-wrapper" style="overflow: hidden;">
-<div class="simple-translate-move"></div>
-
-<div class="simple-translate-result-contents">
-<p class="simple-translate-result" style="color: rgb(0, 0, 0);"></p>
-
-<p class="simple-translate-candidate" style="color: rgb(115, 115, 115);"></p>
-</div>
-</div>
-</div>
-</div>
-</div>
diff --git a/files/ru/web/api/windoworworkerglobalscope/settimeout/index.html b/files/ru/web/api/windoworworkerglobalscope/settimeout/index.html
deleted file mode 100644
index dbc08996a2..0000000000
--- a/files/ru/web/api/windoworworkerglobalscope/settimeout/index.html
+++ /dev/null
@@ -1,261 +0,0 @@
----
-title: WindowTimers.setTimeout()
-slug: Web/API/WindowOrWorkerGlobalScope/setTimeout
-translation_of: Web/API/WindowOrWorkerGlobalScope/setTimeout
-original_slug: Web/API/WindowTimers/setTimeout
----
-<div>{{ APIRef() }}</div>
-
-<h2 id="Summary" name="Summary">Краткое изложение</h2>
-
-<p>Вызов функции или выполнение фрагмента кода после указанной задержки.</p>
-
-<h2 id="Syntax" name="Syntax">Синтаксис</h2>
-
-<pre class="syntaxbox notranslate"><em>var timeoutID</em> = window.setTimeout(<em>func</em>, [, <em>delay</em>, <em>param1</em>, <em>param2</em>, ...]);
-<em>var timeoutID</em> = window.setTimeout(<em>code </em>[, <em>delay]</em>);
-</pre>
-
-<p>где</p>
-
-<ul>
- <li><code>timeoutID -</code> это <em>числовой</em> ID, который может быть использован позже с {{domxref("window.clearTimeout()")}}.</li>
- <li><code>func -</code> это <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Function" title="en-US/docs/Core_JavaScript_1.5_Reference/Global_Objects/Function">функция</a>, которую требуется вызвать после <code>delay</code> миллисекунд.</li>
- <li><code>code</code> - в альтернативном варианте применения это строка, содержащая код, который вы хотите выполнить после <code>delay</code> миллисекунд (использовать этот метод <strong>не рекомендуется</strong> по тем же причинам, что и <a href="/en-US/docs/JavaScript/Reference/Global_Objects/eval#Don%27t_use_eval!" title="en-US/docs/Core JavaScript 1.5 Reference/Global Functions/Eval#Don't use eval!">eval()</a>)</li>
- <li><code>delay</code>  {{optional_inline}} -  задержка в миллисекундах (тысячных долях секунды), после которой будет выполнен вызов функции. Реальная задержка может быть больше; см. {{anch("Notes")}} ниже.</li>
-</ul>
-
-<p>Необходимо принять во внимание, что передача дополнительных параметров функции в первом варианте не работает в Internet Explorer 9 и ниже. Для использования этой функциональности в таких браузерах, необходимо использовать код для совместимости (см. раздел <a href="#Аргументы_колбэк-функции">Аргументы колбэк-функции</a>).</p>
-
-<div class="warning"><strong>Important:</strong> Prior to Gecko 13 {{ geckoRelease("13.0") }}, Gecko passed an extra parameter to the callback routine, indicating the "actual lateness" of the timeout in milliseconds. This non-standard parameter is no longer passed.</div>
-
-<h2 id="Example" name="Example">Пример</h2>
-
-<p>В следующем примере на веб странице создаются две простые кнопки, к которым привязываются действия setTimeout и clearTimeout. Нажатие на первую кнопку установит таймаут, который вызовет диалоговое окно через две секунды. Также будет сохранён id для clearTimeout. Таймаут также может быть отменён по нажатию на вторую кнопку.</p>
-
-<h3 id="HTML_Content">HTML Content</h3>
-
-<pre class="brush: html notranslate">&lt;p&gt;Live Example&lt;/p&gt;
-&lt;button onclick="delayedAlert();"&gt;Show an alert box after two seconds&lt;/button&gt;
-&lt;p&gt;&lt;/p&gt;
-&lt;button onclick="clearAlert();"&gt;Cancel alert before it happens&lt;/button&gt;
-</pre>
-
-<h3 id="JavaScript_Content">JavaScript Content</h3>
-
-<pre class="brush: js notranslate">var timeoutID;
-
-function delayedAlert() {
-  timeoutID = window.setTimeout(slowAlert, 2000);
-}
-
-function slowAlert() {
-  alert("That was really slow!");
-}
-
-function clearAlert() {
-  window.clearTimeout(timeoutID);
-}
-</pre>
-
-<p>{{ EmbedLiveSample('Example') }}</p>
-
-<p>Смотрите также <a href="/en-US/docs/DOM/window.clearTimeout#Example" title="en-US/docs/DOM/window.clearTimeout#Example"><code>пример clearTimeout()</code></a>.</p>
-
-<h2 id="Аргументы_колбэк-функции">Аргументы колбэк-функции</h2>
-
-<p>Если вам нужно передать аргумент в вашу callback функцию, но нужно, чтобы это работало в Internet Explorer 9 и ниже, который не поддерживает передачу дополнительных параметров (ни с <code>setTimeout()</code> или <code>setInterval()</code>), то вы можете прописать специальный код для <em>совместимости с IE, </em><span class="VIiyi" lang="ru"><span class="ChMk0b JLqJ4b"><span>вставив этот код в начало ваших скриптов</span></span></span>, <span class="VIiyi" lang="ru"><span class="ChMk0b JLqJ4b"><span>который включит функцию передачи стандартных параметров HTML5 в </span></span></span>Internet Explorer<span class="VIiyi" lang="ru"><span class="ChMk0b JLqJ4b"><span> для обоих таймеров</span></span></span>.</p>
-
-<pre class="brush: js notranslate">/*\
-|*|
-|*|  IE-specific polyfill which enables the passage of arbitrary arguments to the
-|*| callback functions of JavaScript timers (HTML5 standard syntax).
-|*|
-|*| https://developer.mozilla.org/en-US/docs/DOM/window.setInterval
-|*|
-|*|  Syntax:
-|*|  var timeoutID = window.setTimeout(func, delay, [param1, param2, ...]);
-|*|  var timeoutID = window.setTimeout(code, delay);
-|*|  var intervalID = window.setInterval(func, delay[, param1, param2, ...]);
-|*|  var intervalID = window.setInterval(code, delay);
-|*|
-\*/
-
-if (document.all &amp;&amp; !window.setTimeout.isPolyfill) {
-  var __nativeST__ = window.setTimeout;
-  window.setTimeout = function (vCallback, nDelay /*, argumentToPass1, argumentToPass2, etc. */) {
-    var aArgs = Array.prototype.slice.call(arguments, 2);
-    return __nativeST__(vCallback instanceof Function ? function () {
-      vCallback.apply(null, aArgs);
-    } : vCallback, nDelay);
-  };
-  window.setTimeout.isPolyfill = true;
-}
-
-if (document.all &amp;&amp; !window.setInterval.isPolyfill) {
-  var __nativeSI__ = window.setInterval;
-  window.setInterval = function (vCallback, nDelay /*, argumentToPass1, argumentToPass2, etc. */) {
-    var aArgs = Array.prototype.slice.call(arguments, 2);
-    return __nativeSI__(vCallback instanceof Function ? function () {
-      vCallback.apply(null, aArgs);
-    } : vCallback, nDelay);
-  };
-  window.setInterval.isPolyfill = true;
-}
-</pre>
-
-<h2 id="Правка_только_для_IE">Правка только для IE</h2>
-
-<p>If you want a completely unobtrusive hack for every other mobile or desktop browser, including IE 9 and below, you can either use JavaScript conditional comments:</p>
-
-<pre class="brush: js notranslate">/*@cc_on
- // conditional IE &lt; 9 only fix
- @if (@_jscript_version &lt;= 6)
- (function(f){
- window.setTimeout =f(window.setTimeout);
- window.setInterval =f(window.setInterval);
- })(function(f){return function(c,t){var a=[].slice.call(arguments,2);return f(function(){c.apply(this,a)},t)}});
- @end
-@*/
-</pre>
-
-<p><span class="VIiyi" lang="ru"><span class="ChMk0b JLqJ4b"><span>Или используйте очень чистый подход, основанный на условном свойстве IE HTML</span></span></span>:</p>
-
-<pre class="brush: html notranslate">&lt;!--[if lte IE 9]&gt;&lt;script&gt;
-(function(f){
-window.setTimeout =f(window.setTimeout);
-window.setInterval =f(window.setInterval);
-})(function(f){return function(c,t){
-var a=[].slice.call(arguments,2);return f(function(){c.apply(this,a)},t)}
-});
-&lt;/script&gt;&lt;![endif]--&gt;
-</pre>
-
-<p>Another possibility is to use an anonymous function to call your callback, but this solution is a bit more expensive. Example:</p>
-
-<pre class="brush: js notranslate">var intervalID = setTimeout(function() { myFunc("one", "two", "three"); }, 1000);
-</pre>
-
-<p>Yet another possibility is to use <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/bind" title="/en-US/docs/JavaScript/Reference/Global_Objects/Function/bind">function's bind</a>. Example:</p>
-
-<pre class="brush: js notranslate">setTimeout(function(arg1){}.bind(undefined, 10));
-</pre>
-
-<h2 id="Проблема_с_this">Проблема с "<code>this</code>"</h2>
-
-<p>Когда вы передаёте метод в <code>setTimeout()</code> (или в любую другую функцию, если на то пошло), то вызов будет осуществлён с неправильным значением <code>this</code>. Эта проблема разъясняется детально в <a href="/en-US/docs/JavaScript/Reference/Operators/this#Method_binding" title="en-US/docs/Core_JavaScript_1.5_Reference/Operators/Special_Operators/this_Operator#Method_binding">JavaScript reference</a>.</p>
-
-<h3 id="Объяснение">Объяснение</h3>
-
-<p>Code executed by <code>setTimeout()</code> is run in a separate execution context to the function from which it was called. As a consequence, the <code>this</code> keyword for the called function will be set to the <code>window</code> (or <code>global</code>) object; it will not be the same as the <code>this</code> value for the function that called <code>setTimeout</code>. See the following example:</p>
-
-<pre class="brush: js notranslate">myArray = ["zero", "one", "two"];
-myArray.myMethod = function (sProperty) {
- alert(arguments.length &gt; 0 ? this[sProperty] : this);
-};
-
-myArray.myMethod(); // prints "zero,one,two"
-myArray.myMethod(1); // prints "one"
-setTimeout(myArray.myMethod, 1000); // prints "[object Window]" after 1 second
-setTimeout(myArray.myMethod, 1500, "1"); // prints "undefined" after 1.5 seconds
-// let's try to pass the 'this' object
-setTimeout.call(myArray, myArray.myMethod, 2000); // error: "NS_ERROR_XPC_BAD_OP_ON_WN_PROTO: Illegal operation on WrappedNative prototype object"
-setTimeout.call(myArray, myArray.myMethod, 2500, 2); // same error</pre>
-
-<p><span class="VIiyi" lang="ru"><span class="ChMk0b JLqJ4b"><span>Как видите, нет способов передать объект</span></span></span> <code>this</code> <span class="VIiyi" lang="ru"><span class="ChMk0b JLqJ4b"><span>в колбэк-функцию.</span></span></span>.</p>
-
-<h3 id="Возможное_решение">Возможное решение</h3>
-
-<p>A possible way to solve the "<code>this</code>" problem is to replace the two native <code>setTimeout()</code> or <code>setInterval()</code> global functions with two <em>non-native</em> ones which will enable their invocation through the <a href="en-US/docs/JavaScript/Reference/Global_Objects/Function/call" title="en-US/docs/JavaScript/Reference/Global_Objects/Function/call"><code>Function.prototype.call</code></a> method. The following example shows a possible replacement:</p>
-
-<pre class="brush: js notranslate">// Enable the passage of the 'this' object through the JavaScript timers
-
-var __nativeST__ = window.setTimeout, __nativeSI__ = window.setInterval;
-
-window.setTimeout = function (vCallback, nDelay /*, argumentToPass1, argumentToPass2, etc. */) {
-  var oThis = this, aArgs = Array.prototype.slice.call(arguments, 2);
-  return __nativeST__(vCallback instanceof Function ? function () {
-    vCallback.apply(oThis, aArgs);
-  } : vCallback, nDelay);
-};
-
-window.setInterval = function (vCallback, nDelay /*, argumentToPass1, argumentToPass2, etc. */) {
-  var oThis = this, aArgs = Array.prototype.slice.call(arguments, 2);
-  return __nativeSI__(vCallback instanceof Function ? function () {
-    vCallback.apply(oThis, aArgs);
-  } : vCallback, nDelay);
-};</pre>
-
-<div class="note"><strong>Note:</strong> These two replacements will also enable the HTML5 standard passage of arbitrary arguments to the callback functions of timers in IE. So they can be used as polyfills also. See the <a href="#Аргументы_колбэк-функции">Callback arguments</a> paragraph.</div>
-
-<p>Новая тестируемая особенность:</p>
-
-<pre class="brush: js notranslate">myArray = ["zero", "one", "two"];
-myArray.myMethod = function (sProperty) {
- alert(arguments.length &gt; 0 ? this[sProperty] : this);
-};
-
-setTimeout(alert, 1500, "Hello world!"); // the standard use of setTimeout and setInterval is preserved, but...
-setTimeout.call(myArray, myArray.myMethod, 2000); // prints "zero,one,two" after 2 seconds
-setTimeout.call(myArray, myArray.myMethod, 2500, 2); // prints "two" after 2.5 seconds
-</pre>
-
-<p>Это не нативные решения <em>ad hoc</em> для этой проблемы.</p>
-
-<div class="note"><strong>Note:</strong> JavaScript 1.8.5 introduces the <code><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Function/bind" title="en-US/docs/JavaScript/Reference/Global Objects/Function/bind">Function.prototype.bind()</a></code> method, which lets you specify the value that should be used as <code>this</code> for all calls to a given function. This lets you easily bypass problems where it's unclear what this will be, depending on the context from which your function was called.</div>
-
-<h2 id="Замечания">Замечания</h2>
-
-<p>Отложенное выполнение кода можно отменить, используя <code><a href="/en-US/docs/DOM/window.clearTimeout" title="en-US/docs/DOM/window.clearTimeout">window.clearTimeout()</a></code>. Если функция должна вызываться неоднократно (например, каждые N миллисекунд), необходимо использовать <code><a href="/en-US/docs/DOM/window.setInterval" title="en-US/docs/DOM/window.setInterval">window.setInterval()</a></code>.</p>
-
-<p>Важно заметить, что функция или код не могут быть выполнены, пока не завершится поток, вызвавший <code>setTimeout()</code>.</p>
-
-<h3 id="Passing_string_literals">Passing string literals</h3>
-
-<p>Передача строки вместо функции в <code>setTimeout()</code> сопряжена с теми же опасностями, что и использование <code><a href="/en-US/docs/JavaScript/Reference/Global_Objects/eval#Don.27t_use_eval.21" title="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/eval">eval</a>. </code></p>
-
-<pre class="brush: js notranslate">// Правильно
-window.setTimeout(function() {
- alert("Hello World!");
-}, 500);
-
-// Неправильно
-window.setTimeout("alert(\"Hello World!\");", 500);
-
-</pre>
-
-<p>String literals are evaluated in the global context, so local symbols in the context where <code>setTimeout()</code> was called will not be available when the string is evaluated as code.</p>
-
-<h3 id="Минимальная_максимальная_задержка_и_вложенность_таймаута"><span class="VIiyi" lang="ru"><span class="ChMk0b JLqJ4b"><span>Минимальная/ максимальная задержка и вложенность таймаута</span></span></span></h3>
-
-<p><a class="external" href="http://code.google.com/p/chromium/issues/detail?id=792#c10">Historically</a> browsers implement <code>setTimeout()</code> "clamping": successive <code>setTimeout()</code> calls with <code>delay</code> smaller than the "minimum delay" limit are forced to use at least the minimum delay. The minimum delay, <code>DOM_MIN_TIMEOUT_VALUE</code>, is 4 ms (stored in a preference in Firefox: <code>dom.min_timeout_value</code>), with a <code>DOM_CLAMP_TIMEOUT_NESTING_LEVEL</code> of 5ms.</p>
-
-<p>In fact, 4ms is <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#timers">specified by the HTML5 spec</a> and is consistent across browsers released in 2010 and onward. Prior to {{ geckoRelease("5.0") }}, the minimum timeout value for nested timeouts was 10 ms.</p>
-
-<p>In addition to "clamping", the timeout can also fire later when the page (or the OS/browser itself) is busy with other tasks.</p>
-
-<p>To implement a 0 ms timeout in a modern browser, you can use {{ domxref("window.postMessage()") }} as <a class="external" href="http://dbaron.org/log/20100309-faster-timeouts">described here</a>.</p>
-
-<p>Browsers including Internet Explorer, Chrome, Safari, and Firefox store the delay as a 32-bit signed Integer internally. This causes an Integer overflow when using delays larger than 2147483647, resulting in the timeout being executed immediately.</p>
-
-<h4 id="Неактивные_вкладки">Неактивные вкладки</h4>
-
-<p>In {{ geckoRelease("5.0") }} and Chrome 11, timeouts are clamped to firing no more often than once per second (1000ms) in inactive tabs; see {{ bug(633421) }} for more information about this in Mozilla or <a class="external" href="http://crbug.com/66078">crbug.com/66078</a> for details about this in Chrome.</p>
-
-<h2 id="Совместимость_с_браузерами">Совместимость с браузерами</h2>
-
-<p>{{Compat("api.WindowOrWorkerGlobalScope.setTimeout")}}</p>
-
-<h2 id="Specification" name="Specification">Спецификация</h2>
-
-<p>Part of DOM level 0, as specified in <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#timers">HTML5</a>.</p>
-
-<h2 id="See_also" name="See_also">Также интересно</h2>
-
-<ul>
- <li><a href="/en-US/docs/JavaScript/Timers" title="/en-US/docs/JavaScript/Timers">JavaScript timers</a></li>
- <li><a href="/en-US/docs/Mozilla/JavaScript_code_modules/Timer.jsm" title="/en-US/docs/Mozilla/JavaScript_code_modules/Timer.jsm">Timer.jsm</a></li>
- <li>{{domxref("window.setInterval")}}</li>
- <li>{{domxref("window.requestAnimationFrame")}}</li>
- <li><a href="/en-US/docs/JavaScript/Timers/Daemons" title="/en-US/docs/JavaScript/Timers/Daemons"><em>Daemons</em> management</a></li>
-</ul>