v0.1.0 on npmMIT OR Apache-2.0

A drop-in replacement for axe-core, with its rules in Rust and WebAssembly.

An accessibility testing engine with the window.axe interface of axe-core 4.14.1: the same calls, options and results object. One walk of the page feeds a Rust core compiled to WebAssembly. MIT OR Apache-2.0.

Get startedCompatibility

Install

$ npm i @avarok/glance
// migrating is one line
- const { source } = require('axe-core');
+ const { source } = require('@avarok/glance');

await page.addScriptTag({ content: source });
const results = await page.evaluate(() => axe.run());

1.4–3.0×

faster than axe-core, same rules (exact mode)

across 5 recorded pages, from a small app to Wikipedia

1.5–3.3×

faster in fast mode (may report incomplete)

across 5 recorded pages, fast mode against axe-core

4.14.1

axe-core interface

window.axe, same options, same results object

Run both engines in your browser

Audit two sample pages with axe-core 4.14.1 and with glance, on this device, one engine at a time, with the same 71 rules, and compare the results and the timings. Nothing is downloaded until you press the button (3,266 kB in all).

axe-core 4.14.1 is © Deque Systems, Inc., licensed under the Mozilla Public License 2.0, and served here unmodified from its npm package (source).

Benchmarks

A separate measurement: warm axe.run in an iframe, large documentation page, Chromium

Not the headline numbers above: median of 63 warm runs per engine on an Apple M3 Max in Chromium 159.0.8154.6, same rules, each engine in its own iframe, one at a time, as the live demo runs them. Raw data is committed; the chart is generated from it.

  • glance 0.1.0204.4
  • axe-core 4.14.1397.5

milliseconds per run, lower is betterbench/browser/results/chromium.jsonl

@avarok/glance 0.1.0 · README updated

What it is. glance checks a web page for accessibility problems against WCAG and WAI-ARIA, with the public interface of axe-core 4.14.1: axe.run(), axe.configure(), axe.getRules(), runPartial/finishRun, frame messaging, reporters, plugins, and the documented axe.utils and axe.commons members. Code that calls axe-core gets the same results object back. Underneath, a collector reads the DOM, computed styles and layout in one walk into a compact snapshot, and the rules run over that snapshot in a no_std Rust core compiled to wasm32-unknown-unknown. The wasm is embedded in one injectable script.

Status. Version 0.1.0, not released yet and not yet on npm; build from source (below). glance implements rules today; docs/COMPAT.md lists every rule and API member as same, differs, planned or absent. A rule glance does not implement is absent, never reported as passing.

Quick start

From source (needs Node.js 22 and the Rust toolchain in rust-toolchain.toml):

git clone https://github.com/Avarok-Cybersecurity/glance.git
cd glance && npm ci && sh scripts/build-wasm.sh && node scripts/build-js.mjs

That writes dist/glance.min.js (one script that defines window.axe) and dist/index.cjs (the package's main export, whose source is that script). With Playwright, in an ES module:

import { chromium } from 'playwright';
import glance from '@avarok/glance'; // or './dist/index.cjs' from a checkout

const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.com/');
await page.addScriptTag({ content: glance.source });
const results = await page.evaluate(() => axe.run());
console.log(results.violations.map((v) => `${v.id}: ${v.nodes.length}`));
await browser.close();

In a page directly: <script src="glance.min.js"></script>, then axe.run().then((results) => …).

Migrating from axe-core

Change where the script comes from; nothing that runs in the page changes.

- const { source } = require('axe-core');
+ const { source } = require('@avarok/glance');

The page still sees window.axe, and axe.run, axe.configure and the rest take the same arguments.

Differences a migrating user can hit

The full list is in docs/COMPAT.md.

Area axe-core 4.14.1 glance
Rules every rule in the package implemented; naming an absent rule in runOnly or rules throws the reference's unknown-rule error; a bare run() runs fewer rules
Message text the reference's wording glance's own wording; ids, impacts, tags, targets and result structure match
results.testEngine { name: "axe-core", … } { name: "glance", version: <glance version> }; axe.version stays "4.14.1"
configure({ standards }) supported throws glance does not support standards overrides yet
Custom checks and rules JS functions or built-in function ids JS functions work; a string evaluate/matches id throws ReferenceError
performanceTimer per-rule timing lines glance's own phases: collect, evaluate, report
preload preloads assets accepted, no effect (no implemented rule needs it)

Fast mode

Fast mode (axe.run(context, { fast: true }), a glance option axe-core does not have) may trade exactness for speed: it may miss findings or report them as incomplete, and it never reports a violation that exact mode would not. Without fast, or with fast: false, a run is in exact mode, the one compared with axe-core 4.14.1. It currently makes 2 trades, listed in docs/COMPAT-FAST.md.

Benchmarks

Whole axe.run time per page and configuration, glance against axe-core 4.14.1

axe.run time in milliseconds under common, the rules both engines implement: median of 5 after a warm-up, a fresh page per sample. Exact mode is the one compared with axe-core and the headline. Fast mode ({ fast: true }, docs/COMPAT-FAST.md) may report findings as incomplete instead, so it is its own column. Every configuration is in bench/results/whole.md.

Apple M3 Max (Mac15,8, 16 cores), Chromium 159.0.8154.6, Node v22.23.2; glance 0.1.0+1b553a2, axe-core 4.14.1.

page elements axe-core glance speed-up glance fast mode fast speed-up
wiki-ww2 16918 1761 581 3.03× 534 3.30×
whatwg-parsing 15024 1525 578 2.64× 525 2.91×
mdn-elements 2481 281 122 2.29× 109 2.57×
app-small 293 57.2 40.3 1.42× 39.1 1.46×
stress 15263 1457 581 2.51× 536 2.72×

The method is in docs/design/07-bench.md. The black-box profile that motivated the design, which measured only the reference, is in docs/design/06-reference-profile.md.

How it compares

Aspect glance axe-core 4.14.1
API window.axe, as axe-core 4.14.1 window.axe
Rules (COMPAT.md) the full set
Licence MIT OR Apache-2.0 MPL-2.0
Mechanism one page walk into a snapshot; rules in Rust → wasm rules in JavaScript over the live DOM
Speed axe.run 1.4–3.0× faster under the same rules, exact mode (Benchmarks) the baseline

Compatibility

  • Browsers: Chromium, tested in CI through Playwright 1.65.1. Others untested.
  • Node.js: 22 for the package's main export and the build scripts.
  • Building: Rust 1.100.0 (rust-toolchain.toml) with the wasm32-unknown-unknown target. Nothing Rust-related is needed at runtime.
  • Interface level: axe-core 4.14.1. Every member and rule, with its status: docs/COMPAT.md.

Questions people ask

What is glance?

An accessibility testing engine for web pages with the same JavaScript API as axe-core 4.14.1, whose rules run in Rust compiled to WebAssembly.

Is glance a drop-in replacement for axe-core?

Not in every case yet. For axe-core 4.14.1 and the rules glance implements, load glance's script instead of axe-core's and the same calls return the same results object, apart from the differences docs/COMPAT.md lists with what is implemented.

Is glance faster than axe-core?

On the 5 recorded pages measured, glance's axe.run ran 1.4–3.0× faster than axe-core's under the rules both implement, in exact mode. See Benchmarks.

How do I migrate from axe-core?

Inject glance's source where you injected axe-core's. See Migrating from axe-core.

Does it work with tools that inject axe-core for me?

Anything that injects a script defining window.axe and then calls it can use glance's source, if the tool lets you supply the script. glance's own tests drive Playwright directly.

Can I use it in a commercial or closed-source project?

Yes. glance is MIT OR Apache-2.0, at your option.

Is glance based on axe-core's code?

No. It is an independent, clean-room implementation written from a specification of the public interface, W3C standards and black-box behaviour. See NOTICE and docs/spec/SOURCES.md.

Is glance affiliated with axe-core's authors?

No. The name axe-core is used only to say which interface glance is compatible with.

Contributing and security

See CONTRIBUTING.md; it includes the clean-room rule: contributions must not use axe-core source. Report vulnerabilities privately as described in SECURITY.md. Everyone taking part follows the Code of Conduct. Changes are recorded in CHANGELOG.md.

License

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

How it works

  1. A collector in the page walks the flattened tree once (light DOM, open shadow roots, slots) and writes structure, interned attributes, computed styles and layout into flat columns.
  2. The Rust core (crates/glance-a11y, no_std + alloc) runs every selected rule over that snapshot. Shared facts (roles, accessible names, focus, visibility, language) are computed once and memoised; anything not in the snapshot is read lazily through one Host trait.
  3. The API layer turns raw results into the axe-compatible results object, applies custom rules and checks, and runs the reporter.

Rule metadata and messages live in one file, rules.json. Details: docs/DESIGN.md.

What this does not prove

  • The speed numbers are from 5 recorded pages on one machine, replayed from recordings with the network blocked (Apple M3 Max (Mac15,8, 16 cores), Chromium 159.0.8154.6, Node v22.23.2). Other pages, machines and browsers will differ.
  • The differential corpus is glance's own. Its pages were written from the specification and run under both engines; it is not the reference's test suite. Agreement means every case in conformance/cases/ gives the same results object, except the known differences COMPAT.md lists rule by rule, not that every page will.
  • Not every rule exists yet. Results from a bare run() contain fewer rules than the reference's; COMPAT.md says which.
  • Chromium only. CI runs Chromium through Playwright. Firefox and WebKit are untested.
  • W3C ACT test cases run under both engines in CI; where the reference departs from the ACT expectation, glance follows the reference (docs/COMPAT-ACT.md).
  • Automated checks find a subset of accessibility problems. That is as true of glance as of the reference; neither replaces testing with people and assistive technology.

axe-core and glance, live

Measured on your device, one engine at a time, same page, same 71 rules. Each engine runs in its own iframe holding a fresh copy of the page.

Sample page

axe-core 4.14.1

Download + start-up
—
First run
—
Warm run, median
—
Violations · passes · incomplete
—
Script size
—

glance 0.1.0

Download + start-up
—
First run
—
Warm run, median
—
Violations · passes · incomplete
—
Script size
—