InspectorFrontendAPI.js [plain text]
InspectorFrontendAPI = {
_pendingCommands: [],
isDebuggingEnabled: function()
{
return WebInspector.panels.scripts.debuggingEnabled;
},
setDebuggingEnabled: function(enabled)
{
if (enabled) {
WebInspector.panels.scripts.enableDebugging();
WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.scripts);
} else
WebInspector.panels.scripts.disableDebugging();
},
isTimelineProfilingEnabled: function()
{
return WebInspector.panels.timeline.timelineProfilingEnabled;
},
setTimelineProfilingEnabled: function(enabled)
{
WebInspector.panels.timeline.setTimelineProfilingEnabled(enabled);
},
isProfilingJavaScript: function()
{
return WebInspector.CPUProfileType.instance && WebInspector.CPUProfileType.instance.isRecordingProfile();
},
startProfilingJavaScript: function()
{
WebInspector.panels.profiles.enableProfiler();
WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.profiles);
if (WebInspector.CPUProfileType.instance)
WebInspector.CPUProfileType.instance.startRecordingProfile();
},
stopProfilingJavaScript: function()
{
if (WebInspector.CPUProfileType.instance)
WebInspector.CPUProfileType.instance.stopRecordingProfile();
WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.profiles);
},
setAttachedWindow: function(attached)
{
WebInspector.attached = attached;
},
showConsole: function()
{
WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.console);
},
showMainResourceForFrame: function(frameId)
{
},
showResources: function()
{
WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.resources);
},
setDockingUnavailable: function(unavailable)
{
WebInspector.setDockingUnavailable(unavailable);
},
enterInspectElementMode: function()
{
WebInspector.toggleSearchingForNode();
},
savedURL: function(url)
{
WebInspector.savedURL(url);
},
setToolbarColors: function(backgroundColor, color)
{
WebInspector.setToolbarColors(backgroundColor, color);
},
dispatch: function(signature)
{
if (WebInspector.panels) {
var methodName = signature.shift();
return InspectorFrontendAPI[methodName].apply(InspectorFrontendAPI, signature);
}
InspectorFrontendAPI._pendingCommands.push(signature);
},
loadCompleted: function()
{
for (var i = 0; i < InspectorFrontendAPI._pendingCommands.length; ++i)
InspectorFrontendAPI.dispatch(InspectorFrontendAPI._pendingCommands[i]);
InspectorFrontendAPI._pendingCommands = [];
}
}