@google-psat/analysis-utils 0.9.0-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/.eslintrc.json +7 -0
- package/README.md +4 -0
- package/dist/browserManagement/collateCookieData.js +35 -0
- package/dist/browserManagement/collateCookieData.js.map +1 -0
- package/dist/browserManagement/index.js +532 -0
- package/dist/browserManagement/index.js.map +1 -0
- package/dist/browserManagement/parseNetworkDataToCookieData.js +187 -0
- package/dist/browserManagement/parseNetworkDataToCookieData.js.map +1 -0
- package/dist/browserManagement/types.js +18 -0
- package/dist/browserManagement/types.js.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/procedures/analyzeCookiesUrlsAndFetchResources.js +71 -0
- package/dist/procedures/analyzeCookiesUrlsAndFetchResources.js.map +1 -0
- package/dist/procedures/analyzeCookiesUrlsInBatchesAndFetchResources.js +54 -0
- package/dist/procedures/analyzeCookiesUrlsInBatchesAndFetchResources.js.map +1 -0
- package/dist/procedures/analyzeTechnologiesUrlsInBatches.js +64 -0
- package/dist/procedures/analyzeTechnologiesUrlsInBatches.js.map +1 -0
- package/dist/procedures/index.js +25 -0
- package/dist/procedures/index.js.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist-types/browserManagement/collateCookieData.d.ts +11 -0
- package/dist-types/browserManagement/index.d.ts +53 -0
- package/dist-types/browserManagement/parseNetworkDataToCookieData.d.ts +6 -0
- package/dist-types/browserManagement/types.d.ts +37 -0
- package/dist-types/index.d.ts +1 -0
- package/dist-types/procedures/analyzeCookiesUrlsAndFetchResources.d.ts +10 -0
- package/dist-types/procedures/analyzeCookiesUrlsInBatchesAndFetchResources.d.ts +29 -0
- package/dist-types/procedures/analyzeTechnologiesUrlsInBatches.d.ts +14 -0
- package/dist-types/procedures/index.d.ts +3 -0
- package/dist-types/types.d.ts +80 -0
- package/package.json +49 -0
- package/tsconfig.json +16 -0
package/.eslintrc.json
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Collate network and JS cookie data.
|
|
5
|
+
* @param cookieDataFromNetwork Cookie data from network.
|
|
6
|
+
* @param cookieDataFromJS cookie data from JS.
|
|
7
|
+
* @returns cookieDataFromNetwork Cookie data from network and JS if it exits.
|
|
8
|
+
*/
|
|
9
|
+
function collateCookieData(cookieDataFromNetwork, cookieDataFromJS) {
|
|
10
|
+
Object.entries(cookieDataFromJS).forEach(([frameUrl, { frameCookies }]) => {
|
|
11
|
+
Object.entries(frameCookies).forEach(([key, cookie]) => {
|
|
12
|
+
// Check if the frame's data exists. if not create frame data object
|
|
13
|
+
if (!cookieDataFromNetwork[frameUrl]) {
|
|
14
|
+
cookieDataFromNetwork[frameUrl] = {
|
|
15
|
+
frameCookies: {
|
|
16
|
+
[key]: {
|
|
17
|
+
parsedCookie: cookie.parsedCookie,
|
|
18
|
+
headerType: 'javascript',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
// Check if the cookie's data exists. if not add cookie data object to frame cookies. Otherwise cookie data from network stream will be used.
|
|
24
|
+
else if (!cookieDataFromNetwork[frameUrl].frameCookies[key]) {
|
|
25
|
+
cookieDataFromNetwork[frameUrl].frameCookies[key] = {
|
|
26
|
+
parsedCookie: cookie.parsedCookie,
|
|
27
|
+
headerType: 'javascript',
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
return cookieDataFromNetwork;
|
|
33
|
+
}
|
|
34
|
+
exports.default = collateCookieData;
|
|
35
|
+
//# sourceMappingURL=collateCookieData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collateCookieData.js","sourceRoot":"","sources":["../../src/browserManagement/collateCookieData.ts"],"names":[],"mappings":";;AAoBA;;;;;GAKG;AACH,SAAwB,iBAAiB,CACvC,qBAA4C,EAC5C,gBAAuC;IAEvC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE;QACxE,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE;YACrD,qEAAqE;YACrE,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACrC,qBAAqB,CAAC,QAAQ,CAAC,GAAG;oBAChC,YAAY,EAAE;wBACZ,CAAC,GAAG,CAAC,EAAE;4BACL,YAAY,EAAE,MAAM,CAAC,YAAY;4BACjC,UAAU,EAAE,YAAY;yBACzB;qBACF;iBACF,CAAC;YACJ,CAAC;YACD,6IAA6I;iBACxI,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC5D,qBAAqB,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG;oBAClD,YAAY,EAAE,MAAM,CAAC,YAAY;oBACjC,UAAU,EAAE,YAAY;iBACzB,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AA5BD,oCA4BC"}
|
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2023 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.BrowserManagement = void 0;
|
|
31
|
+
/**
|
|
32
|
+
* External dependencies.
|
|
33
|
+
*/
|
|
34
|
+
const puppeteer_1 = __importDefault(require("puppeteer"));
|
|
35
|
+
const simple_cookie_1 = require("simple-cookie");
|
|
36
|
+
const common_1 = require("@google-psat/common");
|
|
37
|
+
const parseNetworkDataToCookieData_1 = require("./parseNetworkDataToCookieData");
|
|
38
|
+
const collateCookieData_1 = __importDefault(require("./collateCookieData"));
|
|
39
|
+
class BrowserManagement {
|
|
40
|
+
constructor(viewportConfig, isHeadless, pageWaitTime, shouldLogDebug) {
|
|
41
|
+
this.viewportConfig = viewportConfig;
|
|
42
|
+
this.browser = null;
|
|
43
|
+
this.isHeadless = isHeadless;
|
|
44
|
+
this.pageWaitTime = pageWaitTime;
|
|
45
|
+
this.pages = {};
|
|
46
|
+
this.pageFrames = {};
|
|
47
|
+
this.pageResponses = {};
|
|
48
|
+
this.pageRequests = {};
|
|
49
|
+
this.shouldLogDebug = shouldLogDebug;
|
|
50
|
+
this.pageResourcesMaps = {};
|
|
51
|
+
}
|
|
52
|
+
debugLog(msg) {
|
|
53
|
+
if (this.shouldLogDebug) {
|
|
54
|
+
console.log(msg);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
initializeBrowser(enable3pCookiePhaseout) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
const args = [];
|
|
60
|
+
if (enable3pCookiePhaseout) {
|
|
61
|
+
args.push('--test-third-party-cookie-phaseout');
|
|
62
|
+
args.push('--enable-features="FirstPartySets,StorageAccessAPI,StorageAccessAPIForOriginExtension,PageInfoCookiesSubpage,PrivacySandboxFirstPartySetsUI,TpcdMetadataGrants,TpcdSupportSettings,TpcdHeuristicsGrants:TpcdReadHeuristicsGrants/true/TpcdWritePopupCurrentInteractionHeuristicsGrants/30d/TpcdBackfillPopupHeuristicsGrants/30d/TpcdPopupHeuristicEnableForIframeInitiator/all/TpcdWriteRedirectHeuristicGrants/15m/TpcdRedirectHeuristicRequireABAFlow/true/TpcdRedirectHeuristicRequireCurrentInteraction/true"');
|
|
63
|
+
}
|
|
64
|
+
this.browser = yield puppeteer_1.default.launch({
|
|
65
|
+
devtools: true,
|
|
66
|
+
headless: this.isHeadless,
|
|
67
|
+
args,
|
|
68
|
+
});
|
|
69
|
+
this.debugLog('browser intialized');
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
clickOnAcceptBanner(url) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
const page = this.pages[url];
|
|
75
|
+
if (!page) {
|
|
76
|
+
throw new Error('no page with the provided id was found');
|
|
77
|
+
}
|
|
78
|
+
yield page.evaluate(() => {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
const bannerNodes = Array.from((((_a = document.querySelector('body')) === null || _a === void 0 ? void 0 : _a.childNodes) || []))
|
|
81
|
+
.filter((node) => node && (node === null || node === void 0 ? void 0 : node.tagName) === 'DIV')
|
|
82
|
+
.filter((node) => {
|
|
83
|
+
if (!node || !(node === null || node === void 0 ? void 0 : node.textContent)) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
const regex = /\b(consent|policy|cookie policy|privacy policy|personalize|preferences)\b/;
|
|
87
|
+
return regex.test(node.textContent.toLowerCase());
|
|
88
|
+
});
|
|
89
|
+
const buttonToClick = bannerNodes
|
|
90
|
+
.map((node) => {
|
|
91
|
+
const buttonNodes = Array.from(node.getElementsByTagName('button'));
|
|
92
|
+
const isButtonForAccept = buttonNodes.filter((cnode) => cnode.textContent &&
|
|
93
|
+
(cnode.textContent.toLowerCase().includes('accept') ||
|
|
94
|
+
cnode.textContent.toLowerCase().includes('allow') ||
|
|
95
|
+
cnode.textContent.toLowerCase().includes('agree')));
|
|
96
|
+
return isButtonForAccept[0];
|
|
97
|
+
})
|
|
98
|
+
.filter((button) => button);
|
|
99
|
+
(_b = buttonToClick[0]) === null || _b === void 0 ? void 0 : _b.click();
|
|
100
|
+
});
|
|
101
|
+
yield (0, common_1.delay)(this.pageWaitTime / 2);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
openPage() {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
if (!this.browser) {
|
|
107
|
+
throw new Error('Browser not intialized');
|
|
108
|
+
}
|
|
109
|
+
const sitePage = yield this.browser.newPage();
|
|
110
|
+
yield sitePage.setUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36');
|
|
111
|
+
sitePage.setViewport({
|
|
112
|
+
width: 1440,
|
|
113
|
+
height: 790,
|
|
114
|
+
deviceScaleFactor: 1,
|
|
115
|
+
});
|
|
116
|
+
this.debugLog('Page opened');
|
|
117
|
+
return sitePage;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
navigateToPage(url) {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
const page = this.pages[url];
|
|
123
|
+
if (!page) {
|
|
124
|
+
throw new Error('no page with the provided id was found');
|
|
125
|
+
}
|
|
126
|
+
this.debugLog(`starting navigation to url ${url}`);
|
|
127
|
+
try {
|
|
128
|
+
yield page.goto(url, { timeout: 10000 });
|
|
129
|
+
this.debugLog(`done with navigation to url:${url}`);
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
this.debugLog(`navigation did not finish in 10 seconds moving on to scrolling`);
|
|
133
|
+
//ignore
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
pageScroll(url) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
const page = this.pages[url];
|
|
140
|
+
if (!page) {
|
|
141
|
+
throw new Error('no page with the provided id was found');
|
|
142
|
+
}
|
|
143
|
+
try {
|
|
144
|
+
yield page.evaluate(() => {
|
|
145
|
+
window.scrollBy(0, 10000);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
this.debugLog(`scrolling the page to the end.`);
|
|
150
|
+
//ignore
|
|
151
|
+
}
|
|
152
|
+
this.debugLog(`scrolling on url:${url}`);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
responseEventListener(pageId, response) {
|
|
156
|
+
var _a, _b, _c, _d;
|
|
157
|
+
if (((_b = (_a = response === null || response === void 0 ? void 0 : response.headers()) === null || _a === void 0 ? void 0 : _a['content-type']) === null || _b === void 0 ? void 0 : _b.includes('javascript')) ||
|
|
158
|
+
((_d = (_c = response === null || response === void 0 ? void 0 : response.headers()) === null || _c === void 0 ? void 0 : _c['content-type']) === null || _d === void 0 ? void 0 : _d.includes('html'))) {
|
|
159
|
+
response
|
|
160
|
+
.text()
|
|
161
|
+
.then((content) => {
|
|
162
|
+
var _a, _b;
|
|
163
|
+
this.pageResourcesMaps[pageId][response.url()] = {
|
|
164
|
+
origin: response.url(),
|
|
165
|
+
type: ((_b = (_a = response === null || response === void 0 ? void 0 : response.headers()) === null || _a === void 0 ? void 0 : _a['content-type']) === null || _b === void 0 ? void 0 : _b.includes('javascript'))
|
|
166
|
+
? 'Script'
|
|
167
|
+
: 'Document',
|
|
168
|
+
content,
|
|
169
|
+
};
|
|
170
|
+
})
|
|
171
|
+
.catch(() => undefined);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
responseReceivedListener(pageId, { requestId, frameId, response }) {
|
|
175
|
+
var _a, _b;
|
|
176
|
+
if (!this.pageResponses[pageId][requestId]) {
|
|
177
|
+
this.pageResponses[pageId][requestId] = {
|
|
178
|
+
frameId,
|
|
179
|
+
url: response.url,
|
|
180
|
+
cookies: [],
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
const parsedCookies = (_a = this.pageResponses[pageId][requestId]) === null || _a === void 0 ? void 0 : _a.cookies.map((cookie) => {
|
|
185
|
+
if (!cookie.url) {
|
|
186
|
+
cookie.url = response.url;
|
|
187
|
+
}
|
|
188
|
+
if (!cookie.parsedCookie.domain) {
|
|
189
|
+
cookie.parsedCookie.domain = new URL(response.url).hostname;
|
|
190
|
+
}
|
|
191
|
+
if (cookie.parsedCookie.domain[0] !== '.') {
|
|
192
|
+
cookie.parsedCookie.domain = '.' + cookie.parsedCookie.domain;
|
|
193
|
+
}
|
|
194
|
+
return cookie;
|
|
195
|
+
});
|
|
196
|
+
(_b = this.pageResponses[pageId][requestId]) === null || _b === void 0 ? void 0 : _b.cookies.forEach((cookie) => {
|
|
197
|
+
var _a;
|
|
198
|
+
(_a = cookie.networkEvents) === null || _a === void 0 ? void 0 : _a.responseEvents.map((event) => {
|
|
199
|
+
if (event.requestId === requestId) {
|
|
200
|
+
event.url = response.url;
|
|
201
|
+
}
|
|
202
|
+
return event;
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
this.pageResponses[pageId][requestId] = {
|
|
206
|
+
frameId,
|
|
207
|
+
url: response.url,
|
|
208
|
+
cookies: parsedCookies,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
responseReceivedExtraInfoListener(pageId, { headers, cookiePartitionKey, blockedCookies, requestId, exemptedCookies, }) {
|
|
213
|
+
var _a, _b, _c, _d;
|
|
214
|
+
const headersToBeParsed = (_a = headers['set-cookie']) !== null && _a !== void 0 ? _a : headers['Set-Cookie'];
|
|
215
|
+
if (!headersToBeParsed) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const cookies = headersToBeParsed
|
|
219
|
+
.split('\n')
|
|
220
|
+
.map((headerLine) => {
|
|
221
|
+
var _a;
|
|
222
|
+
const parsedCookie = (0, simple_cookie_1.parse)(headerLine);
|
|
223
|
+
const partitionKey = headerLine.includes('Partitioned')
|
|
224
|
+
? cookiePartitionKey
|
|
225
|
+
: undefined;
|
|
226
|
+
const url = (_a = this.pageResponses[pageId][requestId]) === null || _a === void 0 ? void 0 : _a.url;
|
|
227
|
+
if (!parsedCookie.domain && url) {
|
|
228
|
+
parsedCookie.domain = new URL(url).hostname;
|
|
229
|
+
}
|
|
230
|
+
if (parsedCookie.domain && parsedCookie.domain[0] !== '.') {
|
|
231
|
+
parsedCookie.domain = '.' + parsedCookie.domain;
|
|
232
|
+
}
|
|
233
|
+
const exemptedEntry = exemptedCookies === null || exemptedCookies === void 0 ? void 0 : exemptedCookies.find(({ cookie }) => {
|
|
234
|
+
return (cookie === null || cookie === void 0 ? void 0 : cookie.name) === parsedCookie.name;
|
|
235
|
+
});
|
|
236
|
+
const blockedEntry = blockedCookies.find((c) => {
|
|
237
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
238
|
+
if (c.cookie) {
|
|
239
|
+
return (((_b = (_a = c.cookie) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.trim()) === ((_c = parsedCookie.name) === null || _c === void 0 ? void 0 : _c.trim()) &&
|
|
240
|
+
((_d = c.cookie.domain) === null || _d === void 0 ? void 0 : _d.trim()) === ((_e = parsedCookie.domain) === null || _e === void 0 ? void 0 : _e.trim()) &&
|
|
241
|
+
((_f = c.cookie.path) === null || _f === void 0 ? void 0 : _f.trim()) === ((_g = parsedCookie.path) === null || _g === void 0 ? void 0 : _g.trim()));
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
const temporaryParsedCookie = (0, simple_cookie_1.parse)(c.cookieLine);
|
|
245
|
+
return (((_h = temporaryParsedCookie.name) === null || _h === void 0 ? void 0 : _h.trim()) ===
|
|
246
|
+
((_j = parsedCookie.name) === null || _j === void 0 ? void 0 : _j.trim()) &&
|
|
247
|
+
((_k = temporaryParsedCookie.domain) === null || _k === void 0 ? void 0 : _k.trim()) ===
|
|
248
|
+
((_l = parsedCookie.domain) === null || _l === void 0 ? void 0 : _l.trim()) &&
|
|
249
|
+
((_m = temporaryParsedCookie.path) === null || _m === void 0 ? void 0 : _m.trim()) === ((_o = parsedCookie.path) === null || _o === void 0 ? void 0 : _o.trim()));
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
return {
|
|
253
|
+
parsedCookie: {
|
|
254
|
+
name: parsedCookie.name,
|
|
255
|
+
domain: parsedCookie.domain,
|
|
256
|
+
path: parsedCookie.path || '/',
|
|
257
|
+
value: parsedCookie.value,
|
|
258
|
+
sameSite: parsedCookie.samesite || 'Lax',
|
|
259
|
+
expires: parsedCookie.expires || 'Session',
|
|
260
|
+
httpOnly: parsedCookie.httponly || false,
|
|
261
|
+
secure: parsedCookie.secure || false,
|
|
262
|
+
partitionKey,
|
|
263
|
+
},
|
|
264
|
+
networkEvents: {
|
|
265
|
+
responseEvents: [
|
|
266
|
+
{
|
|
267
|
+
type: common_1.RESPONSE_EVENT.CDP_RESPONSE_RECEIVED_EXTRA_INFO,
|
|
268
|
+
requestId,
|
|
269
|
+
url,
|
|
270
|
+
blocked: Boolean(blockedEntry),
|
|
271
|
+
timeStamp: Date.now(),
|
|
272
|
+
},
|
|
273
|
+
],
|
|
274
|
+
requestEvents: [],
|
|
275
|
+
},
|
|
276
|
+
isBlocked: Boolean(blockedEntry),
|
|
277
|
+
blockedReasons: blockedEntry === null || blockedEntry === void 0 ? void 0 : blockedEntry.blockedReasons,
|
|
278
|
+
exemptionReason: exemptedEntry === null || exemptedEntry === void 0 ? void 0 : exemptedEntry.exemptionReason,
|
|
279
|
+
url,
|
|
280
|
+
headerType: 'response',
|
|
281
|
+
};
|
|
282
|
+
});
|
|
283
|
+
const prevCookies = ((_b = this.pageResponses[pageId][requestId]) === null || _b === void 0 ? void 0 : _b.cookies) || [];
|
|
284
|
+
const mergedCookies = [...prevCookies, ...(cookies || [])];
|
|
285
|
+
this.pageResponses[pageId][requestId] = {
|
|
286
|
+
frameId: ((_c = this.pageResponses[pageId][requestId]) === null || _c === void 0 ? void 0 : _c.frameId) || '',
|
|
287
|
+
url: ((_d = this.pageResponses[pageId][requestId]) === null || _d === void 0 ? void 0 : _d.url) || '',
|
|
288
|
+
// @ts-ignore TODO: fix expires type mismatch
|
|
289
|
+
cookies: mergedCookies,
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
requestWillBeSentListener(pageId, { requestId, request, frameId }) {
|
|
293
|
+
this.pageRequests[pageId][requestId] = Object.assign(Object.assign({}, (this.pageRequests[pageId][requestId] || {})), { frameId, url: request.url });
|
|
294
|
+
}
|
|
295
|
+
requestWillBeSentExtraInfoListener(pageId, { associatedCookies, requestId, }) {
|
|
296
|
+
if (!associatedCookies || associatedCookies.length === 0) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
const cookies = associatedCookies.map((associatedCookie) => {
|
|
300
|
+
var _a, _b;
|
|
301
|
+
return {
|
|
302
|
+
parsedCookie: {
|
|
303
|
+
name: associatedCookie.cookie.name,
|
|
304
|
+
domain: associatedCookie.cookie.domain,
|
|
305
|
+
path: associatedCookie.cookie.path || '/',
|
|
306
|
+
value: associatedCookie.cookie.value,
|
|
307
|
+
sameSite: associatedCookie.cookie.sameSite || 'Lax',
|
|
308
|
+
expires: associatedCookie.cookie.expires || 'Session',
|
|
309
|
+
httpOnly: associatedCookie.cookie.httpOnly || false,
|
|
310
|
+
secure: associatedCookie.cookie.secure || false,
|
|
311
|
+
partitionKey: associatedCookie.cookie.partitionKey,
|
|
312
|
+
},
|
|
313
|
+
networkEvents: {
|
|
314
|
+
requestEvents: [
|
|
315
|
+
{
|
|
316
|
+
type: common_1.REQUEST_EVENT.CDP_REQUEST_WILL_BE_SENT_EXTRA_INFO,
|
|
317
|
+
requestId,
|
|
318
|
+
url: ((_a = this.pageRequests[pageId][requestId]) === null || _a === void 0 ? void 0 : _a.url) || '',
|
|
319
|
+
blocked: associatedCookie.blockedReasons.length > 0,
|
|
320
|
+
timeStamp: Date.now(),
|
|
321
|
+
},
|
|
322
|
+
],
|
|
323
|
+
responseEvents: [],
|
|
324
|
+
},
|
|
325
|
+
isBlocked: associatedCookie.blockedReasons.length > 0,
|
|
326
|
+
blockedReasons: associatedCookie.blockedReasons,
|
|
327
|
+
exemptionReason: associatedCookie === null || associatedCookie === void 0 ? void 0 : associatedCookie.exemptionReason,
|
|
328
|
+
url: ((_b = this.pageRequests[pageId][requestId]) === null || _b === void 0 ? void 0 : _b.url) || '',
|
|
329
|
+
headerType: 'request',
|
|
330
|
+
};
|
|
331
|
+
});
|
|
332
|
+
this.pageRequests[pageId][requestId] = Object.assign(Object.assign({}, (this.pageRequests[pageId][requestId] || {})), { cookies });
|
|
333
|
+
}
|
|
334
|
+
pageFrameAttachedListener(pageId, { frameId, parentFrameId }) {
|
|
335
|
+
if (!this.pageFrames[pageId]) {
|
|
336
|
+
this.pageFrames[pageId] = {};
|
|
337
|
+
}
|
|
338
|
+
this.pageFrames[pageId][frameId] = parentFrameId;
|
|
339
|
+
}
|
|
340
|
+
getMainframeIds() {
|
|
341
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
342
|
+
var _a;
|
|
343
|
+
const pageTargetIds = {};
|
|
344
|
+
// This gets targets for all pages.
|
|
345
|
+
const cdpSession = yield Object.values(this.pages)[0].createCDPSession();
|
|
346
|
+
const res = yield cdpSession.send('Target.getTargets');
|
|
347
|
+
for (const [_url, page] of Object.entries(this.pages)) {
|
|
348
|
+
const constructedUrl = page.url();
|
|
349
|
+
const mainFrameTargetId = (_a = res.targetInfos.find(({ url, type }) => constructedUrl === url && type === 'page')) === null || _a === void 0 ? void 0 : _a.targetId;
|
|
350
|
+
pageTargetIds[_url] = mainFrameTargetId || '';
|
|
351
|
+
}
|
|
352
|
+
return pageTargetIds;
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
attachListenersToPage(pageId) {
|
|
356
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
357
|
+
const page = this.pages[pageId];
|
|
358
|
+
if (!page) {
|
|
359
|
+
throw new Error(`no page with the provided id was found:${pageId}`);
|
|
360
|
+
}
|
|
361
|
+
const cdpSession = yield page.createCDPSession();
|
|
362
|
+
yield cdpSession.send('Target.setAutoAttach', {
|
|
363
|
+
// If this is set to true, debugger will be attached to every new target that is added to the current target.
|
|
364
|
+
autoAttach: true,
|
|
365
|
+
waitForDebuggerOnStart: false,
|
|
366
|
+
//Enables "flat" access to the session via specifying sessionId attribute in the commands.
|
|
367
|
+
// If this is set to true the debugger is also attached to the child targets of that the target it has been attached to.
|
|
368
|
+
flatten: true,
|
|
369
|
+
});
|
|
370
|
+
yield cdpSession.send('Network.enable');
|
|
371
|
+
yield cdpSession.send('Page.enable');
|
|
372
|
+
this.pageRequests[pageId] = {};
|
|
373
|
+
this.pageResponses[pageId] = {};
|
|
374
|
+
this.pageResourcesMaps[pageId] = {};
|
|
375
|
+
page.on('response', (ev) => this.responseEventListener(pageId, ev));
|
|
376
|
+
cdpSession.on('Network.responseReceived', (ev) => this.responseReceivedListener(pageId, ev));
|
|
377
|
+
cdpSession.on('Network.responseReceivedExtraInfo', (ev) => this.responseReceivedExtraInfoListener(pageId, ev));
|
|
378
|
+
cdpSession.on('Network.requestWillBeSent', (ev) => this.requestWillBeSentListener(pageId, ev));
|
|
379
|
+
cdpSession.on('Network.requestWillBeSentExtraInfo', (ev) => this.requestWillBeSentExtraInfoListener(pageId, ev));
|
|
380
|
+
cdpSession.on('Page.frameAttached', (ev) => this.pageFrameAttachedListener(pageId, ev));
|
|
381
|
+
this.debugLog('done attaching network event listeners');
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
getJSCookies(page) {
|
|
385
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
386
|
+
const frames = page.frames();
|
|
387
|
+
const cookies = {};
|
|
388
|
+
yield Promise.all(frames.map((frame) => __awaiter(this, void 0, void 0, function* () {
|
|
389
|
+
if (!frame.url().includes('http')) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
const _JSCookies = yield (0, common_1.resolveWithTimeout)(frame.evaluate(() => {
|
|
393
|
+
// @ts-ignore
|
|
394
|
+
return cookieStore.getAll();
|
|
395
|
+
}), [], 200);
|
|
396
|
+
const frameCookies = {};
|
|
397
|
+
_JSCookies.forEach((cookie) => {
|
|
398
|
+
if (!cookie.domain) {
|
|
399
|
+
cookie.domain = new URL(frame.url()).hostname;
|
|
400
|
+
}
|
|
401
|
+
if (cookie.domain[0] !== '.') {
|
|
402
|
+
cookie.domain = '.' + cookie.domain;
|
|
403
|
+
}
|
|
404
|
+
const key = cookie.name + ':' + cookie.domain + ':' + cookie.path;
|
|
405
|
+
frameCookies[key] = { parsedCookie: cookie };
|
|
406
|
+
});
|
|
407
|
+
const frameUrl = new URL(frame.url()).origin;
|
|
408
|
+
cookies[frameUrl] = { frameCookies };
|
|
409
|
+
})));
|
|
410
|
+
return cookies;
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
getResources(urls) {
|
|
414
|
+
const allFetchedResources = {};
|
|
415
|
+
urls.forEach((url) => {
|
|
416
|
+
var _a;
|
|
417
|
+
const page = this.pages[url];
|
|
418
|
+
const resources = this.pageResourcesMaps[url];
|
|
419
|
+
if (!page || !resources) {
|
|
420
|
+
allFetchedResources[url] = [];
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
const mainFrameUrl = new URL(page.url()).origin;
|
|
424
|
+
allFetchedResources[mainFrameUrl] = Array.from((_a = Object.values(resources)) !== null && _a !== void 0 ? _a : []);
|
|
425
|
+
});
|
|
426
|
+
return allFetchedResources;
|
|
427
|
+
}
|
|
428
|
+
insertAndRunDOMQueryFunctions(url, Libraries) {
|
|
429
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
430
|
+
const page = this.pages[url];
|
|
431
|
+
if (!page) {
|
|
432
|
+
throw new Error('no page with the provided id was found');
|
|
433
|
+
}
|
|
434
|
+
const domQueryMatches = {};
|
|
435
|
+
yield Promise.all(Libraries.map((_a) => __awaiter(this, [_a], void 0, function* ({ domQueryFunction, name }) {
|
|
436
|
+
if (domQueryFunction && name) {
|
|
437
|
+
yield page.addScriptTag({
|
|
438
|
+
content: `window.${name.replaceAll('-', '')} = ${domQueryFunction}`,
|
|
439
|
+
});
|
|
440
|
+
const queryResult = yield page.evaluate((library) => {
|
|
441
|
+
//@ts-ignore
|
|
442
|
+
const functionDOMQuery = window[`${library}`];
|
|
443
|
+
if (!functionDOMQuery) {
|
|
444
|
+
return [];
|
|
445
|
+
}
|
|
446
|
+
return functionDOMQuery();
|
|
447
|
+
}, name.replaceAll('-', ''));
|
|
448
|
+
domQueryMatches[name] = {
|
|
449
|
+
domQuerymatches: queryResult,
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
})));
|
|
453
|
+
const mainFrameUrl = new URL(page.url()).origin;
|
|
454
|
+
return { [mainFrameUrl]: domQueryMatches };
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
analyzeCookies(userProvidedUrls, shouldSkipAcceptBanner, Libraries) {
|
|
458
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
459
|
+
let consolidatedDOMQueryMatches = {};
|
|
460
|
+
// Open tabs and attach network listeners
|
|
461
|
+
yield Promise.all(userProvidedUrls.map((url) => __awaiter(this, void 0, void 0, function* () {
|
|
462
|
+
const sitePage = yield this.openPage();
|
|
463
|
+
this.pages[url] = sitePage;
|
|
464
|
+
yield this.attachListenersToPage(url);
|
|
465
|
+
})));
|
|
466
|
+
// Navigate to URLs
|
|
467
|
+
yield Promise.all(userProvidedUrls.map((url) => __awaiter(this, void 0, void 0, function* () {
|
|
468
|
+
yield this.navigateToPage(url);
|
|
469
|
+
})));
|
|
470
|
+
// Delay for page to load resources
|
|
471
|
+
yield (0, common_1.delay)(this.pageWaitTime / 2);
|
|
472
|
+
// Accept Banners
|
|
473
|
+
if (shouldSkipAcceptBanner) {
|
|
474
|
+
// delay
|
|
475
|
+
yield Promise.all(userProvidedUrls.map((url) => __awaiter(this, void 0, void 0, function* () {
|
|
476
|
+
yield this.clickOnAcceptBanner(url);
|
|
477
|
+
})));
|
|
478
|
+
}
|
|
479
|
+
// Scroll to bottom of the page
|
|
480
|
+
yield Promise.all(userProvidedUrls.map((url) => __awaiter(this, void 0, void 0, function* () {
|
|
481
|
+
yield this.pageScroll(url);
|
|
482
|
+
})));
|
|
483
|
+
yield Promise.all(userProvidedUrls.map((url) => __awaiter(this, void 0, void 0, function* () {
|
|
484
|
+
const newMatches = yield this.insertAndRunDOMQueryFunctions(url, Libraries);
|
|
485
|
+
consolidatedDOMQueryMatches = Object.assign(Object.assign({}, consolidatedDOMQueryMatches), newMatches);
|
|
486
|
+
})));
|
|
487
|
+
// Delay for page to load more resources
|
|
488
|
+
yield (0, common_1.delay)(this.pageWaitTime / 2);
|
|
489
|
+
const mainFrameUrlIdMap = yield this.getMainframeIds();
|
|
490
|
+
Object.entries(mainFrameUrlIdMap).forEach(([_url, id]) => {
|
|
491
|
+
if (!this.pageFrames[_url]) {
|
|
492
|
+
this.pageFrames[_url] = {
|
|
493
|
+
[id]: '0',
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
else {
|
|
497
|
+
this.pageFrames[_url][id] = '0';
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
const result = yield Promise.all(userProvidedUrls.map((userProvidedUrl) => __awaiter(this, void 0, void 0, function* () {
|
|
501
|
+
const _responses = this.pageResponses[userProvidedUrl];
|
|
502
|
+
const _requests = this.pageRequests[userProvidedUrl];
|
|
503
|
+
const _page = this.pages[userProvidedUrl];
|
|
504
|
+
const _pageFrames = this.pageFrames[userProvidedUrl];
|
|
505
|
+
if (!_responses || !_requests || !_page) {
|
|
506
|
+
return {
|
|
507
|
+
url: userProvidedUrl,
|
|
508
|
+
cookieData: {},
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
const cookieDataFromNetwork = yield (0, parseNetworkDataToCookieData_1.parseNetworkDataToCookieData)(_responses, _requests, _page, _pageFrames);
|
|
512
|
+
const cookieDataFromJS = yield this.getJSCookies(_page);
|
|
513
|
+
const mainFrameUrl = new URL(_page.url()).origin;
|
|
514
|
+
const collatedCookieData = (0, collateCookieData_1.default)(cookieDataFromNetwork, cookieDataFromJS);
|
|
515
|
+
return {
|
|
516
|
+
// Page may redirect. page.url() gives the redirected URL
|
|
517
|
+
url: mainFrameUrl,
|
|
518
|
+
cookieData: collatedCookieData,
|
|
519
|
+
};
|
|
520
|
+
})));
|
|
521
|
+
return { result, consolidatedDOMQueryMatches };
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
deinitialize() {
|
|
525
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
526
|
+
var _a;
|
|
527
|
+
yield ((_a = this.browser) === null || _a === void 0 ? void 0 : _a.close());
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
exports.BrowserManagement = BrowserManagement;
|
|
532
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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