/* * Copyright (C)2005-2013 Haxe Foundation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ // This file is generated, do not edit! package js.html; /**
Workers are background tasks that can be easily created and can send messages back to their creators. Creating a worker is as simple as calling the Worker()
constructor, specifying a script to be run in the worker thread.
Of note is the fact that workers may in turn spawn new workers as long as those workers are hosted within the same origin as the parent page. In addition, workers may use XMLHttpRequest
for network I/O, with the exception that the responseXML
and channel
attributes on XMLHttpRequest
always return null
.
For a list of global functions available to workers, see Functions available to workers.
If you want to use workers in extensions, and would like to have access to js-ctypes, you should use the ChromeWorker
object instead.
See Using web workers for examples and details.
MessageEvent
with type message
bubbles through the worker. The message is stored in the event's data
member. */
var onmessage : EventListener;
/** The constructor creates a web worker that executes the script at the specified URL. This script must obey the same-origin policy. Note that there is a disagreement among browser manufacturers about whether a data URI is of the same origin or not. Though Gecko 10.0 (Firefox 10.0 / Thunderbird 10.0) and later accept data URIs, that's not the case in all other browsers.
Worker( in DOMString aStringURL );
aStringURL
A new Worker
.