Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
arrow-key-navigation
Advanced tools
arrow-key-navigation
is a simple utility to add left/right focus navigation to a web app. It's
designed for KaiOS apps but also available for any browser.
The basic idea is to make the ← and → keys act similar to Tab and Shift+Tab, i.e. to change focus between focusable elements in the DOM. Since the ↑ and ↓ keys typically scroll the page in KaiOS, this is usually all you need to add basic KaiOS accessibility to an existing web app.
It will also listen for the Enter key for certain special cases like checkbox/radio buttons.
npm install --save arrow-key-navigation
import * as arrowKeyNavigation from 'arrow-key-navigation'
arrowKeyNavigation.register() // start listening for key inputs
arrowKeyNavigation.unregister() // stop listening
To build an accessible dialog, you need to "trap" focus inside of the dialog, i.e. make it so focus cannot escape the dialog while it is active. To accomplish this, you can set a "focus trap test" which takes an element as input and returns truthy/falsy to indicate that the element is a focus trap (e.g. the modal dialog root):
arrowKeyNavigation.setFocusTrapTest(element => {
return element.classList.contains('my-dialog-class')
})
If you don't call setFocusTrapTest()
, then arrow-key-navigation
will assume that there are no focus traps
in your app.
You can choose to install this module only in KaiOS environments using logic like the following:
if (/KAIOS/.test(navigator.userAgent)) {
import('arrow-key-navigation').then(arrowKeyNavigation => {
arrowKeyNavigation.register()
})
}
npm run build
npm run lint
npm run lint:fix
npm test
FAQs
Add left/right key navigation to a KaiOS app or web app
The npm package arrow-key-navigation receives a total of 1,317 weekly downloads. As such, arrow-key-navigation popularity was classified as popular.
We found that arrow-key-navigation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.