From c05efa8d7ae464235cf83d7c0956e42dc6974103 Mon Sep 17 00:00:00 2001 From: julieng Date: Sat, 2 Oct 2021 17:20:14 +0200 Subject: move *.html to *.md --- .../applicationcache/index.html | 38 ------ .../applicationcache/index.md | 38 ++++++ .../fr/web/api/sharedworkerglobalscope/index.html | 132 --------------------- files/fr/web/api/sharedworkerglobalscope/index.md | 132 +++++++++++++++++++++ .../sharedworkerglobalscope/onconnect/index.html | 64 ---------- .../api/sharedworkerglobalscope/onconnect/index.md | 64 ++++++++++ 6 files changed, 234 insertions(+), 234 deletions(-) delete mode 100644 files/fr/web/api/sharedworkerglobalscope/applicationcache/index.html create mode 100644 files/fr/web/api/sharedworkerglobalscope/applicationcache/index.md delete mode 100644 files/fr/web/api/sharedworkerglobalscope/index.html create mode 100644 files/fr/web/api/sharedworkerglobalscope/index.md delete mode 100644 files/fr/web/api/sharedworkerglobalscope/onconnect/index.html create mode 100644 files/fr/web/api/sharedworkerglobalscope/onconnect/index.md (limited to 'files/fr/web/api/sharedworkerglobalscope') diff --git a/files/fr/web/api/sharedworkerglobalscope/applicationcache/index.html b/files/fr/web/api/sharedworkerglobalscope/applicationcache/index.html deleted file mode 100644 index 7440932b75..0000000000 --- a/files/fr/web/api/sharedworkerglobalscope/applicationcache/index.html +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: SharedWorkerGlobalScope.applicationCache -slug: Web/API/SharedWorkerGlobalScope/applicationCache -translation_of: Web/API/SharedWorkerGlobalScope/applicationCache ---- -
{{APIRef("Web Workers API")}}
- -
-

Attention : Application Cache est déprécié depuis Firefox 44, et ne sera plus disponible dans des contextes non sécurisés avant Firefox 60 ({{bug(1354175)}}, currently uniquement sur les versions Nightly/Beta). Ne pas utiliser cette fonctionnalité sur des sites web en production, utilisez plutôt les services workers.

-
- -

La propriété en lecture seule applicationCache de l'interface {{domxref("SharedWorkerGlobalScope")}} retourne l'objet {{domxref("ApplicationCache")}} pour le worker (voir Utiliser le cache d'application).

- -

Syntaxe

- -
var nameObj = self.applicationCache;
- -

valeur

- -

Un {{domxref("ApplicationCache")}}.

- -

Exemple

- -

Si un worker partagé a un AppCache, vous pouvez récupérer une référence en utilisant à l'intérieur d'un worker partagé:

- -
self.applicationCache
- -

Compatibilité des navigateurs

- - - -

{{Compat("api.SharedWorkerGlobalScope.applicationCache")}}

- -

Voir aussi

- - diff --git a/files/fr/web/api/sharedworkerglobalscope/applicationcache/index.md b/files/fr/web/api/sharedworkerglobalscope/applicationcache/index.md new file mode 100644 index 0000000000..7440932b75 --- /dev/null +++ b/files/fr/web/api/sharedworkerglobalscope/applicationcache/index.md @@ -0,0 +1,38 @@ +--- +title: SharedWorkerGlobalScope.applicationCache +slug: Web/API/SharedWorkerGlobalScope/applicationCache +translation_of: Web/API/SharedWorkerGlobalScope/applicationCache +--- +
{{APIRef("Web Workers API")}}
+ +
+

Attention : Application Cache est déprécié depuis Firefox 44, et ne sera plus disponible dans des contextes non sécurisés avant Firefox 60 ({{bug(1354175)}}, currently uniquement sur les versions Nightly/Beta). Ne pas utiliser cette fonctionnalité sur des sites web en production, utilisez plutôt les services workers.

+
+ +

La propriété en lecture seule applicationCache de l'interface {{domxref("SharedWorkerGlobalScope")}} retourne l'objet {{domxref("ApplicationCache")}} pour le worker (voir Utiliser le cache d'application).

+ +

Syntaxe

+ +
var nameObj = self.applicationCache;
+ +

valeur

+ +

Un {{domxref("ApplicationCache")}}.

+ +

Exemple

+ +

Si un worker partagé a un AppCache, vous pouvez récupérer une référence en utilisant à l'intérieur d'un worker partagé:

+ +
self.applicationCache
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("api.SharedWorkerGlobalScope.applicationCache")}}

