/* * Copyright (C) 2010 Apple Inc. All rights reserved. * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ module core { interface [Conditional=INSPECTOR] Inspector { /////////////////////////////////////////////////////////////////////// // generic Inspector's methods /////////////////////////////////////////////////////////////////////// [domain=Inspector] void addScriptToEvaluateOnLoad(in String scriptSource); [domain=Inspector] void removeAllScriptsToEvaluateOnLoad(); [domain=Inspector] void reloadPage(); [domain=Inspector] void populateScriptObjects(); [domain=Inspector] void openInInspectedWindow(in String url); [domain=Inspector] void setSearchingForNode(in boolean enabled, out boolean newState); [notify, domain=Inspector] void frontendReused(); [notify, domain=Inspector] void addNodesToSearchResult(out Array nodeIds); [notify, domain=Inspector] void bringToFront(); [notify, domain=Inspector] void disconnectFromBackend(); [notify, domain=Inspector] void inspectedURLChanged(out String url); [notify, domain=Inspector] void domContentEventFired(out double time); [notify, domain=Inspector] void loadEventFired(out double time); [notify, domain=Inspector] void reset(); [notify, domain=Inspector] void showPanel(out String panel); [notify, domain=Inspector] void evaluateForTestInFrontend(out long testCallId, out String script); [domain=Inspector] void didEvaluateForTestInFrontend(in long testCallId, in String jsonResult); [domain=Inspector] void highlightDOMNode(in long nodeId); [domain=Inspector] void hideDOMNodeHighlight(); [domain=Inspector] void highlightFrame(in unsigned long frameId); [domain=Inspector] void hideFrameHighlight(); [notify, domain=Inspector] void updateFocusedNode(out long nodeId); [domain=Inspector] void setExtraHeaders(in Object headers); [domain=Inspector] void getCookies(out Array cookies, out String cookiesString); [domain=Inspector] void deleteCookie(in String cookieName, in String domain); /////////////////////////////////////////////////////////////////////// // Runtime /////////////////////////////////////////////////////////////////////// [domain=Runtime] void evaluate(in String expression, in String objectGroup, out Value result); [domain=Runtime] void getCompletions(in String expression, in boolean includeInspectorCommandLineAPI, out Value result); [domain=Runtime] void getProperties(in Object objectId, in boolean ignoreHasOwnProperty, in boolean abbreviate, out Value result); [domain=Runtime] void setPropertyValue(in Object objectId, in String propertyName, in String expression, out Value result); [domain=Runtime] void releaseWrapperObjectGroup(in long injectedScriptId, in String objectGroup); /////////////////////////////////////////////////////////////////////// // Injected Script /////////////////////////////////////////////////////////////////////// [domain=InjectedScript] void evaluateOnSelf(in String functionBody, in Array argumentsArray, out Value result); /////////////////////////////////////////////////////////////////////// // Console API /////////////////////////////////////////////////////////////////////// [domain=Console] void setConsoleMessagesEnabled(in boolean enabled, out boolean newState); [notify, domain=Console] void addConsoleMessage(out Object messageObj); [notify, domain=Console] void updateConsoleMessageExpiredCount(out unsigned long count); [notify, domain=Console] void updateConsoleMessageRepeatCount(out unsigned long count); [domain=Console] void clearConsoleMessages(); [notify, domain=Console] void consoleMessagesCleared(); [domain=Console] void setMonitoringXHREnabled(in boolean enabled); [notify, domain=Console] void monitoringXHRStateChanged(out boolean enabled); /////////////////////////////////////////////////////////////////////// // Network API /////////////////////////////////////////////////////////////////////// [domain=Network] void cachedResources(out Object resources); [domain=Network] void resourceContent(in unsigned long frameId, in String url, in boolean base64Encode, out String content); [notify, domain=Network] void frameDetachedFromParent(out unsigned long frameId); [notify, domain=Network] void identifierForInitialRequest(out long identifier, out String url, out Object loader, out Value callStack); [notify, domain=Network] void willSendRequest(out long identifier, out double time, out Object request, out Object redirectResponse); [notify, domain=Network] void markResourceAsCached(out long identifier); [notify, domain=Network] void didReceiveResponse(out long identifier, out double time, out String resourceType, out Object response); [notify, domain=Network] void didReceiveContentLength(out long identifier, out double time, out long lengthReceived); [notify, domain=Network] void didFinishLoading(out long identifier, out double finishTime); [notify, domain=Network] void didFailLoading(out long identifier, out double time, out String localizedDescription); [notify, domain=Network] void didLoadResourceFromMemoryCache(out double time, out Object resource); [notify, domain=Network] void setInitialContent(out long identifier, out String sourceString, out String type); [notify, domain=Network] void didCommitLoadForFrame(out Object frame, out Object loader); [notify, domain=Network] void didCreateWebSocket(out unsigned long identifier, out String requestURL); [notify, domain=Network] void willSendWebSocketHandshakeRequest(out unsigned long identifier, out double time, out Object request); [notify, domain=Network] void didReceiveWebSocketHandshakeResponse(out unsigned long identifier, out double time, out Object response); [notify, domain=Network] void didCloseWebSocket(out unsigned long identifier, out double time); #if defined(ENABLE_DATABASE) && ENABLE_DATABASE /////////////////////////////////////////////////////////////////////// // Database API /////////////////////////////////////////////////////////////////////// [domain=Database] void getDatabaseTableNames(in long databaseId, out Array tableNames); [domain=Database] void executeSQL(in long databaseId, in String query, out boolean success, out long transactionId); [notify, domain=Database] void addDatabase(out Object database); [notify, domain=Database] void selectDatabase(out int databaseId); [notify, domain=Database] void sqlTransactionSucceeded(out long transactionId, out Value columnNames, out Value values); [notify, domain=Database] void sqlTransactionFailed(out long transactionId, out Value sqlError); #endif #if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE /////////////////////////////////////////////////////////////////////// // DOM Storage API /////////////////////////////////////////////////////////////////////// [domain=DOMStorage] void getDOMStorageEntries(in long storageId, out Array entries); [domain=DOMStorage] void setDOMStorageItem(in long storageId, in String key, in String value, out boolean success); [domain=DOMStorage] void removeDOMStorageItem(in long storageId, in String key, out boolean success); [notify, domain=DOMStorage] void addDOMStorage(out Object storage); [notify, domain=DOMStorage] void updateDOMStorage(out int storageId); [notify, domain=DOMStorage] void selectDOMStorage(out int storageId); #endif #if defined(ENABLE_OFFLINE_WEB_APPLICATIONS) && ENABLE_OFFLINE_WEB_APPLICATIONS /////////////////////////////////////////////////////////////////////// // AppCache API /////////////////////////////////////////////////////////////////////// [domain=ApplicationCache] void getApplicationCaches(out Value applicationCaches); [notify, domain=ApplicationCache] void updateApplicationCacheStatus(out int status); [notify, domain=ApplicationCache] void updateNetworkState(out boolean isNowOnline); #endif #if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM /////////////////////////////////////////////////////////////////////// // Filesystem API /////////////////////////////////////////////////////////////////////// [domain=FileSystem] void getFileSystemPathAsync(in unsigned int type, in String origin); [domain=FileSystem] void revealFolderInOS(in String path); [notify, domain=FileSystem] void didGetFileSystemPath(out String root, out int type, out String origin); [notify, domain=FileSystem] void didGetFileSystemError(out int type, out String origin); [notify, domain=FileSystem] void didGetFileSystemDisabled(); #endif /////////////////////////////////////////////////////////////////////// // DOM API /////////////////////////////////////////////////////////////////////// [domain=DOM] void getChildNodes(in long nodeId); [domain=DOM] void setAttribute(in long elementId, in String name, in String value, out boolean success); [domain=DOM] void removeAttribute(in long elementId, in String name, out boolean success); [domain=DOM] void setTextNodeValue(in long nodeId, in String value, out boolean success); [domain=DOM] void getEventListenersForNode(in long nodeId, out long outNodeId, out Array listenersArray); [domain=DOM] void copyNode(in long nodeId); [domain=DOM] void removeNode(in long nodeId, out long outNodeId); [domain=DOM] void changeTagName(in long nodeId, in String newTagName, out long outNodeId); [domain=DOM] void getOuterHTML(in long nodeId, out String outerHTML); [domain=DOM] void setOuterHTML(in long nodeId, in String outerHTML, out long outNodeId); [domain=DOM] void addInspectedNode(in long nodeId); [domain=DOM] void performSearch(in String query, in boolean runSynchronously); [domain=DOM] void searchCanceled(); [domain=DOM] void pushNodeByPathToFrontend(in String path, out long nodeId); [domain=DOM] void resolveNode(in long nodeId, out Value result); [domain=DOM] void getNodeProperties(in long nodeId, in Array propertiesArray, out Value result); [domain=DOM] void getNodePrototypes(in long nodeId, out Value result); [domain=DOM] void pushNodeToFrontend(in Object objectId, out Value result); [notify, domain=DOM] void setDocument(out Value root); // FIXME: should be requested from the front-end as getDocument. [notify, domain=DOM] void attributesUpdated(out long id, out Array attributes); [notify, domain=DOM] void characterDataModified(out long id, out String newValue); [notify, domain=DOM] void setChildNodes(out long parentId, out Array nodes); [notify, domain=DOM] void setDetachedRoot(out Object root); [notify, domain=DOM] void childNodeCountUpdated(out long id, out int newValue); [notify, domain=DOM] void childNodeInserted(out long parentId, out long prevId, out Object node); [notify, domain=DOM] void childNodeRemoved(out long parentId, out long id); /////////////////////////////////////////////////////////////////////// // CSS API /////////////////////////////////////////////////////////////////////// [domain=CSS] void getStylesForNode2(in long nodeId, out Value styles); [domain=CSS] void getComputedStyleForNode2(in long nodeId, out Value style); [domain=CSS] void getInlineStyleForNode2(in long nodeId, out Value style); [domain=CSS] void getAllStyles2(out Array styleSheetIds); [domain=CSS] void getStyleSheet2(in String styleSheetId, out Value styleSheet); [domain=CSS] void getStyleSheetText2(in String styleSheetId, out String url, out String text); [domain=CSS] void setStyleSheetText2(in String styleSheetId, in String text, out boolean success); [domain=CSS] void setPropertyText2(in Object styleId, in long propertyIndex, in String text, in boolean overwrite, out Value style); [domain=CSS] void toggleProperty2(in Object styleId, in long propertyIndex, in boolean disable, out Value style); [domain=CSS] void setRuleSelector2(in Object ruleId, in String selector, out Value rule); [domain=CSS] void addRule2(in long contextNodeId, in String selector, out Value rule); [domain=CSS] void getSupportedCSSProperties(out Array cssProperties); [domain=CSS] void querySelectorAll(in long documentId, in String selector, out Array result); /////////////////////////////////////////////////////////////////////// // Timeline API /////////////////////////////////////////////////////////////////////// [domain=Inspector] void startTimelineProfiler(); [domain=Inspector] void stopTimelineProfiler(); [notify, domain=Timeline] void timelineProfilerWasStarted(); [notify, domain=Timeline] void timelineProfilerWasStopped(); [notify, domain=Timeline] void addRecordToTimeline(out Object record); #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER /////////////////////////////////////////////////////////////////////// // Debugger API /////////////////////////////////////////////////////////////////////// [domain=Inspector] void enableDebugger(in boolean always); [domain=Inspector] void disableDebugger(in boolean always); [domain=Inspector] void setAllBrowserBreakpoints(in Object breakpoints); [notify, domain=Debugger] void debuggerWasEnabled(); [notify, domain=Debugger] void debuggerWasDisabled(); [notify, domain=Debugger] void parsedScriptSource(out String sourceID, out String url, out int lineOffset, out int columnOffset, out int length, out int scriptWorldType); [notify, domain=Debugger] void failedToParseScriptSource(out String url, out String data, out int firstLine, out int errorLine, out String errorMessage); [domain=Debugger] void activateBreakpoints(); [domain=Debugger] void deactivateBreakpoints(); [domain=Debugger] void setBreakpoint(in String sourceID, in unsigned int lineNumber, in String condition, in boolean enabled, out String breakpointId, out unsigned int actualLineNumber); [domain=Debugger] void removeBreakpoint(in String breakpointId); [domain=BrowserDebugger] void setDOMBreakpoint(in long nodeId, in long type); [domain=BrowserDebugger] void removeDOMBreakpoint(in long nodeId, in long type); [domain=BrowserDebugger] void setEventListenerBreakpoint(in String eventName); [domain=BrowserDebugger] void removeEventListenerBreakpoint(in String eventName); [domain=BrowserDebugger] void setXHRBreakpoint(in String url); [domain=BrowserDebugger] void removeXHRBreakpoint(in String url); [domain=Debugger] void stepOver(); [domain=Debugger] void stepInto(); [domain=Debugger] void stepOut(); [domain=Debugger] void pause(); [notify, domain=Debugger] void pausedScript(out Object details); [domain=Debugger] void resume(); [notify, domain=Debugger] void resumedScript(); // FIXME: Make this out parameter of resume if possible. [domain=Debugger] void editScriptSource(in String sourceID, in String newContent, out boolean success, out String result, out Value newCallFrames); [domain=Debugger] void getScriptSource(in String sourceID, out String scriptSource); [domain=Debugger] void setPauseOnExceptionsState(in long pauseOnExceptionsState, out long newState); [domain=Debugger] void evaluateOnCallFrame(in Object callFrameId, in String expression, in String objectGroup, out Value result); [domain=Debugger] void getCompletionsOnCallFrame(in Object callFrameId, in String expression, in boolean includeInspectorCommandLineAPI, out Value result); [notify, domain=Debugger] void breakpointResolved(out String breakpointId, out String sourceID, out unsigned int lineNumber, out String condition, out boolean enabled, out unsigned int originalLineNumber); #if defined(ENABLE_WORKERS) && ENABLE_WORKERS [notify, domain=Debugger] void didCreateWorker(out long id, out String url, out boolean isShared); [notify, domain=Debugger] void didDestroyWorker(out long id); #endif // ENABLE_WORKERS /////////////////////////////////////////////////////////////////////// // Profiler API /////////////////////////////////////////////////////////////////////// [domain=Inspector] void enableProfiler(in boolean always); [domain=Inspector] void disableProfiler(in boolean always); [notify, domain=Profiler] void profilerWasEnabled(); [notify, domain=Profiler] void profilerWasDisabled(); [domain=Inspector] void startProfiling(); // FIXME: dispatch on profiler agent. [domain=Inspector] void stopProfiling(); // FIXME: dispatch on profiler agent. [domain=Profiler] void getProfileHeaders(out Array headers); [domain=Profiler] void getProfile(in String type, in unsigned long uid, out Object profile); [domain=Profiler] void removeProfile(in String type, in unsigned long uid); [domain=Profiler] void clearProfiles(); // FIXME: split into Profiler and HeapProfiler. [domain=Profiler] void takeHeapSnapshot(); [notify, domain=Profiler] void addProfileHeader(out Object header); [notify, domain=Profiler] void addHeapSnapshotChunk(out unsigned long uid, out String chunk); [notify, domain=Profiler] void finishHeapSnapshot(out unsigned long uid); [notify, domain=Profiler] void setRecordingProfile(out boolean isProfiling); [notify, domain=Profiler] void resetProfiles(); #endif // ENABLE_JAVASCRIPT_DEBUGGER }; }