@siteimprove/alfa-puppeteer 0.78.2 → 0.79.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @siteimprove/alfa-puppeteer
2
2
 
3
+ ## 0.79.1
4
+
5
+ ### Patch Changes
6
+
7
+ - **Changed:** Update Alfa to 0.103.0. ([#148](https://github.com/Siteimprove/alfa-integrations/pull/148))
8
+
9
+ ## 0.79.0
10
+
11
+ ### Minor Changes
12
+
13
+ - **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))
14
+
15
+ ### Patch Changes
16
+
17
+ - **Changed:** Update Alfa to 0.102.0. ([#146](https://github.com/Siteimprove/alfa-integrations/pull/146))
18
+
3
19
  ## 0.78.2
4
20
 
5
21
  ### Patch Changes
@@ -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.78.2",
5
+ "version": "0.79.1",
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.101.0",
26
- "@siteimprove/alfa-dom": "^0.101.0",
27
- "@siteimprove/alfa-http": "^0.101.0",
28
- "@siteimprove/alfa-url": "^0.101.0",
29
- "@siteimprove/alfa-web": "^0.101.0",
25
+ "@siteimprove/alfa-device": "^0.103.0",
26
+ "@siteimprove/alfa-dom": "^0.103.0",
27
+ "@siteimprove/alfa-http": "^0.103.0",
28
+ "@siteimprove/alfa-url": "^0.103.0",
29
+ "@siteimprove/alfa-web": "^0.103.0",
30
30
  "puppeteer": "^24.1.1"
31
31
  },
32
32
  "peerDependencies": {
33
- "@siteimprove/alfa-device": "^0.101.0",
34
- "@siteimprove/alfa-dom": "^0.101.0",
35
- "@siteimprove/alfa-http": "^0.101.0",
36
- "@siteimprove/alfa-url": "^0.101.0",
37
- "@siteimprove/alfa-web": "^0.101.0",
33
+ "@siteimprove/alfa-device": "^0.103.0",
34
+ "@siteimprove/alfa-dom": "^0.103.0",
35
+ "@siteimprove/alfa-http": "^0.103.0",
36
+ "@siteimprove/alfa-url": "^0.103.0",
37
+ "@siteimprove/alfa-web": "^0.103.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.101.0"
45
+ "@siteimprove/alfa-test-deprecated": "^0.103.0"
46
46
  }
47
47
  }