Skip to content

Instantly share code, notes, and snippets.

@zaach
Created June 26, 2012 23:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zaach/3000231 to your computer and use it in GitHub Desktop.
Save zaach/3000231 to your computer and use it in GitHub Desktop.
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