2013-11-05 14:16:26 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
|
|
|
* http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#the-workerglobalscope-common-interface
|
|
|
|
*
|
|
|
|
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera
|
|
|
|
* Software ASA.
|
|
|
|
* You are granted a license to use, reproduce and create derivative works of
|
|
|
|
* this document.
|
|
|
|
*/
|
|
|
|
|
2015-03-03 23:51:53 +00:00
|
|
|
[Exposed=(Worker)]
|
2013-11-05 14:16:26 +00:00
|
|
|
interface WorkerGlobalScope : EventTarget {
|
|
|
|
readonly attribute WorkerGlobalScope self;
|
2014-01-31 17:12:32 +00:00
|
|
|
|
|
|
|
[Replaceable]
|
2014-02-27 23:39:30 +00:00
|
|
|
readonly attribute Console console;
|
2014-01-31 17:12:32 +00:00
|
|
|
|
2013-11-05 14:16:26 +00:00
|
|
|
readonly attribute WorkerLocation location;
|
|
|
|
|
2015-03-06 03:48:07 +00:00
|
|
|
[Throws]
|
2013-11-05 14:16:26 +00:00
|
|
|
void close();
|
|
|
|
attribute OnErrorEventHandler onerror;
|
|
|
|
|
2013-11-19 23:08:50 +00:00
|
|
|
attribute EventHandler onoffline;
|
|
|
|
attribute EventHandler ononline;
|
2013-11-05 14:16:26 +00:00
|
|
|
// also has additional members in a partial interface
|
|
|
|
};
|
|
|
|
|
|
|
|
partial interface WorkerGlobalScope {
|
|
|
|
[Throws]
|
|
|
|
void importScripts(DOMString... urls);
|
|
|
|
|
|
|
|
readonly attribute WorkerNavigator navigator;
|
|
|
|
};
|
|
|
|
|
2015-03-02 13:23:00 +00:00
|
|
|
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#self-caches
|
|
|
|
partial interface WorkerGlobalScope {
|
|
|
|
[Throws, Func="mozilla::dom::cache::CacheStorage::PrefEnabled"]
|
|
|
|
readonly attribute CacheStorage caches;
|
|
|
|
};
|
|
|
|
|
2013-11-05 14:16:26 +00:00
|
|
|
WorkerGlobalScope implements WindowTimers;
|
|
|
|
WorkerGlobalScope implements WindowBase64;
|
2014-07-25 01:30:07 +00:00
|
|
|
WorkerGlobalScope implements GlobalFetch;
|
2014-12-17 06:26:15 +00:00
|
|
|
WorkerGlobalScope implements IDBEnvironment;
|
2013-11-05 14:16:26 +00:00
|
|
|
|
2014-10-02 02:32:05 +00:00
|
|
|
// Not implemented yet: bug 1072107.
|
|
|
|
// WorkerGlobalScope implements FontFaceSource;
|
|
|
|
|
2013-11-05 14:16:26 +00:00
|
|
|
// Mozilla extensions
|
|
|
|
partial interface WorkerGlobalScope {
|
|
|
|
attribute EventHandler onclose;
|
|
|
|
|
|
|
|
void dump(optional DOMString str);
|
2014-08-29 23:50:06 +00:00
|
|
|
|
|
|
|
// XXXbz no spec for this yet, because the webperf WG is a bit dysfunctional
|
2014-11-07 19:10:39 +00:00
|
|
|
[Constant, Cached]
|
2014-08-29 23:50:06 +00:00
|
|
|
readonly attribute Performance performance;
|
2013-11-05 14:16:26 +00:00
|
|
|
};
|