-
-
Save zaach/3000231 to your computer and use it in GitHub Desktop.
gcli command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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