Skip to content

Instantly share code, notes, and snippets.

@aaronshaf
Created March 4, 2016 16:57
Show Gist options
  • Save aaronshaf/d6ea00aa7ae5550ee3f8 to your computer and use it in GitHub Desktop.
Save aaronshaf/d6ea00aa7ae5550ee3f8 to your computer and use it in GitHub Desktop.
// hat-tip to Brent Burgoyne
document.evaluate("//*[contains(text(), 'foo')]", document.body, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment