@webability/core 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dom.cjs +392 -0
- package/dist/dom.d.cts +50 -0
- package/dist/dom.d.ts +50 -0
- package/dist/dom.js +392 -0
- package/dist/index.cjs +35 -35
- package/dist/index.d.cts +14 -237
- package/dist/index.d.ts +14 -237
- package/dist/index.js +35 -35
- package/dist/types-10iqML3X.d.cts +237 -0
- package/dist/types-10iqML3X.d.ts +237 -0
- package/package.json +18 -12
package/dist/dom.d.cts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { P as PageLike, S as ScanResult } from './types-10iqML3X.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* In-DOM scan entry — runs the full detector engine directly against a live
|
|
5
|
+
* `document`, with no Playwright/Puppeteer and no injected source strings.
|
|
6
|
+
*
|
|
7
|
+
* Built for contexts that already ARE the page: Chrome-extension content
|
|
8
|
+
* scripts (MV3 CSP bans eval, so the server path's addScriptTag string
|
|
9
|
+
* injection is impossible), the widget, or any bundled in-browser consumer.
|
|
10
|
+
*
|
|
11
|
+
* Parity notes vs the server `scan()`:
|
|
12
|
+
* - Same detectors, same dedupe, same confidence tiering (issues/incomplete).
|
|
13
|
+
* - axe-core runs as a bundled module (no injection) when `includeAxe`.
|
|
14
|
+
* - HTML_CodeSniffer is NOT run — the server loads it from a CDN, which is
|
|
15
|
+
* remote code a browser extension may not execute.
|
|
16
|
+
* - No navigation/bot-challenge/auth-wall guards — the user is already on the
|
|
17
|
+
* page they want scanned.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
interface DomScanOptions {
|
|
21
|
+
/** Also run axe-core (bundled, ~104 rules). Default true. */
|
|
22
|
+
includeAxe?: boolean;
|
|
23
|
+
/** axe tag filter. Default WCAG 2.x A/AA. */
|
|
24
|
+
wcagTags?: string[];
|
|
25
|
+
/**
|
|
26
|
+
* Window to scan. Default the ambient `window`. SAME-REALM only: detector
|
|
27
|
+
* code executes in the realm this module was loaded into, so a cross-realm
|
|
28
|
+
* window (an iframe's contentWindow) is not supported — load the bundle
|
|
29
|
+
* inside that frame instead.
|
|
30
|
+
*/
|
|
31
|
+
window?: Window & typeof globalThis;
|
|
32
|
+
/**
|
|
33
|
+
* Run the focus-mutating checks (focus visibility/obscured). Default FALSE
|
|
34
|
+
* in DOM mode: they steal focus and scroll the page the user is looking
|
|
35
|
+
* at. Opt in for detached/offscreen documents only.
|
|
36
|
+
*/
|
|
37
|
+
interactiveChecks?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Adapts a live Window into the PageLike the engine orchestration expects.
|
|
41
|
+
* `evaluate` calls the function directly — detector browser functions are
|
|
42
|
+
* pure and reference helpers as globals, which `installDomKernel` provides.
|
|
43
|
+
* `addScriptTag` is a successful no-op: the only content the engine injects
|
|
44
|
+
* is the helper kernel, and it is already installed as real code.
|
|
45
|
+
*/
|
|
46
|
+
declare function createDomPage(win: Window & typeof globalThis): PageLike;
|
|
47
|
+
/** Runs the full WebAbility scan against the current document. */
|
|
48
|
+
declare function scanDocument(options?: DomScanOptions): Promise<ScanResult>;
|
|
49
|
+
|
|
50
|
+
export { type DomScanOptions, createDomPage, scanDocument };
|
package/dist/dom.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { P as PageLike, S as ScanResult } from './types-10iqML3X.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* In-DOM scan entry — runs the full detector engine directly against a live
|
|
5
|
+
* `document`, with no Playwright/Puppeteer and no injected source strings.
|
|
6
|
+
*
|
|
7
|
+
* Built for contexts that already ARE the page: Chrome-extension content
|
|
8
|
+
* scripts (MV3 CSP bans eval, so the server path's addScriptTag string
|
|
9
|
+
* injection is impossible), the widget, or any bundled in-browser consumer.
|
|
10
|
+
*
|
|
11
|
+
* Parity notes vs the server `scan()`:
|
|
12
|
+
* - Same detectors, same dedupe, same confidence tiering (issues/incomplete).
|
|
13
|
+
* - axe-core runs as a bundled module (no injection) when `includeAxe`.
|
|
14
|
+
* - HTML_CodeSniffer is NOT run — the server loads it from a CDN, which is
|
|
15
|
+
* remote code a browser extension may not execute.
|
|
16
|
+
* - No navigation/bot-challenge/auth-wall guards — the user is already on the
|
|
17
|
+
* page they want scanned.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
interface DomScanOptions {
|
|
21
|
+
/** Also run axe-core (bundled, ~104 rules). Default true. */
|
|
22
|
+
includeAxe?: boolean;
|
|
23
|
+
/** axe tag filter. Default WCAG 2.x A/AA. */
|
|
24
|
+
wcagTags?: string[];
|
|
25
|
+
/**
|
|
26
|
+
* Window to scan. Default the ambient `window`. SAME-REALM only: detector
|
|
27
|
+
* code executes in the realm this module was loaded into, so a cross-realm
|
|
28
|
+
* window (an iframe's contentWindow) is not supported — load the bundle
|
|
29
|
+
* inside that frame instead.
|
|
30
|
+
*/
|
|
31
|
+
window?: Window & typeof globalThis;
|
|
32
|
+
/**
|
|
33
|
+
* Run the focus-mutating checks (focus visibility/obscured). Default FALSE
|
|
34
|
+
* in DOM mode: they steal focus and scroll the page the user is looking
|
|
35
|
+
* at. Opt in for detached/offscreen documents only.
|
|
36
|
+
*/
|
|
37
|
+
interactiveChecks?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Adapts a live Window into the PageLike the engine orchestration expects.
|
|
41
|
+
* `evaluate` calls the function directly — detector browser functions are
|
|
42
|
+
* pure and reference helpers as globals, which `installDomKernel` provides.
|
|
43
|
+
* `addScriptTag` is a successful no-op: the only content the engine injects
|
|
44
|
+
* is the helper kernel, and it is already installed as real code.
|
|
45
|
+
*/
|
|
46
|
+
declare function createDomPage(win: Window & typeof globalThis): PageLike;
|
|
47
|
+
/** Runs the full WebAbility scan against the current document. */
|
|
48
|
+
declare function scanDocument(options?: DomScanOptions): Promise<ScanResult>;
|
|
49
|
+
|
|
50
|
+
export { type DomScanOptions, createDomPage, scanDocument };
|