2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following disclaimer
13 * in the documentation and/or other materials provided with the
15 * * Neither the name of Google Inc. nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 interface [Conditional=INSPECTOR] Inspector {
34 void addScriptToEvaluateOnLoad(in String scriptSource);
35 void removeAllScriptsToEvaluateOnLoad();
36 void reloadPage(in boolean ignoreCache);
37 void populateScriptObjects();
39 void openInInspectedWindow(in String url);
40 void setSearchingForNode(in boolean enabled, out boolean newState);
41 [event] void frontendReused();
42 [event] void addNodesToSearchResult(out Array nodeIds);
43 [event] void bringToFront();
44 [event] void disconnectFromBackend();
45 [event] void inspectedURLChanged(out String url);
46 [event] void domContentEventFired(out double time);
47 [event] void loadEventFired(out double time);
49 [event] void showPanel(out String panel);
51 [event] void evaluateForTestInFrontend(out long testCallId, out String script);
52 void didEvaluateForTestInFrontend(in long testCallId, in String jsonResult);
54 void highlightDOMNode(in long nodeId);
55 void hideDOMNodeHighlight();
56 void highlightFrame(in unsigned long frameId);
57 void hideFrameHighlight();
58 [event] void updateFocusedNode(out long nodeId);
60 void setUserAgentOverride(in String userAgent);
62 void getCookies(out Array cookies, out String cookiesString);
63 void deleteCookie(in String cookieName, in String domain);
65 // FIXME: dispatch on agents.
66 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
67 void enableDebugger();
68 void disableDebugger();
69 void enableProfiler();
70 void disableProfiler();
71 void startProfiling();
73 #endif // ENABLE_JAVASCRIPT_DEBUGGER
76 interface [Conditional=INSPECTOR] Runtime {
77 void evaluate(in String expression, in String objectGroup, in boolean includeCommandLineAPI, out Value result);
78 void getCompletions(in String expression, in boolean includeCommandLineAPI, out Value result);
79 void getProperties(in Object objectId, in boolean ignoreHasOwnProperty, in boolean abbreviate, out Value result);
80 void setPropertyValue(in Object objectId, in String propertyName, in String expression, out Value result);
81 void releaseWrapperObjectGroup(in long injectedScriptId, in String objectGroup);
84 interface [Conditional=INSPECTOR] InjectedScript {
85 void evaluateOnSelf(in String functionBody, in Array argumentsArray, out Value result);
88 interface [Conditional=INSPECTOR] Console {
89 void setConsoleMessagesEnabled(in boolean enabled, out boolean newState);
90 [event] void addConsoleMessage(out Object messageObj);
91 [event] void updateConsoleMessageExpiredCount(out unsigned long count);
92 [event] void updateConsoleMessageRepeatCount(out unsigned long count);
93 void clearConsoleMessages();
94 [event] void consoleMessagesCleared();
95 void setMonitoringXHREnabled(in boolean enabled);
98 interface [Conditional=INSPECTOR] Network {
99 void cachedResources(out Object resources);
100 void resourceContent(in unsigned long frameId, in String url, in boolean base64Encode, out boolean success, out String content);
101 void setExtraHeaders(in Object headers);
103 [event] void frameDetachedFromParent(out unsigned long frameId);
104 [event] void identifierForInitialRequest(out long identifier, out String url, out Object loader, out Value callStack);
105 [event] void willSendRequest(out long identifier, out double time, out Object request, out Object redirectResponse);
106 [event] void markResourceAsCached(out long identifier);
107 [event] void didReceiveResponse(out long identifier, out double time, out String resourceType, out Object response);
108 [event] void didReceiveContentLength(out long identifier, out double time, out long lengthReceived);
109 [event] void didFinishLoading(out long identifier, out double finishTime);
110 [event] void didFailLoading(out long identifier, out double time, out String localizedDescription);
111 [event] void didLoadResourceFromMemoryCache(out double time, out Object resource);
112 [event] void setInitialContent(out long identifier, out String sourceString, out String type);
113 [event] void didCommitLoadForFrame(out Object frame, out Object loader);
114 [event] void didCreateWebSocket(out unsigned long identifier, out String requestURL);
115 [event] void willSendWebSocketHandshakeRequest(out unsigned long identifier, out double time, out Object request);
116 [event] void didReceiveWebSocketHandshakeResponse(out unsigned long identifier, out double time, out Object response);
117 [event] void didCloseWebSocket(out unsigned long identifier, out double time);
120 #if defined(ENABLE_DATABASE) && ENABLE_DATABASE
121 interface [Conditional=INSPECTOR] Database {
122 void getDatabaseTableNames(in long databaseId, out Array tableNames);
123 void executeSQL(in long databaseId, in String query, out boolean success, out long transactionId);
125 [event] void addDatabase(out Object database);
126 [event] void selectDatabase(out int databaseId);
127 [event] void sqlTransactionSucceeded(out long transactionId, out Value columnNames, out Value values);
128 [event] void sqlTransactionFailed(out long transactionId, out Value sqlError);
132 #if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE
133 interface [Conditional=INSPECTOR] DOMStorage {
134 void getDOMStorageEntries(in long storageId, out Array entries);
135 void setDOMStorageItem(in long storageId, in String key, in String value, out boolean success);
136 void removeDOMStorageItem(in long storageId, in String key, out boolean success);
137 [event] void addDOMStorage(out Object storage);
138 [event] void updateDOMStorage(out int storageId);
139 [event] void selectDOMStorage(out int storageId);
143 #if defined(ENABLE_OFFLINE_WEB_APPLICATIONS) && ENABLE_OFFLINE_WEB_APPLICATIONS
144 interface [Conditional=INSPECTOR] ApplicationCache {
145 void getApplicationCaches(out Value applicationCaches);
146 [event] void updateApplicationCacheStatus(out int status);
147 [event] void updateNetworkState(out boolean isNowOnline);
151 interface [Conditional=INSPECTOR] DOM {
152 void getChildNodes(in long nodeId);
153 void setAttribute(in long elementId, in String name, in String value, out boolean success);
154 void removeAttribute(in long elementId, in String name, out boolean success);
155 void setTextNodeValue(in long nodeId, in String value, out boolean success);
156 void getEventListenersForNode(in long nodeId, out long outNodeId, out Array listenersArray);
157 void copyNode(in long nodeId);
158 void removeNode(in long nodeId, out long outNodeId);
159 void changeTagName(in long nodeId, in String newTagName, out long outNodeId);
160 void getOuterHTML(in long nodeId, out String outerHTML);
161 void setOuterHTML(in long nodeId, in String outerHTML, out long outNodeId);
162 void addInspectedNode(in long nodeId);
163 void performSearch(in String query, in boolean runSynchronously);
164 void searchCanceled();
165 void pushNodeByPathToFrontend(in String path, out long nodeId);
166 void resolveNode(in long nodeId, out Value result);
167 void getNodeProperties(in long nodeId, in Array propertiesArray, out Value result);
168 void getNodePrototypes(in long nodeId, out Value result);
169 void pushNodeToFrontend(in Object objectId, out Value result);
171 [event] void setDocument(out Value root); // FIXME: should be requested from the front-end as getDocument.
172 [event] void attributesUpdated(out long id, out Array attributes);
173 [event] void characterDataModified(out long id, out String newValue);
174 [event] void setChildNodes(out long parentId, out Array nodes);
175 [event] void setDetachedRoot(out Object root);
176 [event] void childNodeCountUpdated(out long id, out int newValue);
177 [event] void childNodeInserted(out long parentId, out long prevId, out Object node);
178 [event] void childNodeRemoved(out long parentId, out long id);
181 interface [Conditional=INSPECTOR] CSS {
182 void getStylesForNode(in long nodeId, out Value styles);
183 void getComputedStyleForNode(in long nodeId, out Value style);
184 void getInlineStyleForNode(in long nodeId, out Value style);
185 void getAllStyles(out Array styleSheetIds);
186 void getStyleSheet(in String styleSheetId, out Value styleSheet);
187 void getStyleSheetText(in String styleSheetId, out String url, out String text);
188 void setStyleSheetText(in String styleSheetId, in String text, out boolean success);
189 void setPropertyText(in Object styleId, in long propertyIndex, in String text, in boolean overwrite, out Value style);
190 void toggleProperty(in Object styleId, in long propertyIndex, in boolean disable, out Value style);
191 void setRuleSelector(in Object ruleId, in String selector, out Value rule);
192 void addRule(in long contextNodeId, in String selector, out Value rule);
193 void getSupportedCSSProperties(out Array cssProperties);
194 void querySelectorAll(in long documentId, in String selector, out Array result);
197 interface [Conditional=INSPECTOR] Timeline {
200 [event] void timelineProfilerWasStarted();
201 [event] void timelineProfilerWasStopped();
202 [event] void addRecordToTimeline(out Object record);
205 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
206 interface [Conditional=INSPECTOR] Debugger {
207 [event] void debuggerWasEnabled();
208 [event] void debuggerWasDisabled();
210 [event] void parsedScriptSource(out String sourceID, out String url, out int lineOffset, out int columnOffset, out int length, out int scriptWorldType);
211 [event] void failedToParseScriptSource(out String url, out String data, out int firstLine, out int errorLine, out String errorMessage);
213 void activateBreakpoints();
214 void deactivateBreakpoints();
216 void setJavaScriptBreakpoint(in String url, in int lineNumber, in int columnNumber, in String condition, in boolean enabled, out String breakpointId, out Array locations);
217 void setJavaScriptBreakpointBySourceId(in String sourceId, in int lineNumber, in int columnNumber, in String condition, in boolean enabled, out String breakpointId, out int actualLineNumber, out int actualColumnNumber);
218 void removeJavaScriptBreakpoint(in String breakpointId);
219 [event] void breakpointResolved(out String breakpointId, out String sourceId, out int lineNumber, out int columnNumber);
220 void continueToLocation(in String sourceId, in int lineNumber, in int columnNumber);
226 [event] void pausedScript(out Object details);
228 [event] void resumedScript(); // FIXME: Make this out parameter of resume if possible.
230 void editScriptSource(in String sourceID, in String newContent, out boolean success, out String result, out Value newCallFrames);
231 void getScriptSource(in String sourceID, out String scriptSource);
233 void setPauseOnExceptionsState(in long pauseOnExceptionsState, out long newState);
235 void evaluateOnCallFrame(in Object callFrameId, in String expression, in String objectGroup, in boolean includeCommandLineAPI, out Value result);
236 void getCompletionsOnCallFrame(in Object callFrameId, in String expression, in boolean includeCommandLineAPI, out Value result);
238 #if defined(ENABLE_WORKERS) && ENABLE_WORKERS
239 [event] void didCreateWorker(out long id, out String url, out boolean isShared);
240 [event] void didDestroyWorker(out long id);
241 #endif // ENABLE_WORKERS
244 #endif // ENABLE_JAVASCRIPT_DEBUGGER
246 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
247 interface [Conditional=INSPECTOR] BrowserDebugger {
248 void setAllBrowserBreakpoints(in Object breakpoints);
249 void setDOMBreakpoint(in long nodeId, in long type);
250 void removeDOMBreakpoint(in long nodeId, in long type);
251 void setEventListenerBreakpoint(in String eventName);
252 void removeEventListenerBreakpoint(in String eventName);
253 void setXHRBreakpoint(in String url);
254 void removeXHRBreakpoint(in String url);
256 #endif // ENABLE_JAVASCRIPT_DEBUGGER
258 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
259 interface [Conditional=INSPECTOR] Profiler {
260 [event] void profilerWasEnabled();
261 [event] void profilerWasDisabled();
263 void getProfileHeaders(out Array headers);
264 void getProfile(in String type, in unsigned long uid, out Object profile);
265 void removeProfile(in String type, in unsigned long uid);
266 void clearProfiles();
268 // FIXME: split into Profiler and HeapProfiler.
269 void takeHeapSnapshot(in boolean detailed);
270 [event] void addProfileHeader(out Object header);
271 [event] void addHeapSnapshotChunk(out unsigned long uid, out String chunk);
272 [event] void finishHeapSnapshot(out unsigned long uid);
273 [event] void setRecordingProfile(out boolean isProfiling);
274 [event] void resetProfiles();
275 [event] void reportHeapSnapshotProgress(out int done, out int total);
277 #endif // ENABLE_JAVASCRIPT_DEBUGGER