Create a gist now

Instantly share code, notes, and snippets.

@zaach /qsa
Created Jun 26, 2012

gcli command
gcli.addCommand({
name: 'qsa',
description: 'perform querySelectorAll on the current document and return number of matches',
params: [
{
name: 'query',
type: 'string',
description: 'CSS selectors seperated by comma',
}
],
exec: function(args, context) {
var result = context.environment.contentDocument.querySelectorAll(args.query);
return result.length;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment