
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Accented is a library that helps visually identify accessibility issues in a website or webapp under development.
It can be set up in only a few lines of code
It complements approaches to other means of continuous automated accessibility testing such as static code analysis and inclusion of accessibility tests in test suites. Think of it as a form of linting, but for a rendered web page rather than for source code.
Accented uses the axe-core testing engine.
TODO: example screenshots, without Accented / with Accented.
import accented from 'https://esm.sh/accented';
.import('https://esm.sh/accented').then(({default: accented}) => { accented(); });
(this version will work in the console, unless it violates the content security policy, which shouldn't be the case locally).
accented
: the default library export. It’s the function that enables the continuous scanning and highlighting
on the page in whose context in was called. Example: const disable = accented(options)
.
options
. See Options.disable
function that takes no parameters. When called, disables the scanning and highlighting,
and cleans up any changes that Accented has made to the page.The following types are exported for TypeScript consumers:
AccentedOptions
: the options
parameter (see Options).DisableAccented
: the type of the function returned by accented
.axeContext
Type: see documentation.
Default: document
.
The context
parameter for axe.run()
.
Determines what element(s) to scan for accessibility issues.
Accepts a variety of shapes:
NodeList
;See documentation: https://www.deque.com/axe/core-documentation/api-documentation/#context-parameter
axeOptions
Type: object.
Default: {}
.
The options
parameter for axe.run()
.
Accented only supports two keys of the options
object:
rules
;runOnly
.Both properties are optional, and both control which accessibility rules your page is tested against.
See documentation: https://www.deque.com/axe/core-documentation/api-documentation/#options-parameter
output
An object controlling how the results of scans will be presented.
output.console
Type: boolean.
Default: true
.
Whether the list of elements with issues should be printed to the browser console whenever issues are added, removed, or changed.
callback
Type: function.
Default: no-op (() => {}
).
A function that Accented will call after every scan.
It accepts a single params
object with the following properties:
elementsWithIssues
: the most up-to-date array of all elements with accessibility issues.scanDuration
: how long the last scan took, in milliseconds (may be useful for performance tracking).Example:
accented({
callback: ({ elementsWithIssues, scanDuration }) => {
console.log('Elements with issues:', elementsWithIssues);
console.log('Scan duration:', scanDuration);
}
});
name
Type: string.
Default: "accented"
.
The character sequence that’s used in various elements, attributes and stylesheets that Accented adds to the page.
You shouldn’t have to use this attribute unless some of the names on your page conflict with what Accented provides by default.
data-accented
).accented-trigger
, accented-dialog
).accented
).--accented-
).__accented_axe_running__
).Only lowercase alphanumeric characters and dashes (-) are allowed in the name, and it must start with a lowercase letter.
Example:
accented({name: 'my-name'});
With the above option provided, the attribute set on elements with issues will be data-my-name
,
a custom element will be called my-name-trigger
, and so on.
throttle
An object controlling when Accented will run its scans.
throttle.wait
Type: number.
Default: 1000.
The delay (in milliseconds) after a mutation or after the last Accented scan.
If the page you’re scanning has a lot of nodes, scanning may take a noticeable time (~ a few hundred milliseconds), during which time the main thread will be blocked most of the time.
You may want to experiment with this value if your page contents change frequently or if it has JavaScript-based animations running on the main thread.
throttle.leading
Type: boolean.
Default: true
.
If set to true, the scan runs immediately after a mutation.
In this case, wait
only applies to subsequent scans,
giving the page at least wait
milliseconds between the end of the previous scan
and the beginning of the next one.
If set to false, the wait applies to mutations as well, delaying the output. This may be useful if you’re expecting bursts of mutations on your page.
TODO: Create a separate doc with info on using :root
and CSS layers to control some aspects of styling.
Documented CSS custom props:
--accented-primary-color
--accented-secondary-color
--accented-outline-width
--accented-outline-style
Highlighting elements inside shadow DOM is not supported yet, see #25.
Although axe-core is capable of scanning iframes, Accented doesn’t provide that as a special capability.
Instead, if you wish to scan the document in an iframe, initialize Accented inside the iframed document. There should be no interference between the instances of Accented running in the parent and child documents.
TODO: expand this section and better explain the concepts.
Q: can Accented be used in a CI (continuous integration) environment?
A: no, it’s only meant for local development. Accented runs accessibility tests on every state of the page that’s currently in the developer’s browser. However, if you additionally need something for CI, consider using axe-core in your automated test suite, either directly, or through wrappers such as jest-axe or axe-playwright.
Q: does Accented affect performance?
A: TODO: it might (it’s inevitable because it’s on the main thread), but we’ve taken X, Y, and Z measures to make it less noticeable. You can also take A, B, and C steps yourself.
FAQs
A frontend library for continuous accessibility testing and issue highlighting
The npm package accented receives a total of 2,184 weekly downloads. As such, accented popularity was classified as popular.
We found that accented demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.