Package Exports
- query-selector-shadow-dom
- query-selector-shadow-dom/dist/querySelectorShadowDom
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (query-selector-shadow-dom) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
query-selector-shadow-dom
querySelector that can pierce Shadow DOM roots without knowing the path through nested shadow roots. Useful for automated testing of Web Components e.g. with Selenium.
import { querySelectorAllDeep, querySelectorDeep } from 'query-selector-shadow-dom';
In the below examples the components being searched for are nested within web components shadowRoots
.
// Download and Paste the lib code in dist into chrome://downloads console to try it out :)
console.log(querySelectorDeep('downloads-item:nth-child(4) #remove'));
console.log(querySelectorAllDeep('#downloads-list .is-active a[href^="https://"]'));
console.log(querySelectorDeep('#downloads-list div#title-area + a'));
#Shady DOM
If using the polyfills and shady DOM, this library will just use querySelector|querySelectorAll
Importing
- Shipped as an ES6 module to be included using a bundler of your choice (or not).
- ES5 version bundled ontop the window as
window.querySelectorShadowDom
available for easy include into a test framework