@whotracksme/reporting 11.1.1 → 12.1.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/package.json +1 -1
  3. package/reporting/README.md +13 -0
  4. package/reporting/example/README.md +4 -0
  5. package/reporting/example/e2e/README.md +265 -0
  6. package/reporting/example/e2e/console-capture.js +67 -0
  7. package/reporting/example/e2e/control.js +449 -0
  8. package/reporting/example/e2e/hub.mjs +380 -0
  9. package/reporting/example/e2e/launch.mjs +92 -0
  10. package/reporting/example/e2e/mock-extension.mjs +106 -0
  11. package/reporting/example/e2e/pages/private-fixture.html +16 -0
  12. package/reporting/example/e2e/run.mjs +226 -0
  13. package/reporting/example/e2e/scenarios/privacy-guards.json +26 -0
  14. package/reporting/example/e2e/scenarios/smoke.json +15 -0
  15. package/reporting/example/e2e/verify.mjs +159 -0
  16. package/reporting/example/index.js +55 -46
  17. package/reporting/example/manifests/chromium.json +1 -0
  18. package/reporting/example/storage.js +65 -0
  19. package/reporting/package.json +5 -1
  20. package/reporting/rollup.config.cjs +1 -1
  21. package/reporting/snapshots/0001/snapshot.json +13 -13
  22. package/reporting/snapshots/0003/snapshot.json +5 -5
  23. package/reporting/snapshots/0005/snapshot.json +13 -13
  24. package/reporting/src/doublefetch-page-handler.js +30 -20
  25. package/reporting/src/doublefetch-unbreak.js +186 -0
  26. package/reporting/src/http.js +197 -19
  27. package/reporting/src/index.js +1 -0
  28. package/reporting/src/offscreen/doublefetch/capture.js +90 -0
  29. package/reporting/src/patterns.js +142 -2
  30. package/reporting/src/request/index.js +6 -0
  31. package/reporting/src/request/page-store.js +1 -0
  32. package/reporting/src/request/support.js +29 -0
  33. package/reporting/src/search-extractor.js +8 -2
  34. package/reporting/src/utils.js +19 -0
  35. package/reporting/test/doublefetch-unbreak.spec.js +133 -0
  36. package/reporting/test/http.spec.js +113 -0
  37. package/reporting/test/index.js +1 -0
  38. package/reporting/test/patterns.spec.js +239 -0
  39. package/reporting/test/search-extractor.spec.js +19 -1
  40. package/reporting/test/setup.unit.js +9 -0
