nsIConsoleAPIStorage.idl (2295B)
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/. */ 5 6 #include "nsISupports.idl" 7 #include "nsIPrincipal.idl" 8 9 [scriptable, uuid(9e32a7b6-c4d1-4d9a-87b9-1ef6b75c27a9)] 10 interface nsIConsoleAPIStorage : nsISupports 11 { 12 /** 13 * Get the events array by inner window ID or all events from all windows. 14 * 15 * @param string [aId] 16 * Optional, the inner window ID for which you want to get the array of 17 * cached events. 18 * @returns array 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 21 * window. 22 */ 23 jsval getEvents([optional] in AString aId); 24 25 /** 26 * Adds a listener to be notified of log events. 27 * 28 * @param jsval [aListener] 29 * A JS listener which will be notified with the message object when 30 * a log event occurs. 31 * @param nsIPrincipal [aPrincipal] 32 * The principal of the listener - used to determine if we need to 33 * clone the message before forwarding it. 34 */ 35 void addLogEventListener(in jsval aListener, in nsIPrincipal aPrincipal); 36 37 /** 38 * Removes a listener added with `addLogEventListener`. 39 * 40 * @param jsval [aListener] 41 * A JS listener which was added with `addLogEventListener`. 42 */ 43 void removeLogEventListener(in jsval aListener); 44 45 /** 46 * Record an event associated with the given window ID. 47 * 48 * @param string aId 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. 53 */ 54 void recordEvent(in AString aId, in jsval aEvent); 55 56 /** 57 * Clear storage data for the given window. 58 * 59 * @param string [aId] 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. 63 */ 64 void clearEvents([optional] in AString aId); 65 };