Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
makeup-focusables
Advanced tools
Returns an array of all focusable descendants of the given element.
This CommonJS module is still in an experimental state, until it reaches v1.0.0 you must consider all minor releases as breaking changes. Patch releases may introduce new features, but will be backwards compatible.
// via npm
npm install makeup-focusables
// via yarn
yarn add makeup-focusables
Markup:
<div class="widget">
<h2 tabindex="-1">Widget Title</h2>
<p>Widget Text</p>
<button type="button">Widget Button</button>
<a href="#">Widget Link</a>
</div>
// require the module
const focusables = require('makeup-focusables');
// get element reference
const widgetEl = document.querySelector('.widget');
// get array of all focusable elements (keyboard and programmatic)
const allItems = focusables(widgetEl);
console.log(allItems.length) // outputs: 3
// get array of only keyboard focusable elements
const keyboardItems = focusables(widgetEl, true);
console.log(keyboardItems.length) // outputs: 2
el
: the element to search (default: undefined)keyboardOnly
: return only elements focusable in sequential keyboard navigation (default: false)callback
: if set, will call focusables after requestAnimationFrame
and will pass the list of focusables in a callback methodFAQs
Returns an array of all focusable descendants of the given element
The npm package makeup-focusables receives a total of 96 weekly downloads. As such, makeup-focusables popularity was classified as not popular.
We found that makeup-focusables demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.