@axe-core/webdriverjs 4.6.2-alpha.379 → 4.7.0
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/index.d.ts +10 -3
- package/dist/index.js +511 -347
- package/dist/index.mjs +489 -0
- package/package.json +16 -6
- package/dist/axe-injector.d.ts +0 -36
- package/dist/axe-injector.js +0 -254
- package/dist/axe-injector.js.map +0 -1
- package/dist/browser.d.ts +0 -14
- package/dist/browser.js +0 -59
- package/dist/browser.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types.d.ts +0 -19
- package/dist/types.js +0 -3
- package/dist/types.js.map +0 -1
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/index.js +0 -21
- package/dist/utils/index.js.map +0 -1
package/dist/axe-injector.js
DELETED
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var selenium_webdriver_1 = require("selenium-webdriver");
|
|
40
|
-
var axe_core_1 = require("axe-core");
|
|
41
|
-
var StaleElementReferenceError = selenium_webdriver_1.error.StaleElementReferenceError;
|
|
42
|
-
var AxeInjectorLegacy = /** @class */ (function () {
|
|
43
|
-
function AxeInjectorLegacy(_a) {
|
|
44
|
-
var driver = _a.driver, axeSource = _a.axeSource, builderOptions = _a.builderOptions, config = _a.config;
|
|
45
|
-
this.driver = driver;
|
|
46
|
-
this.axeSource = axeSource || axe_core_1.source;
|
|
47
|
-
this.config = config ? JSON.stringify(config) : '';
|
|
48
|
-
this.options = builderOptions || {};
|
|
49
|
-
this.didLogError = false;
|
|
50
|
-
this.options.noSandbox =
|
|
51
|
-
typeof this.options.noSandbox === 'boolean'
|
|
52
|
-
? this.options.noSandbox
|
|
53
|
-
: false;
|
|
54
|
-
this.options.logIframeErrors =
|
|
55
|
-
typeof this.options.logIframeErrors === 'boolean'
|
|
56
|
-
? this.options.logIframeErrors
|
|
57
|
-
: false;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Checks to make sure that the error thrown was not a stale iframe
|
|
61
|
-
* @param {Error} error
|
|
62
|
-
* @returns {void}
|
|
63
|
-
*/
|
|
64
|
-
AxeInjectorLegacy.prototype.errorHandler = function (err) {
|
|
65
|
-
// We've already "warned" the user. No need to do it again (mostly for backwards compatibility)
|
|
66
|
-
if (this.didLogError) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
this.didLogError = true;
|
|
70
|
-
var msg;
|
|
71
|
-
if (err instanceof StaleElementReferenceError) {
|
|
72
|
-
msg =
|
|
73
|
-
'Tried to inject into a removed iframe. This will not affect the analysis of the rest of the page but you might want to ensure the page has finished updating before starting the analysis.';
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
msg = 'Failed to inject axe-core into one of the iframes!';
|
|
77
|
-
}
|
|
78
|
-
if (this.options.logIframeErrors) {
|
|
79
|
-
console.error(msg);
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
throw new Error(msg);
|
|
83
|
-
};
|
|
84
|
-
Object.defineProperty(AxeInjectorLegacy.prototype, "script", {
|
|
85
|
-
/**
|
|
86
|
-
* Get axe-core source and configurations
|
|
87
|
-
* @returns {String}
|
|
88
|
-
*/
|
|
89
|
-
get: function () {
|
|
90
|
-
return "\n ".concat(this.axeSource, "\n ").concat(this.config ? "axe.configure(".concat(this.config, ")") : '', "\n axe.configure({\n branding: { application: 'webdriverjs' }\n })\n ");
|
|
91
|
-
},
|
|
92
|
-
enumerable: false,
|
|
93
|
-
configurable: true
|
|
94
|
-
});
|
|
95
|
-
/**
|
|
96
|
-
* Removes the `sandbox` attribute from iFrames
|
|
97
|
-
* @returns {Promise<void>}
|
|
98
|
-
*/
|
|
99
|
-
AxeInjectorLegacy.prototype.sandboxBuster = function () {
|
|
100
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
101
|
-
var _this = this;
|
|
102
|
-
return __generator(this, function (_a) {
|
|
103
|
-
// outer promise needed because `executeAsyncScript`
|
|
104
|
-
// does not return a "real promise" (ManagedPromise)
|
|
105
|
-
// and we want to await it.
|
|
106
|
-
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
107
|
-
/* eslint-disable no-undef */
|
|
108
|
-
_this.driver
|
|
109
|
-
// https://github.com/vercel/pkg/issues/676
|
|
110
|
-
// we need to pass a string vs a function so we manually stringified the function
|
|
111
|
-
.executeAsyncScript("\n var callback = arguments[arguments.length - 1];\n var iframes = Array.from(\n document.querySelectorAll('iframe[sandbox]')\n );\n var removeSandboxAttr = clone => attr => {\n if (attr.name === 'sandbox') return;\n clone.setAttribute(attr.name, attr.value);\n };\n var replaceSandboxedIframe = iframe => {\n var clone = document.createElement('iframe');\n var promise = new Promise(\n iframeLoaded => (clone.onload = iframeLoaded)\n );\n Array.from(iframe.attributes).forEach(removeSandboxAttr(clone));\n iframe.parentElement.replaceChild(clone, iframe);\n return promise;\n };\n Promise.all(iframes.map(replaceSandboxedIframe)).then(callback);\n ")
|
|
112
|
-
// resolve the outer promise
|
|
113
|
-
.then(function () { return resolve(); })
|
|
114
|
-
.catch(function (e) { return reject(e); });
|
|
115
|
-
})];
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* Injects into the provided `frame` and its child `frames`
|
|
121
|
-
* @param {WebElement[]} framePath
|
|
122
|
-
* @returns {Promise<void>}
|
|
123
|
-
*/
|
|
124
|
-
AxeInjectorLegacy.prototype.handleFrame = function (framePath) {
|
|
125
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
126
|
-
var _i, framePath_1, frame, ifs, fs, frames, _a, frames_1, childFrames, error_1;
|
|
127
|
-
return __generator(this, function (_b) {
|
|
128
|
-
switch (_b.label) {
|
|
129
|
-
case 0: return [4 /*yield*/, this.driver.switchTo().defaultContent()];
|
|
130
|
-
case 1:
|
|
131
|
-
_b.sent();
|
|
132
|
-
_i = 0, framePath_1 = framePath;
|
|
133
|
-
_b.label = 2;
|
|
134
|
-
case 2:
|
|
135
|
-
if (!(_i < framePath_1.length)) return [3 /*break*/, 5];
|
|
136
|
-
frame = framePath_1[_i];
|
|
137
|
-
return [4 /*yield*/, this.driver.switchTo().frame(frame)];
|
|
138
|
-
case 3:
|
|
139
|
-
_b.sent();
|
|
140
|
-
_b.label = 4;
|
|
141
|
-
case 4:
|
|
142
|
-
_i++;
|
|
143
|
-
return [3 /*break*/, 2];
|
|
144
|
-
case 5:
|
|
145
|
-
if (!this.options.noSandbox) return [3 /*break*/, 7];
|
|
146
|
-
return [4 /*yield*/, this.sandboxBuster()];
|
|
147
|
-
case 6:
|
|
148
|
-
_b.sent();
|
|
149
|
-
_b.label = 7;
|
|
150
|
-
case 7: return [4 /*yield*/, this.driver.executeScript(this.script)];
|
|
151
|
-
case 8:
|
|
152
|
-
_b.sent();
|
|
153
|
-
return [4 /*yield*/, this.driver.findElements({ tagName: 'iframe' })];
|
|
154
|
-
case 9:
|
|
155
|
-
ifs = _b.sent();
|
|
156
|
-
return [4 /*yield*/, this.driver.findElements({ tagName: 'frame' })];
|
|
157
|
-
case 10:
|
|
158
|
-
fs = _b.sent();
|
|
159
|
-
frames = ifs.concat(fs);
|
|
160
|
-
_a = 0, frames_1 = frames;
|
|
161
|
-
_b.label = 11;
|
|
162
|
-
case 11:
|
|
163
|
-
if (!(_a < frames_1.length)) return [3 /*break*/, 17];
|
|
164
|
-
childFrames = frames_1[_a];
|
|
165
|
-
framePath.push(childFrames);
|
|
166
|
-
_b.label = 12;
|
|
167
|
-
case 12:
|
|
168
|
-
_b.trys.push([12, 14, 15, 16]);
|
|
169
|
-
return [4 /*yield*/, this.handleFrame(framePath)];
|
|
170
|
-
case 13:
|
|
171
|
-
_b.sent();
|
|
172
|
-
return [3 /*break*/, 16];
|
|
173
|
-
case 14:
|
|
174
|
-
error_1 = _b.sent();
|
|
175
|
-
this.errorHandler(error_1);
|
|
176
|
-
return [3 /*break*/, 16];
|
|
177
|
-
case 15:
|
|
178
|
-
framePath.pop();
|
|
179
|
-
return [7 /*endfinally*/];
|
|
180
|
-
case 16:
|
|
181
|
-
_a++;
|
|
182
|
-
return [3 /*break*/, 11];
|
|
183
|
-
case 17: return [2 /*return*/];
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
};
|
|
188
|
-
/**
|
|
189
|
-
* Injects into all frames
|
|
190
|
-
* @returns {Promise<void>}
|
|
191
|
-
*/
|
|
192
|
-
AxeInjectorLegacy.prototype.injectIntoAllFrames = function () {
|
|
193
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
194
|
-
var ifs, fs, frames, _i, frames_2, childFrame, err_1;
|
|
195
|
-
return __generator(this, function (_a) {
|
|
196
|
-
switch (_a.label) {
|
|
197
|
-
case 0:
|
|
198
|
-
// Ensure we're "starting" our loop at the top-most frame
|
|
199
|
-
return [4 /*yield*/, this.driver.switchTo().defaultContent()];
|
|
200
|
-
case 1:
|
|
201
|
-
// Ensure we're "starting" our loop at the top-most frame
|
|
202
|
-
_a.sent();
|
|
203
|
-
if (!this.options.noSandbox) return [3 /*break*/, 3];
|
|
204
|
-
// reinject any sandboxed iframes without the sandbox attribute so we can scan
|
|
205
|
-
return [4 /*yield*/, this.sandboxBuster()];
|
|
206
|
-
case 2:
|
|
207
|
-
// reinject any sandboxed iframes without the sandbox attribute so we can scan
|
|
208
|
-
_a.sent();
|
|
209
|
-
_a.label = 3;
|
|
210
|
-
case 3:
|
|
211
|
-
// Inject the script into the top-level
|
|
212
|
-
// XXX: if this `executeScript` fails, we *want* to error, as we cannot run axe-core.
|
|
213
|
-
return [4 /*yield*/, this.driver.executeScript(this.script)];
|
|
214
|
-
case 4:
|
|
215
|
-
// Inject the script into the top-level
|
|
216
|
-
// XXX: if this `executeScript` fails, we *want* to error, as we cannot run axe-core.
|
|
217
|
-
_a.sent();
|
|
218
|
-
return [4 /*yield*/, this.driver.findElements({ tagName: 'iframe' })];
|
|
219
|
-
case 5:
|
|
220
|
-
ifs = _a.sent();
|
|
221
|
-
return [4 /*yield*/, this.driver.findElements({ tagName: 'frame' })];
|
|
222
|
-
case 6:
|
|
223
|
-
fs = _a.sent();
|
|
224
|
-
frames = ifs.concat(fs);
|
|
225
|
-
_i = 0, frames_2 = frames;
|
|
226
|
-
_a.label = 7;
|
|
227
|
-
case 7:
|
|
228
|
-
if (!(_i < frames_2.length)) return [3 /*break*/, 12];
|
|
229
|
-
childFrame = frames_2[_i];
|
|
230
|
-
_a.label = 8;
|
|
231
|
-
case 8:
|
|
232
|
-
_a.trys.push([8, 10, , 11]);
|
|
233
|
-
return [4 /*yield*/, this.handleFrame([childFrame])];
|
|
234
|
-
case 9:
|
|
235
|
-
_a.sent();
|
|
236
|
-
return [3 /*break*/, 11];
|
|
237
|
-
case 10:
|
|
238
|
-
err_1 = _a.sent();
|
|
239
|
-
this.errorHandler(err_1);
|
|
240
|
-
return [3 /*break*/, 11];
|
|
241
|
-
case 11:
|
|
242
|
-
_i++;
|
|
243
|
-
return [3 /*break*/, 7];
|
|
244
|
-
case 12:
|
|
245
|
-
// Move back to the top-most frame
|
|
246
|
-
return [2 /*return*/, this.driver.switchTo().defaultContent()];
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
});
|
|
250
|
-
};
|
|
251
|
-
return AxeInjectorLegacy;
|
|
252
|
-
}());
|
|
253
|
-
exports.default = AxeInjectorLegacy;
|
|
254
|
-
//# sourceMappingURL=axe-injector.js.map
|
package/dist/axe-injector.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"axe-injector.js","sourceRoot":"","sources":["../src/axe-injector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yDAA2C;AAC3C,qCAAkC;AAE1B,IAAA,0BAA0B,GAAK,0BAAK,2BAAV,CAAW;AAE7C;IAME,2BAAY,EAKQ;YAJlB,MAAM,YAAA,EACN,SAAS,eAAA,EACT,cAAc,oBAAA,EACd,MAAM,YAAA;QAEN,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,iBAAM,CAAC;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,IAAI,CAAC,OAAO,GAAG,cAAc,IAAI,EAAE,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAEzB,IAAI,CAAC,OAAO,CAAC,SAAS;YACpB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS;gBACzC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS;gBACxB,CAAC,CAAC,KAAK,CAAC;QAEZ,IAAI,CAAC,OAAO,CAAC,eAAe;YAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,KAAK,SAAS;gBAC/C,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe;gBAC9B,CAAC,CAAC,KAAK,CAAC;IACd,CAAC;IAED;;;;OAIG;IAEK,wCAAY,GAApB,UAAqB,GAAU;QAC7B,+FAA+F;QAC/F,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,OAAO;SACR;QAED,IAAI,CAAC,WAAW,GAAG,IAAI,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,EAAE,EAAA;;wBAD1B,8EAA8E;wBAC9E,SAA0B,CAAC;;;oBAG7B,uCAAuC;oBACvC,qFAAqF;oBACrF,qBAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EAAA;;wBAF5C,uCAAuC;wBACvC,qFAAqF;wBACrF,SAA4C,CAAC;wBAGjC,qBAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAA;;wBAA3D,GAAG,GAAG,SAAqD;wBACtD,qBAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAA;;wBAAzD,EAAE,GAAG,SAAoD;wBACzD,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;8BAGC,EAAN,iBAAM;;;6BAAN,CAAA,oBAAM,CAAA;wBAApB,UAAU;;;;wBAEjB,qBAAM,IAAI,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC,CAAC,EAAA;;wBAApC,SAAoC,CAAC;;;;wBAErC,IAAI,CAAC,YAAY,CAAC,KAAY,CAAC,CAAC;;;wBAJX,IAAM,CAAA;;;oBAQ/B,kCAAkC;oBAClC,sBAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,cAAc,EAAE,EAAC;;;;KAChD;IACH,wBAAC;AAAD,CAAC,AAxLD,IAwLC"}
|
package/dist/browser.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AxeResults, SerialContextObject, FrameContext, RunOptions, Spec } from 'axe-core';
|
|
2
|
-
import { WebDriver, WebElement } from 'selenium-webdriver';
|
|
3
|
-
declare type FrameContextWeb = FrameContext & {
|
|
4
|
-
frame: WebElement;
|
|
5
|
-
href: string;
|
|
6
|
-
};
|
|
7
|
-
export declare function axeSourceInject(driver: WebDriver, axeSource: string, config: Spec | null): Promise<{
|
|
8
|
-
runPartialSupported: boolean;
|
|
9
|
-
}>;
|
|
10
|
-
export declare function axeRunPartial(driver: WebDriver, context: SerialContextObject, options: RunOptions): Promise<string>;
|
|
11
|
-
export declare function axeFinishRun(driver: WebDriver, axeSource: string, config: Spec | null, partialResults: Array<string>, options: RunOptions): Promise<AxeResults>;
|
|
12
|
-
export declare function axeGetFrameContext(driver: WebDriver, context: SerialContextObject): Promise<FrameContextWeb[]>;
|
|
13
|
-
export declare function axeRunLegacy(driver: WebDriver, context: SerialContextObject, options: RunOptions, config: Spec | null): Promise<AxeResults>;
|
|
14
|
-
export {};
|
package/dist/browser.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.axeRunLegacy = exports.axeGetFrameContext = exports.axeFinishRun = exports.axeRunPartial = exports.axeSourceInject = void 0;
|
|
4
|
-
// https://github.com/vercel/pkg/issues/676
|
|
5
|
-
// we need to pass a string vs a function so we manually stringified the function
|
|
6
|
-
// There are no try/catch blocks needed in these scripts. If an error occurs
|
|
7
|
-
// Selenium pass them onto the catch block.
|
|
8
|
-
function axeSourceInject(driver, axeSource, config) {
|
|
9
|
-
return promisify(driver.executeScript("\n ".concat(axeSource, ";\n window.axe.configure({\n branding: { application: 'webdriverjs' }\n });\n var config = ").concat(JSON.stringify(config), ";\n if (config) {\n window.axe.configure(config);\n }\n var runPartial = typeof window.axe.runPartial === 'function';\n return { runPartialSupported: runPartial };\n ")));
|
|
10
|
-
}
|
|
11
|
-
exports.axeSourceInject = axeSourceInject;
|
|
12
|
-
function axeRunPartial(driver, context, options) {
|
|
13
|
-
return promisify(driver.executeAsyncScript("\n var callback = arguments[arguments.length - 1];\n var context = ".concat(JSON.stringify(context), " || document;\n var options = ").concat(JSON.stringify(options), " || {};\n window.axe.runPartial(context, options).then(res => JSON.stringify(res)).then(callback);\n ")));
|
|
14
|
-
}
|
|
15
|
-
exports.axeRunPartial = axeRunPartial;
|
|
16
|
-
function axeFinishRun(driver, axeSource, config, partialResults, options) {
|
|
17
|
-
// executeScript has a size limit of ~32 million characters so we'll need
|
|
18
|
-
// to split partialResults into chunks if it exceeds that limit.
|
|
19
|
-
// since we need to stringify twice we need to leave room for the double escaped quotes
|
|
20
|
-
var sizeLimit = 15000000;
|
|
21
|
-
var partialString = JSON.stringify(partialResults);
|
|
22
|
-
function chunkResults(result) {
|
|
23
|
-
var chunk = JSON.stringify(result.substring(0, sizeLimit));
|
|
24
|
-
return promisify(driver.executeScript("\n window.partialResults ??= '';\n window.partialResults += ".concat(chunk, ";\n "))).then(function () {
|
|
25
|
-
if (result.length > sizeLimit) {
|
|
26
|
-
return chunkResults(result.substr(sizeLimit));
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
// Inject source and configuration a second time with a mock "this" context,
|
|
31
|
-
// to make it impossible to sniff the global window.axe for results.
|
|
32
|
-
return chunkResults(partialString)
|
|
33
|
-
.then(function () {
|
|
34
|
-
return promisify(driver.executeAsyncScript("\n var callback = arguments[arguments.length - 1];\n\n ".concat(axeSource, ";\n window.axe.configure({\n branding: { application: 'webdriverjs' }\n });\n var config = ").concat(JSON.stringify(config), ";\n if (config) {\n window.axe.configure(config);\n }\n\n var partialResults = JSON.parse(window.partialResults).map(res => JSON.parse(res));\n var options = ").concat(JSON.stringify(options || {}), ";\n window.axe.finishRun(partialResults, options).then(res => JSON.stringify(res)).then(callback);\n ")));
|
|
35
|
-
})
|
|
36
|
-
.then(function (res) { return JSON.parse(res); });
|
|
37
|
-
}
|
|
38
|
-
exports.axeFinishRun = axeFinishRun;
|
|
39
|
-
function axeGetFrameContext(driver, context) {
|
|
40
|
-
return promisify(driver.executeScript("\n var context = ".concat(JSON.stringify(context), "\n var frameContexts = window.axe.utils.getFrameContexts(context);\n return frameContexts.map(function (frameContext) {\n return Object.assign(frameContext, {\n href: window.location.href, // For debugging\n frame: axe.utils.shadowSelect(frameContext.frameSelector)\n });\n });\n ")));
|
|
41
|
-
}
|
|
42
|
-
exports.axeGetFrameContext = axeGetFrameContext;
|
|
43
|
-
function axeRunLegacy(driver, context, options, config) {
|
|
44
|
-
// https://github.com/vercel/pkg/issues/676
|
|
45
|
-
// we need to pass a string vs a function so we manually stringified the function
|
|
46
|
-
return promisify(driver
|
|
47
|
-
.executeAsyncScript("\n var callback = arguments[arguments.length - 1];\n var context = ".concat(JSON.stringify(context), " || document;\n var options = ").concat(JSON.stringify(options), " || {};\n var config = ").concat(JSON.stringify(config), " || null;\n if (config) {\n window.axe.configure(config);\n }\n window.axe.run(context, options).then(res => JSON.stringify(res)).then(callback);\n "))
|
|
48
|
-
.then(function (res) { return JSON.parse(res); }));
|
|
49
|
-
}
|
|
50
|
-
exports.axeRunLegacy = axeRunLegacy;
|
|
51
|
-
/**
|
|
52
|
-
* Selenium-webdriver thenable aren't chainable. This fixes it.
|
|
53
|
-
*/
|
|
54
|
-
function promisify(thenable) {
|
|
55
|
-
return new Promise(function (resolve, reject) {
|
|
56
|
-
thenable.then(resolve, reject);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=browser.js.map
|
package/dist/browser.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":";;;AAeA,2CAA2C;AAC3C,iFAAiF;AACjF,4EAA4E;AAC5E,2CAA2C;AAE3C,SAAgB,eAAe,CAC7B,MAAiB,EACjB,SAAiB,EACjB,MAAmB;IAEnB,OAAO,SAAS,CACd,MAAM,CAAC,aAAa,CAAmC,kBACnD,SAAS,8HAII,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,yMAMtC,CAAC,CACH,CAAC;AACJ,CAAC;AAnBD,0CAmBC;AAED,SAAgB,aAAa,CAC3B,MAAiB,EACjB,OAA4B,EAC5B,OAAmB;IAEnB,OAAO,SAAS,CACd,MAAM,CAAC,kBAAkB,CAAS,uFAEhB,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A+E,OAAK,CAAE,CACvF,CAAC;4BAGQ,qBAAM,IAAA,sBAAY,EAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAA;;wBAArE,GAAG,GAAG,SAA+D;wBAC3E,qBAAM,MAAM,CAAC,KAAK,EAAE,EAAA;;wBAApB,SAAoB,CAAC;wBACrB,qBAAM,MAAM,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAA;;wBAAnC,SAAmC,CAAC;wBACpC,sBAAO,GAAG,EAAC;;;;KACZ;IACH,iBAAC;AAAD,CAAC,AArPD,IAqPC;AAED,OAAO,GAAG,MAAM,CAAC,OAAO,GAAG,UAAU,CAAC;AAEtC,kBAAe,UAAU,CAAC"}
|
package/dist/types.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { WebDriver } from 'selenium-webdriver';
|
|
2
|
-
import type { Spec, AxeResults, BaseSelector } from 'axe-core';
|
|
3
|
-
import axe from 'axe-core';
|
|
4
|
-
export interface Options {
|
|
5
|
-
driver: WebDriver;
|
|
6
|
-
axeSource?: string;
|
|
7
|
-
builderOptions?: BuilderOptions;
|
|
8
|
-
}
|
|
9
|
-
export interface BuilderOptions {
|
|
10
|
-
noSandbox?: boolean;
|
|
11
|
-
logIframeErrors?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export interface AxeInjectorParams extends Options {
|
|
14
|
-
config?: Spec | null;
|
|
15
|
-
}
|
|
16
|
-
export declare type CallbackFunction = (error: Error | null, results: AxeResults | null) => void;
|
|
17
|
-
export declare type InjectCallback = (err?: Error) => void;
|
|
18
|
-
export declare type PartialResults = Parameters<typeof axe.finishRun>[0];
|
|
19
|
-
export declare type Selector = BaseSelector | BaseSelector[];
|
package/dist/types.js
DELETED
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/dist/utils/index.d.ts
DELETED
package/dist/utils/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeContext = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Get running context
|
|
6
|
-
*/
|
|
7
|
-
var normalizeContext = function (include, exclude) {
|
|
8
|
-
var _a;
|
|
9
|
-
var base = {
|
|
10
|
-
exclude: []
|
|
11
|
-
};
|
|
12
|
-
if (exclude.length && Array.isArray(base.exclude)) {
|
|
13
|
-
(_a = base.exclude).push.apply(_a, exclude);
|
|
14
|
-
}
|
|
15
|
-
if (include.length) {
|
|
16
|
-
base.include = include;
|
|
17
|
-
}
|
|
18
|
-
return base;
|
|
19
|
-
};
|
|
20
|
-
exports.normalizeContext = normalizeContext;
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACI,IAAM,gBAAgB,GAAG,UAC9B,OAA2B,EAC3B,OAA2B;;IAE3B,IAAM,IAAI,GAAwB;QAChC,OAAO,EAAE,EAAE;KACZ,CAAC;IACF,IAAI,OAAO,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QACjD,CAAA,KAAA,IAAI,CAAC,OAAO,CAAA,CAAC,IAAI,WAAI,OAAO,EAAE;KAC/B;IACD,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;KACxB;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAdW,QAAA,gBAAgB,oBAc3B"}
|