Thursday, 23 April 2015

commandline-api

// Copy in clipboard
// Copies a string representation of the specified object to the clipboard.
var this_is = function() { return "crazy"}
copy(this_is())
// now paste!
// #crazy
// Select all images in page
$$('img')
// opens the debuger
debug(this_is())
// When the function specified is called, the debugger will be invoked and will break inside the function on the Sources panel allowing you to be able to step through the code and debug it.
dir(object)
// Displays an object-style listing of all the properties of the specified object. This method is an alias for the Console API's console.dir() method.
inspect(object/function)
inspect(document.body)
// Opens and selects the specified element or object in the appropriate panel: either the Elements panel for DOM elements and the Profiles panel for JavaScript heap objects.
// The following example opens the first child element of document.body in the Elements panel:
getEventListeners(object)
// Returns the event listeners registered on the specified object. The return value is an object that contains an array for each registered event type ("click" or "keydown", for example). The members of each array are objects that describe the listener registered for each type. For example, the following lists all the event listeners registered on the document object.
getEventListeners(document);
// monitor(function)
// When the function specified is called, a message is logged to the console that indicates the function name along with the arguments that are passed to the function when it was called.
function sum(x, y) { return x + y;}monitor(sum);
monitorEvents(object[, events])
// When one of the specified events occurs on the specified object, the Event object is logged to the console. You can specify a single event to monitor, an array of events, or one of the generic events "types" that are mapped to a predefined collection of events. See examples below.
// The following monitors all resize events on the window object.
monitorEvents(window, "resize");
undebug(function)
// Stops the debugging of the specified function so that when the function is called the debugger will no longer be invoked.
undebug(getData);
// unmonitor(function)
// Stops the monitoring of the specified function. Used in concert with monitor(fn).
unmonitor(getData);
// unmonitorEvents(object[, events])
// Stops monitoring events for the specified object and events. For example, the following stops all event monitoring on the window object:
unmonitorEvents(window);
values(object)
// Returns an array containing the values of all properties belonging to the specified object.
values(object);
// https://developer.chrome.com/devtools/docs/commandline-api#0-4
view raw gistfile1.js hosted with ❤ by GitHub

No comments:

Post a Comment