@siteimprove/alfa-puppeteer 0.78.2 → 0.79.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/CHANGELOG.md +10 -0
- package/dist/puppeteer.d.ts +3 -2
- package/dist/puppeteer.js +5 -4
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @siteimprove/alfa-puppeteer
|
|
2
2
|
|
|
3
|
+
## 0.79.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- **Added:** `.toPage`, `.toNode`, or `#scrape` now accept a `dom.Native.Options` parameter; currently to enforce anonymous cross-origin on `<link>` elements before scraping the page. CLI now accepts a `--enforce-anonymous-cross-origin` flag to enforce this behavior. ([#144](https://github.com/Siteimprove/alfa-integrations/pull/144))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- **Changed:** Update Alfa to 0.102.0. ([#146](https://github.com/Siteimprove/alfa-integrations/pull/146))
|
|
12
|
+
|
|
3
13
|
## 0.78.2
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/puppeteer.d.ts
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
import { Device } from "@siteimprove/alfa-device";
|
|
3
3
|
import { Node } from "@siteimprove/alfa-dom";
|
|
4
4
|
import { Page } from "@siteimprove/alfa-web";
|
|
5
|
+
import * as dom from "@siteimprove/alfa-dom/native";
|
|
5
6
|
import type { JSHandle } from "puppeteer";
|
|
6
7
|
/**
|
|
7
8
|
* @public
|
|
8
9
|
*/
|
|
9
10
|
export declare namespace Puppeteer {
|
|
10
11
|
type Type = JSHandle<globalThis.Node>;
|
|
11
|
-
function toNode(value: Type, device?: Device): Promise<Node>;
|
|
12
|
-
function toPage(value: Type): Promise<Page>;
|
|
12
|
+
function toNode(value: Type, device?: Device, options?: dom.Native.Options): Promise<Node>;
|
|
13
|
+
function toPage(value: Type, options?: dom.Native.Options): Promise<Page>;
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=puppeteer.d.ts.map
|
package/dist/puppeteer.js
CHANGED
|
@@ -11,12 +11,12 @@ import * as dom from "@siteimprove/alfa-dom/native";
|
|
|
11
11
|
*/
|
|
12
12
|
export var Puppeteer;
|
|
13
13
|
(function (Puppeteer) {
|
|
14
|
-
async function toNode(value, device) {
|
|
15
|
-
return Node.from(await value.evaluate(dom.Native.fromNode), device);
|
|
14
|
+
async function toNode(value, device, options) {
|
|
15
|
+
return Node.from(await value.evaluate(dom.Native.fromNode, options), device);
|
|
16
16
|
}
|
|
17
17
|
Puppeteer.toNode = toNode;
|
|
18
|
-
async function toPage(value) {
|
|
19
|
-
const nodeJSON = await value.evaluate(dom.Native.fromNode);
|
|
18
|
+
async function toPage(value, options) {
|
|
19
|
+
const nodeJSON = await value.evaluate(dom.Native.fromNode, options);
|
|
20
20
|
const deviceJSON = await value
|
|
21
21
|
.evaluateHandle(() => window)
|
|
22
22
|
.then((handle) => handle.evaluate(device.Native.fromWindow));
|
|
@@ -40,6 +40,7 @@ export var Puppeteer;
|
|
|
40
40
|
const response = Response.of(url, 200, Headers.of([Header.of("Content-Type", "text/html")]));
|
|
41
41
|
const pageDevice = Device.from(deviceJSON);
|
|
42
42
|
return Page.of(request, response, nodeJSON.type === "document"
|
|
43
|
+
// The type is ensured by the previous test.
|
|
43
44
|
? Document.from(nodeJSON, pageDevice)
|
|
44
45
|
: Document.of([Node.from(nodeJSON, pageDevice)]), pageDevice);
|
|
45
46
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "http://json.schemastore.org/package",
|
|
3
3
|
"name": "@siteimprove/alfa-puppeteer",
|
|
4
4
|
"homepage": "https://alfa.siteimprove.com",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.79.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "Integrations and utilities for the Puppeteer browser automation library",
|
|
8
8
|
"repository": {
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
"dist/**/*.d.ts"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@siteimprove/alfa-device": "^0.
|
|
26
|
-
"@siteimprove/alfa-dom": "^0.
|
|
27
|
-
"@siteimprove/alfa-http": "^0.
|
|
28
|
-
"@siteimprove/alfa-url": "^0.
|
|
29
|
-
"@siteimprove/alfa-web": "^0.
|
|
25
|
+
"@siteimprove/alfa-device": "^0.102.0",
|
|
26
|
+
"@siteimprove/alfa-dom": "^0.102.0",
|
|
27
|
+
"@siteimprove/alfa-http": "^0.102.0",
|
|
28
|
+
"@siteimprove/alfa-url": "^0.102.0",
|
|
29
|
+
"@siteimprove/alfa-web": "^0.102.0",
|
|
30
30
|
"puppeteer": "^24.1.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@siteimprove/alfa-device": "^0.
|
|
34
|
-
"@siteimprove/alfa-dom": "^0.
|
|
35
|
-
"@siteimprove/alfa-http": "^0.
|
|
36
|
-
"@siteimprove/alfa-url": "^0.
|
|
37
|
-
"@siteimprove/alfa-web": "^0.
|
|
33
|
+
"@siteimprove/alfa-device": "^0.102.0",
|
|
34
|
+
"@siteimprove/alfa-dom": "^0.102.0",
|
|
35
|
+
"@siteimprove/alfa-http": "^0.102.0",
|
|
36
|
+
"@siteimprove/alfa-url": "^0.102.0",
|
|
37
|
+
"@siteimprove/alfa-web": "^0.102.0",
|
|
38
38
|
"puppeteer": "^24.0.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
"registry": "https://npm.pkg.github.com/"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@siteimprove/alfa-test-deprecated": "^0.
|
|
45
|
+
"@siteimprove/alfa-test-deprecated": "^0.102.0"
|
|
46
46
|
}
|
|
47
47
|
}
|