+ +

Voir aussi

+ + diff --git a/files/fr/web/api/sharedworkerglobalscope/index.html b/files/fr/web/api/sharedworkerglobalscope/index.html deleted file mode 100644 index d3887aafa0..0000000000 --- a/files/fr/web/api/sharedworkerglobalscope/index.html +++ /dev/null @@ -1,132 +0,0 @@ ---- -title: SharedWorkerGlobalScope -slug: Web/API/SharedWorkerGlobalScope -tags: - - API - - Interface - - NeedsTranslation - - Reference - - SharedWorkerGlobalScope - - TopicStub - - Web Workers -translation_of: Web/API/SharedWorkerGlobalScope ---- -
{{APIRef("Web Workers API")}}
- -

The SharedWorkerGlobalScope object (the {{domxref("SharedWorker")}} global scope) is accessible through the {{domxref("window.self","self")}} keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See the complete list of functions available to workers.

- -

Properties

- -

This interface inherits properties from the {{domxref("WorkerGlobalScope")}} interface, and its parent {{domxref("EventTarget")}}, and therefore implements properties from {{domxref("WindowTimers")}}, {{domxref("WindowBase64")}}, and {{domxref("WindowEventHandlers")}}.

- -
-
{{domxref("SharedWorkerGlobalScope.name")}} {{readOnlyinline}}
-
The name that the {{domxref("SharedWorker")}} was (optionally) given when it was created using the {{domxref("SharedWorker.SharedWorker", "SharedWorker()")}} constructor. This is mainly useful for debugging purposes.
-
{{domxref("SharedWorkerGlobalScope.applicationCache")}} {{readOnlyinline}} {{deprecated_inline}}
-
This property returns the {{domxref("ApplicationCache")}} object for the worker (see Using the application cache).
-
- -

Properties inherited from WorkerGlobalScope

- -
-
{{domxref("WorkerGlobalScope.self")}}
-
Returns an object reference to the DedicatedWorkerGlobalScope object itself.
-
{{domxref("WorkerGlobalScope.console")}} {{readOnlyinline}}
-
Returns the {{domxref("Console")}} associated with the worker.
-
{{domxref("WorkerGlobalScope.location")}} {{readOnlyinline}}
-
Returns the {{domxref("WorkerLocation")}} associated with the worker. WorkerLocation is a specific location object, mostly a subset of the {{domxref("Location")}} for browsing scopes, but adapted to workers.
-
{{domxref("WorkerGlobalScope.navigator")}} {{readOnlyinline}}
-
Returns the {{domxref("WorkerNavigator")}} associated with the worker. WorkerNavigator is a specific navigator object, mostly a subset of the {{domxref("Navigator")}} for browsing scopes, but adapted to workers.
-
{{domxref("WorkerGlobalScope.performance")}} {{readOnlyinline}} {{Non-standard_inline}}
-
Returns the {{domxref("Performance")}} object associated with the worker, which is a regular performance object, but with a subset of its properties and methods available.
-
- -

Event handlers

- -

This interface inherits event handlers from the {{domxref("WorkerGlobalScope")}} interface, and its parent {{domxref("EventTarget")}}, and therefore implements event handlers from {{domxref("WindowTimers")}}, {{domxref("WindowBase64")}}, and {{domxref("WindowEventHandlers")}}.

- -
-
{{domxref("SharedWorkerGlobalScope.onconnect")}}
-
Is an {{event("Event_handlers", "event handler")}} representing the code to be called when the {{event("connect")}} event is raised — that is, when a {{domxref("MessagePort")}} connection is opened between the associated {{domxref("SharedWorker")}} and the main thread.
-
- -

Methods

- -

This interface inherits methods from the {{domxref("WorkerGlobalScope")}} interface, and its parent {{domxref("EventTarget")}}, and therefore implements methods from {{domxref("WindowTimers")}}, {{domxref("WindowBase64")}}, and {{domxref("WindowEventHandlers")}}.

- -
-
{{domxref("SharedWorkerGlobalScope.close()")}}
-
Discards any tasks queued in the SharedWorkerGlobalScope's event loop, effectively closing this particular scope.
-
- -