@@ -0,0 +1,380 @@
1
+ /**
2
+ * WhoTracks.Me
3
+ * https://whotracks.me/
4
+ *
5
+ * Copyright 2017-present Ghostery GmbH. All rights reserved.
6
+ *
7
+ * This Source Code Form is subject to the terms of the Mozilla Public
8
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
9
+ * file, You can obtain one at http://mozilla.org/MPL/2.0
10
+ */
11
+ import http from 'node:http';
12
+ import fs from 'node:fs';
13
+ import path from 'node:path';
14
+ import { fileURLToPath } from 'node:url';
15
+ import { parseArgs } from 'node:util';
16
+ import { WebSocketServer } from 'ws';
17
+
18
+ const { values } = parseArgs({
19
+ options: {
20
+ port: { type: 'string', default: '7878' },
21
+ 'out-dir': { type: 'string' },
22
+ quiet: { type: 'boolean', default: false },
23
+ },
24
+ });
25
+
26
+ const e2eDir = path.dirname(fileURLToPath(import.meta.url));
27
+ const outDir = values['out-dir'] || path.join(e2eDir, 'out');
28
+ const port = Number(values.port);
29
+
30
+ // Only the loopback authority is a valid Host. A DNS-rebinding page reaches the
31
+ // hub under its own hostname (Host: evil.com), so this rejects it, while the CLI
32
+ // and extension (which target 127.0.0.1/localhost) pass.
33
+ const ALLOWED_HOSTS = new Set([
34
+ `127.0.0.1:${port}`,
35
+ `localhost:${port}`,
36
+ `[::1]:${port}`,
37
+ ]);
38
+
39
+ fs.mkdirSync(outDir, { recursive: true });
40
+
41
+ const MESSAGES_LOG = path.join(outDir, 'messages.jsonl');
42
+ const EVENTS_LOG = path.join(outDir, 'events.jsonl');
43
+ const CONSOLE_LOG = path.join(outDir, 'console.log');
44
+
45
+ let seq = 0;
46
+ const messages = [];
47
+ const events = [];
48
+ const consoleLines = [];
49
+ const MAX_CONSOLE_LINES = 5000;
50
+
51
+ function hubLog(...args) {
52
+ if (!values.quiet) {
53
+ console.log(`[hub]`, ...args);
54
+ }
55
+ }
56
+
57
+ function append(file, record) {
58
+ fs.appendFile(file, `${JSON.stringify(record)}\n`, (err) => {
59
+ if (err) {
60
+ console.error('[hub] failed to append to', file, err.message);
61
+ }
62
+ });
63
+ }
64
+
65
+ function recordMessage(payload) {
66
+ seq += 1;
67
+ const record = { seq, receivedAt: Date.now(), ...payload };
68
+ messages.push(record);
69
+ append(MESSAGES_LOG, record);
70
+ const action = record.body?.action || record.body?.type || 'unknown';
71
+ hubLog(`message #${seq}`, action);
72
+ return record;
73
+ }
74
+
75
+ function recordEvent(payload) {
76
+ seq += 1;
77
+ const record = { seq, receivedAt: Date.now(), ...payload };
78
+ events.push(record);
79
+ append(EVENTS_LOG, record);
80
+ return record;
81
+ }
82
+
83
+ function recordConsole({ level, text }) {
84
+ const line = `${new Date().toISOString()} [sw] [${level}] ${text}`;
85
+ consoleLines.push(line);
86
+ if (consoleLines.length > MAX_CONSOLE_LINES) {
87
+ consoleLines.splice(0, consoleLines.length - MAX_CONSOLE_LINES);
88
+ }
89
+ fs.appendFile(CONSOLE_LOG, `${line}\n`, () => {});
90
+ }
91
+
92
+ let socket = null;
93
+ let extensionInfo = null;
94
+ let nextCommandId = 1;
95
+ let connectionGeneration = 0;
96
+ const pendingCommands = new Map();
97
+
98
+ // reset/reload reply and then the socket dies; callers need the worker back.
99
+ function waitForReconnect(generationBefore, timeoutInMs) {
100
+ const startedAt = Date.now();
101
+ return new Promise((resolve) => {
102
+ const check = () => {
103
+ if (connectionGeneration > generationBefore && socket?.readyState === 1) {
104
+ resolve(true);
105
+ } else if (Date.now() - startedAt > timeoutInMs) {
106
+ resolve(false);
107
+ } else {
108
+ setTimeout(check, 100);
109
+ }
110
+ };
111
+ check();
112
+ });
113
+ }
114
+
115
+ function sendToExtension(payload) {
116
+ if (!socket || socket.readyState !== socket.OPEN) {
117
+ return false;
118
+ }
119
+ socket.send(JSON.stringify(payload));
120
+ return true;
121
+ }
122
+
123
+ function runCommand(name, args, timeoutInMs) {
124
+ return new Promise((resolve, reject) => {
125
+ if (!socket || socket.readyState !== socket.OPEN) {
126
+ reject(new Error('extension is not connected to the hub'));
127
+ return;
128
+ }
129
+ const id = nextCommandId;
130
+ nextCommandId += 1;
131
+ const timer = setTimeout(() => {
132
+ pendingCommands.delete(id);
133
+ reject(new Error(`command "${name}" timed out after ${timeoutInMs}ms`));
134
+ }, timeoutInMs);
135
+ pendingCommands.set(id, {
136
+ resolve: (result) => {
137
+ clearTimeout(timer);
138
+ resolve(result);
139
+ },
140
+ reject: (err) => {
141
+ clearTimeout(timer);
142
+ reject(err);
143
+ },
144
+ });
145
+ sendToExtension({ kind: 'command', id, name, args });
146
+ });
147
+ }
148
+
149
+ const server = http.createServer(async (req, res) => {
150
+ if (!ALLOWED_HOSTS.has(req.headers.host)) {
151
+ res.writeHead(403, { 'Content-Type': 'application/json' });
152
+ res.end(JSON.stringify({ error: 'forbidden host' }));
153
+ return;
154
+ }
155
+ // A non-simple content type forces a CORS preflight, which fails here (no
156
+ // CORS headers are served) — so webpages cannot trigger POST side effects.
157
+ if (
158
+ req.method === 'POST' &&
159
+ !(req.headers['content-type'] || '').startsWith('application/json')
160
+ ) {
161
+ res.writeHead(415, { 'Content-Type': 'application/json' });
162
+ res.end(JSON.stringify({ error: 'expected application/json' }));
163
+ return;
164
+ }
165
+ const url = new URL(req.url, `http://127.0.0.1:${port}`);
166
+ try {
167
+ const body = req.method === 'POST' ? await readJsonBody(req) : {};
168
+ const [status, reply, headers] = await handleRequest(req.method, url, body);
169
+ if (Buffer.isBuffer(reply) || typeof reply === 'string') {
170
+ res.writeHead(status, headers || { 'Content-Type': 'text/plain' });
171
+ res.end(reply);
172
+ } else {
173
+ res.writeHead(status, { 'Content-Type': 'application/json' });
174
+ res.end(JSON.stringify(reply, null, 2));
175
+ }
176
+ } catch (err) {
177
+ res.writeHead(500, { 'Content-Type': 'application/json' });
178
+ res.end(JSON.stringify({ error: err.message }));
179
+ }
180
+ });
181
+
182
+ const MAX_BODY_BYTES = 1024 * 1024;
183
+
184
+ function readJsonBody(req) {
185
+ return new Promise((resolve) => {
186
+ const chunks = [];
187
+ let size = 0;
188
+ req.on('data', (c) => {
189
+ size += c.length;
190
+ if (size > MAX_BODY_BYTES) {
191
+ req.destroy();
192
+ resolve({ _parseError: 'body too large' });
193
+ return;
194
+ }
195
+ chunks.push(c);
196
+ });
197
+ req.on('end', () => {
198
+ const raw = Buffer.concat(chunks).toString('utf8');
199
+ if (!raw) {
200
+ resolve({});
201
+ return;
202
+ }
203
+ try {
204
+ resolve(JSON.parse(raw));
205
+ } catch {
206
+ resolve({ _parseError: raw });
207
+ }
208
+ });
209
+ });
210
+ }
211
+
212
+ function since(list, url) {
213
+ const from = Number(url.searchParams.get('since') || 0);
214
+ return list.filter((x) => x.seq > from);
215
+ }
216
+
217
+ async function handleRequest(method, url, body) {
218
+ const p = url.pathname;
219
+
220
+ if (method === 'GET' && (p === '/health' || p === '/')) {
221
+ return [
222
+ 200,
223
+ {
224
+ ok: true,
225
+ extensionConnected: !!socket && socket.readyState === socket.OPEN,
226
+ extension: extensionInfo,
227
+ seq,
228
+ counts: { messages: messages.length, events: events.length },
229
+ outDir,
230
+ },
231
+ ];
232
+ }
233
+
234
+ if (method === 'POST' && p === '/cmd') {
235
+ if (!body.name) {
236
+ return [400, { error: 'missing "name"' }];
237
+ }
238
+ const before = seq;
239
+ const timeout = Number(body.timeout) || 120000;
240
+ try {
241
+ const generationBefore = connectionGeneration;
242
+ const result = await runCommand(body.name, body.args || {}, timeout);
243
+ if (result?.restarting) {
244
+ const reconnected = await waitForReconnect(generationBefore, 30000);
245
+ return [
246
+ 200,
247
+ { ok: true, since: before, result: { ...result, reconnected } },
248
+ ];
249
+ }
250
+ return [200, { ok: true, since: before, result }];
251
+ } catch (err) {
252
+ return [502, { ok: false, since: before, error: err.message }];
253
+ }
254
+ }
255
+
256
+ if (method === 'GET' && p === '/messages') {
257
+ let result = since(messages, url);
258
+ const action = url.searchParams.get('action');
259
+ if (action) {
260
+ result = result.filter((x) => (x.body?.action || '').startsWith(action));
261
+ }
262
+ return [200, { seq, count: result.length, messages: result }];
263
+ }
264
+
265
+ if (method === 'POST' && p === '/messages/clear') {
266
+ messages.length = 0;
267
+ events.length = 0;
268
+ fs.writeFileSync(MESSAGES_LOG, '');
269
+ fs.writeFileSync(EVENTS_LOG, '');
270
+ return [200, { ok: true, seq }];
271
+ }
272
+
273
+ if (method === 'GET' && p === '/events') {
274
+ return [200, { seq, events: since(events, url) }];
275
+ }
276
+
277
+ if (method === 'GET' && p === '/logs') {
278
+ const tail = Number(url.searchParams.get('tail') || 100);
279
+ return [200, { lines: consoleLines.slice(-tail) }];
280
+ }
281
+
282
+ // Droppable by sanitizeUrl on two grounds: private host and uncommon port.
283
+ if (method === 'GET' && p.startsWith('/pages/')) {
284
+ return servePage(p.slice('/pages/'.length));
285
+ }
286
+
287
+ if (method === 'POST' && p === '/shutdown') {
288
+ setTimeout(() => process.exit(0), 10);
289
+ return [200, { ok: true }];
290
+ }
291
+
292
+ return [404, { error: `unknown route: ${method} ${p}` }];
293
+ }
294
+
295
+ function servePage(name) {
296
+ const pagesDir = path.join(e2eDir, 'pages');
297
+ const safe = path.normalize(name).replace(/^(\.\.[/\\])+/, '');
298
+ const file = path.join(pagesDir, safe);
299
+ if (!file.startsWith(pagesDir + path.sep) || !fs.existsSync(file)) {
300
+ return [404, { error: `no page: ${safe}` }];
301
+ }
302
+ return [200, fs.readFileSync(file), { 'Content-Type': 'text/html' }];
303
+ }
304
+
305
+ // Browsers always send Origin on a WS handshake; allow only the extension's
306
+ // chrome-extension:// origin. The Node mock client sends none (allowed); a
307
+ // website sends its http(s) origin (rejected), so it cannot hijack the channel.
308
+ const wss = new WebSocketServer({
309
+ server,
310
+ path: '/ws',
311
+ maxPayload: 1024 * 1024,
312
+ verifyClient: ({ origin }) =>
313
+ !origin || origin.startsWith('chrome-extension://'),
314
+ });
315
+
316
+ wss.on('connection', (ws) => {
317
+ if (socket && socket.readyState === socket.OPEN) {
318
+ hubLog('replacing an existing extension connection');
319
+ socket.close();
320
+ }
321
+ socket = ws;
322
+ connectionGeneration += 1;
323
+ hubLog(`extension connected (generation ${connectionGeneration})`);
324
+
325
+ ws.on('message', (raw) => {
326
+ let msg;
327
+ try {
328
+ msg = JSON.parse(raw.toString());
329
+ } catch {
330
+ hubLog('ignoring malformed frame');
331
+ return;
332
+ }
333
+ if (msg.kind === 'hello') {
334
+ extensionInfo = { ...msg.info, connectedAt: Date.now() };
335
+ hubLog('hello from', msg.info?.extensionId, msg.info?.userAgent);
336
+ } else if (msg.kind === 'result') {
337
+ const pending = pendingCommands.get(msg.id);
338
+ if (pending) {
339
+ pendingCommands.delete(msg.id);
340
+ if (msg.error) {
341
+ pending.reject(new Error(msg.error));
342
+ } else {
343
+ pending.resolve(msg.result);
344
+ }
345
+ }
346
+ } else if (msg.kind === 'message') {
347
+ recordMessage({
348
+ source: msg.source,
349
+ body: msg.body,
350
+ context: msg.context,
351
+ sentAt: msg.sentAt,
352
+ });
353
+ } else if (msg.kind === 'event') {
354
+ recordEvent({ event: msg.event, details: msg.details, at: msg.at });
355
+ } else if (msg.kind === 'console') {
356
+ recordConsole(msg);
357
+ }
358
+ });
359
+
360
+ ws.on('close', () => {
361
+ if (socket === ws) {
362
+ socket = null;
363
+ extensionInfo = null;
364
+ }
365
+ hubLog('extension disconnected');
366
+ });
367
+
368
+ ws.on('error', (err) => hubLog('socket error:', err.message));
369
+ });
370
+
371
+ // WebSocket traffic resets the MV3 idle timer, keeping the worker alive.
372
+ setInterval(() => {
373
+ sendToExtension({ kind: 'ping', at: Date.now() });
374
+ }, 20000).unref();
375
+
376
+ server.listen(port, '127.0.0.1', () => {
377
+ hubLog(`listening on http://127.0.0.1:${port}`);
378
+ hubLog(`extension endpoint: ws://127.0.0.1:${port}/ws`);
379
+ hubLog(`captures: ${outDir}`);
380
+ });
@@ -0,0 +1,92 @@
1
+ /**
2
+ * WhoTracks.Me
3
+ * https://whotracks.me/
4
+ *
5
+ * Copyright 2017-present Ghostery GmbH. All rights reserved.
6
+ *
7
+ * This Source Code Form is subject to the terms of the Mozilla Public
8
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
9
+ * file, You can obtain one at http://mozilla.org/MPL/2.0
10
+ */
11
+ import { spawn } from 'node:child_process';
12
+ import fs from 'node:fs';
13
+ import os from 'node:os';
14
+ import path from 'node:path';
15
+ import { fileURLToPath } from 'node:url';
16
+ import { parseArgs } from 'node:util';
17
+
18
+ const { values } = parseArgs({
19
+ options: {
20
+ profile: { type: 'string', default: 'WTM-E2E' },
21
+ chrome: { type: 'string' },
22
+ },
23
+ });
24
+
25
+ const e2eDir = path.dirname(fileURLToPath(import.meta.url));
26
+ const exampleDir = path.dirname(e2eDir);
27
+
28
+ for (const bundle of ['index.bundle.js', 'content.bundle.js']) {
29
+ if (!fs.existsSync(path.join(exampleDir, bundle))) {
30
+ console.error(
31
+ `missing example/${bundle} — run \`npm --workspace=reporting run build\` first`,
32
+ );
33
+ process.exit(1);
34
+ }
35
+ }
36
+
37
+ if (!fs.existsSync(path.join(exampleDir, 'manifest.json'))) {
38
+ fs.copyFileSync(
39
+ path.join(exampleDir, 'manifests', 'chromium.json'),
40
+ path.join(exampleDir, 'manifest.json'),
41
+ );
42
+ }
43
+
44
+ const CHROME_CANDIDATES = {
45
+ darwin: [
46
+ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
47
+ '/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary',
48
+ ],
49
+ linux: [
50
+ '/usr/bin/google-chrome',
51
+ '/usr/bin/google-chrome-stable',
52
+ '/usr/bin/chromium',
53
+ ],
54
+ win32: [
55
+ 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
56
+ 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
57
+ ],
58
+ };
59
+
60
+ function findChrome() {
61
+ if (values.chrome) {
62
+ return values.chrome;
63
+ }
64
+ const candidates = CHROME_CANDIDATES[os.platform()] || [];
65
+ const found = candidates.find((candidate) => fs.existsSync(candidate));
66
+ if (!found) {
67
+ console.error(
68
+ 'could not locate Chrome — pass --chrome=/path/to/chrome explicitly',
69
+ );
70
+ process.exit(1);
71
+ }
72
+ return found;
73
+ }
74
+
75
+ const chrome = findChrome();
76
+
77
+ // No --enable-automation, --remote-debugging-port or WebDriver: sites fingerprint them.
78
+ const args = ['--no-first-run', '--no-default-browser-check'];
79
+
80
+ args.push(`--profile-directory=${values.profile}`);
81
+ console.log(`profile: "${values.profile}" in your regular Chrome`);
82
+ console.log(`extension: load once by hand, then it persists:`);
83
+ console.log(` 1. chrome://extensions in the new window`);
84
+ console.log(` 2. enable "Developer mode"`);
85
+ console.log(` 3. "Load unpacked" -> ${exampleDir}`);
86
+
87
+ const child = spawn(chrome, args, { detached: true, stdio: 'ignore' });
88
+ child.unref();
89
+
90
+ console.log(`\nlaunched: ${chrome}`);
91
+ console.log('start the hub in another shell if it is not running yet:');
92
+ console.log(' npm --workspace=reporting run e2e.hub');
@@ -0,0 +1,106 @@
1
+ /**
2
+ * WhoTracks.Me
3
+ * https://whotracks.me/
4
+ *
5
+ * Copyright 2017-present Ghostery GmbH. All rights reserved.
6
+ *
7
+ * This Source Code Form is subject to the terms of the Mozilla Public
8
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
9
+ * file, You can obtain one at http://mozilla.org/MPL/2.0
10
+ */
11
+ import { parseArgs } from 'node:util';
12
+
13
+ const { values } = parseArgs({
14
+ options: {
15
+ hub: { type: 'string', default: 'ws://127.0.0.1:7878/ws' },
16
+ leak: { type: 'boolean', default: false },
17
+ },
18
+ });
19
+
20
+ const socket = new WebSocket(values.hub);
21
+ const send = (record) => socket.send(JSON.stringify(record));
22
+
23
+ let quorumMode = 'always';
24
+
25
+ function emitPage(url, title) {
26
+ if (quorumMode === 'never') {
27
+ return;
28
+ }
29
+ send({
30
+ kind: 'message',
31
+ source: 'url-reporter',
32
+ sentAt: Date.now(),
33
+ body: {
34
+ action: 'wtm.page',
35
+ ver: 4,
36
+ 'anti-duplicates': 1234,
37
+ payload: {
38
+ url,
39
+ t: title,
40
+ ref: null,
41
+ redirects: null,
42
+ lang: { html: 'en', detect: 'en' },
43
+ ctry: 'de',
44
+ activity: 0.5,
45
+ },
46
+ },
47
+ });
48
+ }
49
+
50
+ const commands = {
51
+ ping: () => ({ pong: true, now: Date.now() }),
52
+ state: () => ({ mock: true, quorum: { mode: quorumMode } }),
53
+ reset: () => {
54
+ quorumMode = 'always';
55
+ return { ok: true };
56
+ },
57
+ closeTabs: () => ({ closed: [] }),
58
+ setQuorum: ({ mode }) => {
59
+ quorumMode = mode;
60
+ return { mode };
61
+ },
62
+ navigate: ({ url }) => {
63
+ if (url.includes('127.0.0.1') && values.leak) {
64
+ emitPage(url, 'wtm-e2e-private-marker');
65
+ } else if (!url.includes('127.0.0.1')) {
66
+ emitPage(url, 'Mock page');
67
+ }
68
+ return { url, title: 'Mock page', loadedBecause: 'mock' };
69
+ },
70
+ flush: () => ({ drained: true, rounds: [{ round: 1, pending: 0 }] }),
71
+ processPendingJobs: () => ({ total: 0 }),
72
+ expirePages: () => ({ numJobsCreated: 0 }),
73
+ dumpJobs: () => ({ summary: { total: 0 } }),
74
+ dumpPageDb: () => ({ aggregatedPages: [], expiration: [] }),
75
+ selfChecks: () => ({ status: 'PASSED', overview: {} }),
76
+ };
77
+
78
+ socket.addEventListener('open', () => {
79
+ send({
80
+ kind: 'hello',
81
+ info: { extensionId: 'mock-extension', userAgent: 'mock/1.0' },
82
+ });
83
+ console.log(`mock extension connected to ${values.hub}`);
84
+ });
85
+
86
+ socket.addEventListener('message', async (event) => {
87
+ const msg = JSON.parse(event.data);
88
+ if (msg.kind !== 'command') {
89
+ return;
90
+ }
91
+ const handler = commands[msg.name];
92
+ if (!handler) {
93
+ send({ kind: 'result', id: msg.id, error: `unknown command: ${msg.name}` });
94
+ return;
95
+ }
96
+ try {
97
+ send({ kind: 'result', id: msg.id, result: await handler(msg.args || {}) });
98
+ } catch (e) {
99
+ send({ kind: 'result', id: msg.id, error: `${e}` });
100
+ }
101
+ });
102
+
103
+ socket.addEventListener('close', () => {
104
+ console.log('mock extension disconnected');
105
+ process.exit(0);
106
+ });
@@ -0,0 +1,16 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>wtm-e2e-private-marker</title>
6
+ <meta name="description" content="wtm-e2e-private-marker" />
7
+ </head>
8
+ <body>
9
+ <h1>wtm-e2e-private-marker</h1>
10
+ <p>
11
+ Served from 127.0.0.1 on a non-standard port, so sanitizeUrl must drop it
12
+ as "URL is not public". If the marker string above ever shows up in a
13
+ captured message, a privacy guard has regressed.
14
+ </p>
15
+ </body>
16
+ </html>