Skip to content
This repository has been archived by the owner on Oct 13, 2022. It is now read-only.

Commit

Permalink
fix: invoke evaluate() on correct document node (Firefox support) (#87)
Browse files Browse the repository at this point in the history
Co-authored-by: Gleb Bahmutov <[email protected]>
  • Loading branch information
badeball and bahmutov committed May 26, 2020
1 parent 3e109bc commit 9edd90d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const xpath = (subject, selector, options = {}) => {
contextNode = cy.state('window').document
}

let iterator = document.evaluate(selector, contextNode)
let iterator = (contextNode.ownerDocument || contextNode).evaluate(selector, contextNode)

if (isNumber(iterator)) {
const result = numberResult(iterator)
Expand Down

0 comments on commit 9edd90d

Please sign in to comment.