How to use the query-selector-shadow-dom.querySelectorAllDeep function in query-selector-shadow-dom

To help you get started, we’ve selected a few query-selector-shadow-dom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GoogleChromeLabs / ProjectVisBug / app / features / search.js View on Github external
if (PluginRegistry.has(query))
    return PluginRegistry.get(query)({
      selected: SelectorEngine.selection(),
      query
    })

  if (query == 'links')     query = 'a'
  if (query == 'buttons')   query = 'button'
  if (query == 'images')    query = 'img'
  if (query == 'text')      query = 'p,caption,a,h1,h2,h3,h4,h5,h6,small,date,time,li,dt,dd'

  if (!query) return SelectorEngine.unselect_all()
  if (query == '.' || query == '#' || query.trim().endsWith(',')) return

  try {
    let matches = querySelectorAllDeep(query + notList)
    if (!matches.length) matches = querySelectorAllDeep(query)
    if (matches.length) {
      matches.forEach(el =>
        fn
          ? fn(el)
          : SelectorEngine.select(el))
    }
  }
  catch (err) {}
}
github GoogleChromeLabs / ProjectVisBug / app / features / search.js View on Github external
return PluginRegistry.get(query)({
      selected: SelectorEngine.selection(),
      query
    })

  if (query == 'links')     query = 'a'
  if (query == 'buttons')   query = 'button'
  if (query == 'images')    query = 'img'
  if (query == 'text')      query = 'p,caption,a,h1,h2,h3,h4,h5,h6,small,date,time,li,dt,dd'

  if (!query) return SelectorEngine.unselect_all()
  if (query == '.' || query == '#' || query.trim().endsWith(',')) return

  try {
    let matches = querySelectorAllDeep(query + notList)
    if (!matches.length) matches = querySelectorAllDeep(query)
    if (matches.length) {
      matches.forEach(el =>
        fn
          ? fn(el)
          : SelectorEngine.select(el))
    }
  }
  catch (err) {}
}

query-selector-shadow-dom

use querySelector syntax to search for nodes inside of (nested) shadow roots

MIT
Latest version published 1 year ago

Package Health Score

73 / 100
Full package analysis