2013-11-05 18:16:26 +04: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-04 02:51:53 +03:00
|
|
|
[Exposed=(Worker)]
|
2013-11-05 18:16:26 +04:00
|
|
|
interface WorkerGlobalScope : EventTarget {
|
|
|
|
readonly attribute WorkerGlobalScope self;
|
2014-01-31 21:12:32 +04:00
|
|
|
|
|
|
|
[Replaceable]
|
2014-02-28 03:39:30 +04:00
|
|
|
readonly attribute Console console;
|
2014-01-31 21:12:32 +04:00
|
|
|
|
2013-11-05 18:16:26 +04:00
|
|
|
readonly attribute WorkerLocation location;
|
|
|
|
|
|
|
|
void close();
|
|
|
|
attribute OnErrorEventHandler onerror;
|
|
|
|
|
2013-11-20 03:08:50 +04:00
|
|
|
attribute EventHandler onoffline;
|
|
|
|
attribute EventHandler ononline;
|
2013-11-05 18:16:26 +04:00
|
|
|
// also has additional members in a partial interface
|
|
|
|
};
|
|
|
|
|
|
|
|
partial interface WorkerGlobalScope {
|
|
|
|
[Throws]
|
|
|
|
void importScripts(DOMString... urls);
|
|
|
|
|
|
|
|
readonly attribute WorkerNavigator navigator;
|
|
|
|
};
|
|
|
|
|
2015-03-02 16:23:00 +03: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 18:16:26 +04:00
|
|
|
WorkerGlobalScope implements WindowTimers;
|
|
|
|
WorkerGlobalScope implements WindowBase64;
|
2014-07-25 05:30:07 +04:00
|
|
|
WorkerGlobalScope implements GlobalFetch;
|
2014-12-17 09:26:15 +03:00
|
|
|
WorkerGlobalScope implements IDBEnvironment;
|
2013-11-05 18:16:26 +04:00
|
|
|
|
2014-10-02 06:32:05 +04:00
|
|
|
// Not implemented yet: bug 1072107.
|
|
|
|
// WorkerGlobalScope implements FontFaceSource;
|
|
|
|
|
2013-11-05 18:16:26 +04:00
|
|
|
// Mozilla extensions
|
|
|
|
partial interface WorkerGlobalScope {
|
|
|
|
attribute EventHandler onclose;
|
|
|
|
|
|
|
|
void dump(optional DOMString str);
|
2014-08-30 03:50:06 +04:00
|
|
|
|
|
|
|
// XXXbz no spec for this yet, because the webperf WG is a bit dysfunctional
|
2014-11-07 22:10:39 +03:00
|
|
|
[Constant, Cached]
|
2014-08-30 03:50:06 +04:00
|
|
|
readonly attribute Performance performance;
|
2013-11-05 18:16:26 +04:00
|
|
|
};
|