2014-02-28 03:39:00 +04:00
|
|
|
/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
|
|
|
/* 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
|
2017-04-20 14:49:49 +03:00
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* For more information on this interface, please see
|
|
|
|
* https://console.spec.whatwg.org/#console-namespace
|
|
|
|
*/
|
2014-02-28 03:39:00 +04:00
|
|
|
|
2017-12-20 16:35:34 +03:00
|
|
|
[Exposed=(Window,Worker,WorkerDebugger,Worklet,System),
|
2016-06-04 10:33:24 +03:00
|
|
|
ClassString="Console",
|
|
|
|
ProtoObjectHack]
|
2016-06-04 10:32:51 +03:00
|
|
|
namespace console {
|
2018-01-04 21:19:43 +03:00
|
|
|
|
|
|
|
// NOTE: if you touch this namespace, remember to update the ConsoleInstance
|
|
|
|
// interface as well!
|
|
|
|
|
2017-04-20 14:49:49 +03:00
|
|
|
// Logging
|
|
|
|
void assert(optional boolean condition = false, any... data);
|
2017-04-20 14:50:13 +03:00
|
|
|
void clear();
|
2017-04-20 14:52:41 +03:00
|
|
|
void count(optional DOMString label = "default");
|
2017-04-20 14:49:49 +03:00
|
|
|
void debug(any... data);
|
|
|
|
void error(any... data);
|
2014-02-28 03:39:00 +04:00
|
|
|
void info(any... data);
|
2017-04-20 14:49:49 +03:00
|
|
|
void log(any... data);
|
|
|
|
void table(any... data); // FIXME: The spec is still unclear about this.
|
2017-04-20 14:52:24 +03:00
|
|
|
void trace(any... data);
|
2014-02-28 03:39:00 +04:00
|
|
|
void warn(any... data);
|
2017-04-20 14:49:49 +03:00
|
|
|
void dir(any... data); // FIXME: This doesn't follow the spec yet.
|
2015-04-29 18:34:00 +03:00
|
|
|
void dirxml(any... data);
|
2017-04-20 14:49:49 +03:00
|
|
|
|
|
|
|
// Grouping
|
2014-02-28 03:39:00 +04:00
|
|
|
void group(any... data);
|
|
|
|
void groupCollapsed(any... data);
|
2017-04-18 11:04:00 +03:00
|
|
|
void groupEnd();
|
2017-04-20 14:49:49 +03:00
|
|
|
|
|
|
|
// Timing
|
2017-04-20 14:52:31 +03:00
|
|
|
void time(optional DOMString label = "default");
|
|
|
|
void timeEnd(optional DOMString label = "default");
|
2017-04-20 14:49:49 +03:00
|
|
|
|
|
|
|
// Mozilla only or Webcompat methods
|
|
|
|
|
|
|
|
void _exception(any... data);
|
2015-04-29 22:48:57 +03:00
|
|
|
void timeStamp(optional any data);
|
2014-02-28 03:39:00 +04:00
|
|
|
|
|
|
|
void profile(any... data);
|
|
|
|
void profileEnd(any... data);
|
|
|
|
|
2016-06-04 10:32:51 +03:00
|
|
|
[ChromeOnly]
|
|
|
|
const boolean IS_NATIVE_CONSOLE = true;
|
2018-01-04 21:19:43 +03:00
|
|
|
|
|
|
|
[ChromeOnly, NewObject]
|
|
|
|
ConsoleInstance createInstance(optional ConsoleInstanceOptions options);
|
2014-02-28 03:39:00 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// This is used to propagate console events to the observers.
|
|
|
|
dictionary ConsoleEvent {
|
2015-03-17 14:13:00 +03:00
|
|
|
(unsigned long long or DOMString) ID;
|
|
|
|
(unsigned long long or DOMString) innerID;
|
2018-01-04 21:19:43 +03:00
|
|
|
DOMString consoleID = "";
|
2017-02-27 00:13:45 +03:00
|
|
|
DOMString addonId = "";
|
2014-02-28 03:39:00 +04:00
|
|
|
DOMString level = "";
|
|
|
|
DOMString filename = "";
|
|
|
|
unsigned long lineNumber = 0;
|
2014-09-22 22:27:59 +04:00
|
|
|
unsigned long columnNumber = 0;
|
2014-02-28 03:39:00 +04:00
|
|
|
DOMString functionName = "";
|
|
|
|
double timeStamp = 0;
|
|
|
|
sequence<any> arguments;
|
2016-02-13 19:08:17 +03:00
|
|
|
sequence<DOMString?> styles;
|
2014-02-28 03:39:00 +04:00
|
|
|
boolean private = false;
|
2014-04-16 06:58:44 +04:00
|
|
|
// stacktrace is handled via a getter in some cases so we can construct it
|
|
|
|
// lazily. Note that we're not making this whole thing an interface because
|
|
|
|
// consumers expect to see own properties on it, which would mean making the
|
|
|
|
// props unforgeable, which means lots of JSFunction allocations. Maybe we
|
|
|
|
// should fix those consumers, of course....
|
|
|
|
// sequence<ConsoleStackEntry> stacktrace;
|
2014-02-28 03:39:00 +04:00
|
|
|
DOMString groupName = "";
|
|
|
|
any timer = null;
|
2014-02-28 03:39:24 +04:00
|
|
|
any counter = null;
|
2014-02-28 03:39:00 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// Event for profile operations
|
|
|
|
dictionary ConsoleProfileEvent {
|
|
|
|
DOMString action = "";
|
|
|
|
sequence<any> arguments;
|
|
|
|
};
|
|
|
|
|
|
|
|
// This dictionary is used to manage stack trace data.
|
|
|
|
dictionary ConsoleStackEntry {
|
|
|
|
DOMString filename = "";
|
|
|
|
unsigned long lineNumber = 0;
|
2014-09-22 22:27:59 +04:00
|
|
|
unsigned long columnNumber = 0;
|
2014-02-28 03:39:00 +04:00
|
|
|
DOMString functionName = "";
|
2015-10-21 09:40:00 +03:00
|
|
|
DOMString? asyncCause;
|
2014-02-28 03:39:00 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary ConsoleTimerStart {
|
|
|
|
DOMString name = "";
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary ConsoleTimerEnd {
|
|
|
|
DOMString name = "";
|
|
|
|
double duration = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary ConsoleTimerError {
|
2017-05-12 00:36:09 +03:00
|
|
|
DOMString error = "";
|
|
|
|
DOMString name = "";
|
2014-02-28 03:39:00 +04:00
|
|
|
};
|
2014-02-28 03:39:24 +04:00
|
|
|
|
|
|
|
dictionary ConsoleCounter {
|
|
|
|
DOMString label = "";
|
|
|
|
unsigned long count = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary ConsoleCounterError {
|
|
|
|
DOMString error = "maxCountersExceeded";
|
|
|
|
};
|
2018-01-04 21:19:43 +03:00
|
|
|
|
|
|
|
[ChromeOnly,
|
|
|
|
Exposed=(Window,Worker,WorkerDebugger,Worklet,System)]
|
|
|
|
// This is basically a copy of the console namespace.
|
|
|
|
interface ConsoleInstance {
|
|
|
|
// Logging
|
|
|
|
void assert(optional boolean condition = false, any... data);
|
|
|
|
void clear();
|
|
|
|
void count(optional DOMString label = "default");
|
|
|
|
void debug(any... data);
|
|
|
|
void error(any... data);
|
|
|
|
void info(any... data);
|
|
|
|
void log(any... data);
|
|
|
|
void table(any... data); // FIXME: The spec is still unclear about this.
|
|
|
|
void trace(any... data);
|
|
|
|
void warn(any... data);
|
|
|
|
void dir(any... data); // FIXME: This doesn't follow the spec yet.
|
|
|
|
void dirxml(any... data);
|
|
|
|
|
|
|
|
// Grouping
|
|
|
|
void group(any... data);
|
|
|
|
void groupCollapsed(any... data);
|
|
|
|
void groupEnd();
|
|
|
|
|
|
|
|
// Timing
|
|
|
|
void time(optional DOMString label = "default");
|
|
|
|
void timeEnd(optional DOMString label = "default");
|
|
|
|
|
|
|
|
// Mozilla only or Webcompat methods
|
|
|
|
|
|
|
|
void _exception(any... data);
|
|
|
|
void timeStamp(optional any data);
|
|
|
|
|
|
|
|
void profile(any... data);
|
|
|
|
void profileEnd(any... data);
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary ConsoleInstanceOptions {
|
2018-01-04 21:19:43 +03:00
|
|
|
/* TODO:
|
|
|
|
boolean dump = false;
|
|
|
|
DOMString prefix = "";
|
|
|
|
DOMString maxLogLevel = "";
|
|
|
|
DOMString innerID = "";
|
|
|
|
*/
|
|
|
|
DOMString consoleID = "";
|
2018-01-04 21:19:43 +03:00
|
|
|
};
|