1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include
"nsISupports.idl"
7 #include
"nsIPrincipal.idl"
9 [scriptable
, uuid(9e32a7b6
-c4d1
-4d9a
-87b9
-1ef6b75c27a9
)]
10 interface nsIConsoleAPIStorage
: nsISupports
13 * Get the events array by inner window ID or all events from all windows.
16 * Optional, the inner window ID for which you want to get the array of
19 * The array of cached events for the given window. If no |aId| is
20 * given this function returns all of the cached events, from any
23 jsval getEvents
([optional] in AString aId
);
26 * Adds a listener to be notified of log events.
28 * @param jsval [aListener]
29 * A JS listener which will be notified with the message object when
31 * @param nsIPrincipal [aPrincipal]
32 * The principal of the listener - used to determine if we need to
33 * clone the message before forwarding it.
35 void addLogEventListener
(in jsval aListener
, in nsIPrincipal aPrincipal
);
38 * Removes a listener added with `addLogEventListener`.
40 * @param jsval [aListener]
41 * A JS listener which was added with `addLogEventListener`.
43 void removeLogEventListener
(in jsval aListener
);
46 * Record an event associated with the given window ID.
49 * The ID of the inner window for which the event occurred or "jsm" for
50 * messages logged from JavaScript modules..
51 * @param object aEvent
52 * A JavaScript object you want to store.
54 void recordEvent
(in AString aId
, in jsval aEvent
);
57 * Clear storage data for the given window.
60 * Optional, the inner window ID for which you want to clear the
61 * messages. If this is not specified all of the cached messages are
62 * cleared, from all window objects.
64 void clearEvents
([optional] in AString aId
);