Inherited from WorkerGlobalScope

- -
-
{{domxref("WorkerGlobalScope.close()")}} {{deprecated_inline}}
-
Discards any tasks queued in the WorkerGlobalScope's event loop, effectively closing this particular scope.
-
{{domxref("WorkerGlobalScope.dump()")}} {{non-standard_inline}}
-
Allows you to write a message to stdout — i.e. in your terminal. This is the same as Firefox's {{domxref("window.dump")}}, but for workers.
-
{{domxref("WorkerGlobalScope.importScripts()")}}
-
Imports one or more scripts into the worker's scope. You can specify as many as you'd like, separated by commas. For example: importScripts('foo.js', 'bar.js');
-
- -

Implemented from other places

- -
-
{{domxref("WindowBase64.atob()")}}
-
Decodes a string of data which has been encoded using base-64 encoding.
-
{{domxref("WindowBase64.btoa()")}}
-
Creates a base-64 encoded ASCII string from a string of binary data.
-
{{domxref("WindowTimers.clearInterval()")}}
-
Cancels the repeated execution set using {{domxref("WindowTimers.setInterval()")}}.
-
{{domxref("WindowTimers.clearTimeout()")}}
-
Cancels the repeated execution set using {{domxref("WindowTimers.setTimeout()")}}.
-
{{domxref("WindowTimers.setInterval()")}}
-
Schedules the execution of a function every X milliseconds.
-
{{domxref("WindowTimers.setTimeout()")}}
-
Sets a delay for executing a function.
-
- -

Events

- -

Listen to this event using addEventListener() or by assigning an event listener to the oneventname property of this interface.

- -
-
connect
-
Fired on shared workers when a new client connects.
- Also available via the onconnect property.
-
- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#sharedworkerglobalscope', 'SharedWorkerGlobalScope')}}{{Spec2('HTML WHATWG')}}
- -

Browser compatibility

- - - -

{{Compat("api.SharedWorkerGlobalScope")}}

- -

See also

- - diff --git a/files/fr/web/api/sharedworkerglobalscope/index.md b/files/fr/web/api/sharedworkerglobalscope/index.md new file mode 100644 index 0000000000..d3887aafa0 --- /dev/null +++ b/files/fr/web/api/sharedworkerglobalscope/index.md @@ -0,0 +1,132 @@ +--- +title: SharedWorkerGlobalScope +slug: Web/API/SharedWorkerGlobalScope +tags: + - API + - Interface + - NeedsTranslation + - Reference + - SharedWorkerGlobalScope + - TopicStub + - Web Workers +translation_of: Web/API/SharedWorkerGlobalScope +--- +
{{APIRef("Web Workers API")}}
+ +

The SharedWorkerGlobalScope object (the {{domxref("SharedWorker")}} global scope) is accessible through the {{domxref("window.self","self")}} keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See the complete list of functions available to workers.

+ +

Properties

+ +

This interface inherits properties from the {{domxref("WorkerGlobalScope")}} interface, and its parent {{domxref("EventTarget")}}, and therefore implements properties from {{domxref("WindowTimers")}}, {{domxref("WindowBase64")}}, and {{domxref("WindowEventHandlers")}}.

+ +
+
{{domxref("SharedWorkerGlobalScope.name")}} {{readOnlyinline}}
+
The name that the {{domxref("SharedWorker")}} was (optionally) given when it was created using the {{domxref("SharedWorker.SharedWorker", "SharedWorker()")}} constructor. This is mainly useful for debugging purposes.
+
{{domxref("SharedWorkerGlobalScope.applicationCache")}} {{readOnlyinline}} {{deprecated_inline}}
+
This property returns the {{domxref("ApplicationCache")}} object for the worker (see Using the application cache).
+
+ +

Properties inherited from WorkerGlobalScope

+ +
+
{{domxref("WorkerGlobalScope.self")}}
+
Returns an object reference to the DedicatedWorkerGlobalScope object itself.
+
{{domxref("WorkerGlobalScope.console")}} {{readOnlyinline}}
+
Returns the {{domxref("Console")}} associated with the worker.
+
{{domxref("WorkerGlobalScope.location")}} {{readOnlyinline}}
+
Returns the {{domxref("WorkerLocation")}} associated with the worker. WorkerLocation is a specific location object, mostly a subset of the {{domxref("Location")}} for browsing scopes, but adapted to workers.
+
{{domxref("WorkerGlobalScope.navigator")}} {{readOnlyinline}}
+
Returns the {{domxref("WorkerNavigator")}} associated with the worker. WorkerNavigator is a specific navigator object, mostly a subset of the {{domxref("Navigator")}} for browsing scopes, but adapted to workers.
+
{{domxref("WorkerGlobalScope.performance")}} {{readOnlyinline}} {{Non-standard_inline}}
+
Returns the {{domxref("Performance")}} object associated with the worker, which is a regular performance object, but with a subset of its properties and methods available.
+
+ +

