1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "urls": [
12 "https://getbootstrap.com/",
13 "https://jquery.com/"
14 ],
15 "allowedScriptOrigins": [
16 "code.jquery.com",
17 "cdn.jsdelivr.net",
18 "cdnjs.cloudflare.com",
19 "unpkg.com"
20 ],
21 "integrityPolicy": "required",
22 "allowedHashAlgorithms": [
23 "sha384",
24 "sha512"
25 ],
26 "requireCrossorigin": true,
27 "mutablePathTokens": [
28 "latest",
29 "main",
30 "master",
31 "next",
32 "canary",
33 "beta",
34 "edge",
35 "dev",
36 "current",
37 "stable",
38 "nightly",
39 "head"
40 ],
41 "rejectBareMajorVersion": true,
42 "checks": [
43 "https_scheme",
44 "origin_allowlist",
45 "integrity_present",
46 "integrity_algorithm",
47 "crossorigin_attribute",
48 "immutable_path",
49 "content_drift"
50 ],
51 "includeSameOrigin": false,
52 "hashAssets": true,
53 "maxAssetsPerPage": 40,
54 "maxAssets": 200,
55 "maxAssetBytes": 2097152,
56 "maxHtmlBytes": 2097152,
57 "maxRedirects": 5,
58 "timeoutSeconds": 20,
59 "concurrency": 4,
60 "stateStoreName": "script-asset-hashes",
61 "updateState": true,
62 "userAgent": "ScriptIntegrityPinGate/0.1 (+https://apify.com)"
63};
64
65
66const run = await client.actor("kingii98/third-party-script-integrity-pin-and-content-drift-gate").call(input);
67
68
69console.log('Results from dataset');
70console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
71const { items } = await client.dataset(run.defaultDatasetId).listItems();
72items.forEach((item) => {
73 console.dir(item);
74});
75
76