From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/dedicatedworkerglobalscope/index.html | 216 +++++++++++++++++++++ 1 file changed, 216 insertions(+) create mode 100644 files/ja/web/api/dedicatedworkerglobalscope/index.html (limited to 'files/ja/web/api/dedicatedworkerglobalscope') diff --git a/files/ja/web/api/dedicatedworkerglobalscope/index.html b/files/ja/web/api/dedicatedworkerglobalscope/index.html new file mode 100644 index 0000000000..561af10657 --- /dev/null +++ b/files/ja/web/api/dedicatedworkerglobalscope/index.html @@ -0,0 +1,216 @@ +--- +title: DedicatedWorkerGlobalScope +slug: Web/API/DedicatedWorkerGlobalScope +translation_of: Web/API/DedicatedWorkerGlobalScope +--- +

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

+ +

The DedicatedWorkerGlobalScope object (the {{domxref("Worker")}} 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 also: Functions available to workers.

+ +

プロパティ

+ +

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")}}.

+ +

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.
+
+ +

イベントハンドラ

+ +

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("DedicatedWorkerGlobalScope.onmessage")}}
+
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("message")}} event is raised. These events are of type {{domxref("MessageEvent")}} and will be called when the worker receives a message from the document that started it (i.e. from the {{domxref("Worker.postMessage")}} method.)
+
+ +

メソッド

+ +

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("DedicatedWorkerGlobalScope.postMessage")}}
+
Sends a message — which can consist of any JavaScript object — to the parent document that first spawned the worker.
+
+ +

WorkerGlobalScope から継承したもの

+ +
+
{{domxref("WorkerGlobalScope.close()")}}
+
Discards any tasks queued in the WorkerGlobalScope's event loop, effectively closing this particular scope.
+
{{domxref("WorkerGlobalScope.dump()")}} {{non-standard_inline}}
+
Writes a message to the console.
+
{{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');
+
+ +

他の場所で実装されているもの

+ +
+
{{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.
+
+ +

仕様

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dedicatedworkerglobalscope', 'DedicatedWorkerGlobalScope')}}{{Spec2('HTML WHATWG')}}No change from {{SpecName("Web Workers")}}.
{{SpecName('Web Workers', '#dedicatedworkerglobalscope', 'DedicatedWorkerGlobalScope')}}{{Spec2('Web Workers')}}Initial definition.
+ +

ブラウザ互換性

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatChrome(4)}}{{CompatGeckoDesktop("1.9.1")}}1010.64
ononline, onoffline{{CompatVersionUnknown}}{{CompatGeckoDesktop("29")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
console {{Non-standard_inline}}{{CompatVersionUnknown}}{{CompatGeckoDesktop("29")}}[1]
+ {{CompatGeckoDesktop("30")}}
{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
performance{{CompatVersionUnknown}}{{CompatGeckoDesktop("34")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)Firefox OS (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.9.1")}}1.0.11011.55.1
ononline, onoffline{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("29")}}[1]
+ {{CompatGeckoMobile("30")}}
1.4{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
console {{Non-standard_inline}}{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("29")}}1.4{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
performance{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("34")}}2.1{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

[1] Gecko 29.0 implemented this as WorkerConsole. Gecko 30.0 changed this to the regular Console.

+ +

関連項目

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