Event handlers

+ +

This interface inherits event handlers from the {{domxref("WorkerGlobalScope")}} interface, and its parent {{domxref("EventTarget")}}, and therefore implements event handlers from {{domxref("WindowTimers")}}, {{domxref("WindowBase64")}}, and {{domxref("WindowEventHandlers")}}.

+ +
+
{{domxref("SharedWorkerGlobalScope.onconnect")}}
+
Is an {{event("Event_handlers", "event handler")}} representing the code to be called when the {{event("connect")}} event is raised — that is, when a {{domxref("MessagePort")}} connection is opened between the associated {{domxref("SharedWorker")}} and the main thread.
+
+ +

Methods

+ +

This interface inherits methods from the {{domxref("WorkerGlobalScope")}} interface, and its parent {{domxref("EventTarget")}}, and therefore implements methods from {{domxref("WindowTimers")}}, {{domxref("WindowBase64")}}, and {{domxref("WindowEventHandlers")}}.

+ +
+
{{domxref("SharedWorkerGlobalScope.close()")}}
+
Discards any tasks queued in the SharedWorkerGlobalScope's event loop, effectively closing this particular scope.
+
+ +

Inherited from WorkerGlobalScope

+ +
+
{{domxref("WorkerGlobalScope.close()")}} {{deprecated_inline}}
+
Discards any tasks queued in the WorkerGlobalScope's event loop, effectively closing this particular scope.
+
{{domxref("WorkerGlobalScope.dump()")}} {{non-standard_inline}}
+
Allows you to write a message to stdout — i.e. in your terminal. This is the same as Firefox's {{domxref("window.dump")}}, but for workers.
+
{{domxref("WorkerGlobalScope.importScripts()")}}
+
Imports one or more scripts into the worker's scope. You can specify as many as you'd like, separated by commas. For example: importScripts('foo.js', 'bar.js');
+
+ +

Implemented from other places

+ +
+
{{domxref("WindowBase64.atob()")}}
+
Decodes a string of data which has been encoded using base-64 encoding.
+
{{domxref("WindowBase64.btoa()")}}
+
Creates a base-64 encoded ASCII string from a string of binary data.
+
{{domxref("WindowTimers.clearInterval()")}}
+
Cancels the repeated execution set using {{domxref("WindowTimers.setInterval()")}}.
+
{{domxref("WindowTimers.clearTimeout()")}}
+
Cancels the repeated execution set using {{domxref("WindowTimers.setTimeout()")}}.
+
{{domxref("WindowTimers.setInterval()")}}
+
Schedules the execution of a function every X milliseconds.
+
{{domxref("WindowTimers.setTimeout()")}}
+
Sets a delay for executing a function.
+
+ +

Events

+ +

Listen to this event using addEventListener() or by assigning an event listener to the oneventname property of this interface.

+ +
+
connect
+
Fired on shared workers when a new client connects.
+ Also available via the onconnect property.
+
+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#sharedworkerglobalscope', 'SharedWorkerGlobalScope')}}{{Spec2('HTML WHATWG')}}
+ +

Browser compatibility

+ + + +

{{Compat("api.SharedWorkerGlobalScope")}}

+ +

See also

+ + diff --git a/files/fr/web/api/sharedworkerglobalscope/onconnect/index.html b/files/fr/web/api/sharedworkerglobalscope/onconnect/index.html deleted file mode 100644 index 88b05cd2d7..0000000000 --- a/files/fr/web/api/sharedworkerglobalscope/onconnect/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: SharedWorkerGlobalScope.onconnect -slug: Web/API/SharedWorkerGlobalScope/onconnect -translation_of: Web/API/SharedWorkerGlobalScope/onconnect ---- -

{{APIRef("Web Workers API")}}

- -

