New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Operations: Selectors #115

Closed
neocotic opened this Issue Jan 3, 2013 · 3 comments

Comments

Projects
None yet
1 participant
@neocotic
Member

neocotic commented Jan 3, 2013

Add new operations that all accept a single String argument which will be used a selector query in the page's DOM. The contents of any targeted element(s) will then be processed by each specific operation.

Operations that will use the document.querySelector method;

  • select - Get the text of first matching element
  • selectHTML - Get the HTML contents of the first matching element
  • selectMarkdown - Get the contents of the first matching element as Markdown

Operations that will use the document.querySelectorAll method;

  • selectAll - Concatenate the text of all matching elements
  • selectAllHTML - Concatenate the HTML contents of all matching elements
  • selectAllMarkdown - Concatenate the contents of all matching elements as Markdown

If the argument is not a valid String or the query selector method call returns nothing the operations will simply return an empty String.

None of these operations will be available on internal Chrome pages or on the Chrome Web Store as they will be executed via content scripts which cannot be executed on these pages.

Care should be taken to ensure that these operations don't have an adverse affect on performance by ensuring that they are only executed when they have been used.

@ghost ghost assigned neocotic Jan 3, 2013

@neocotic

This comment has been minimized.

Show comment
Hide comment
@neocotic

neocotic Jan 4, 2013

Member

It would also be extremely beneficial to add an example or 2 to the Guide covering these new operations. Specifically, covering writing selectors or linking to an external page which explains better.

Member

neocotic commented Jan 4, 2013

It would also be extremely beneficial to add an example or 2 to the Guide covering these new operations. Specifically, covering writing selectors or linking to an external page which explains better.

@neocotic

This comment has been minimized.

Show comment
Hide comment
@neocotic

neocotic Jan 7, 2013

Member

This will now be included with 1.2.0 and will now be closed off.

See #121 for more details on the implementation.

Member

neocotic commented Jan 7, 2013

This will now be included with 1.2.0 and will now be closed off.

See #121 for more details on the implementation.

@neocotic neocotic closed this Jan 7, 2013

@neocotic neocotic reopened this Jan 7, 2013

@neocotic

This comment has been minimized.

Show comment
Hide comment
@neocotic

neocotic Jan 7, 2013

Member

The embedded guide needs to cover using selectors in some way (e.g. example) to allow non-developers to stand a chance at utilizing this functionality.

Member

neocotic commented Jan 7, 2013

The embedded guide needs to cover using selectors in some way (e.g. example) to allow non-developers to stand a chance at utilizing this functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment