Skip to content

Instantly share code, notes, and snippets.

View Georgegriff's full-sized avatar

George Griffiths Georgegriff

View GitHub Profile
@Georgegriff
Georgegriff / find_an_deep_element_with_selector.js
Last active April 22, 2020 12:31 — forked from ebidel/findall_elements_deep.js
Find a single element within a page, even one inside of many shadow roots
/**
* @author Georgegriff@ (George Griffiths)
* License Apache-2.0
*/
/**
* Finds the first matching element on the page that may be in a shadow root using a complex selector of n-depth
*
* Don't have to specify all shadow roots to button, tree is travered to find the correct element
*