La proriété onconnect de l'interface {{domxref("SharedWorkerGlobalScope")}} est un gestionnaire d'évènement pour l'évènement {{event("connect")}}, c'est à dire quand une connexion {{domxref("MessagePort")}} est ouverte entre le {{domxref("SharedWorker")}} et le thread principale.

- -

Syntaxe

- -
onconnect = function() { ... };
- -

Exemple

- -

Cet exemple montre le gestionnaire d'évènement onconnect quand une connection depuis le thread principal vers un fichier de worker partagé via un {{domxref("MessagePort")}}. L'objet évènement est un {{domxref("MessageEvent")}}.

- -

Le port de connexion peut-être récupéré avec la propriété ports de l'objet évènement. Le port a un gestionnaire d'évènement onmessage pour gérer les évènement venant de cet port et la méthode postMessage() peut-être utilisée pour répondre au thread principale qui utilise le worker.

- -
onconnect = function(e) {
-    var port = e.ports[0];
-
-    port.onmessage = function(e) {
-      var workerResult = 'Result: ' + (e.data[0] * e.data[1]);
-      port.postMessage(workerResult);
-    }
-
-    port.start();
-}
- -

Pour l'exemple complet en fonctionnement, voir Basic shared worker example (run shared worker.)

- -
-

Note : La propriété data de l'objet évènement est null dans Firefox. À partir de la version 65, elle est initialisée comme une chaîne vide, selon les spécifications ({{bug(1508824)}}).

-
- -

Spécifications

- - - - - - - - - - - - - - -
SpécificationStatusCommentaire
{{SpecName('HTML WHATWG', '#handler-sharedworkerglobalscope-onconnect', 'onconnect')}}{{Spec2('HTML WHATWG')}}
- -

Compatibilité des navigateurs

- - - -

{{Compat("api.SharedWorkerGlobalScope.onconnect")}}

- -

Voir aussi

- - diff --git a/files/fr/web/api/sharedworkerglobalscope/onconnect/index.md b/files/fr/web/api/sharedworkerglobalscope/onconnect/index.md new file mode 100644 index 0000000000..88b05cd2d7 --- /dev/null +++ b/files/fr/web/api/sharedworkerglobalscope/onconnect/index.md @@ -0,0 +1,64 @@ +--- +title: SharedWorkerGlobalScope.onconnect +slug: Web/API/SharedWorkerGlobalScope/onconnect +translation_of: Web/API/SharedWorkerGlobalScope/onconnect +--- +

{{APIRef("Web Workers API")}}

+ +

La proriété onconnect de l'interface {{domxref("SharedWorkerGlobalScope")}} est un gestionnaire d'évènement pour l'évènement {{event("connect")}}, c'est à dire quand une connexion {{domxref("MessagePort")}} est ouverte entre le {{domxref("SharedWorker")}} et le thread principale.

+ +

Syntaxe

+ +
onconnect = function() { ... };
+ +

Exemple

+ +

Cet exemple montre le gestionnaire d'évènement onconnect quand une connection depuis le thread principal vers un fichier de worker partagé via un {{domxref("MessagePort")}}. L'objet évènement est un {{domxref("MessageEvent")}}.

+ +

Le port de connexion peut-être récupéré avec la propriété ports de l'objet évènement. Le port a un gestionnaire d'évènement onmessage pour gérer les évènement venant de cet port et la méthode postMessage() peut-être utilisée pour répondre au thread principale qui utilise le worker.

+ +
onconnect = function(e) {
+    var port = e.ports[0];
+
+    port.onmessage = function(e) {
+      var workerResult = 'Result: ' + (e.data[0] * e.data[1]);
+      port.postMessage(workerResult);
+    }
+
+    port.start();
+}
+ +

Pour l'exemple complet en fonctionnement, voir Basic shared worker example (run shared worker.)

+ +
+

Note : La propriété data de l'objet évènement est null dans Firefox. À partir de la version 65, elle est initialisée comme une chaîne vide, selon les spécifications ({{bug(1508824)}}).

+
+ +

Spécifications

+ + + + + + + + + + + + + + +
SpécificationStatusCommentaire
{{SpecName('HTML WHATWG', '#handler-sharedworkerglobalscope-onconnect', 'onconnect')}}{{Spec2('HTML WHATWG')}}
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("api.SharedWorkerGlobalScope.onconnect")}}

+ +

Voir aussi

+ + -- cgit v1.2.3-54-g00ecf