Skip to content

Commit d4f160c

Browse files
committed
Add some self-documentation.
1 parent e2bcbac commit d4f160c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

browser-extension/tests/har-view.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
* HAR Page Viewer Test Server
3+
*
4+
* This Express server serves recorded HAR files as live web pages for testing.
5+
* It provides two viewing modes: 'clean' (original page) and 'gitcasso' (with extension injected).
6+
*
7+
* Key components:
8+
* - Loads HAR files from ./har/ directory based on PAGES index in `./har/_har_index.ts`
9+
* - Patches URLs in HTML to serve assets locally from HAR data
10+
* - Handles asset serving by matching HAR entries to requested paths
11+
*
12+
* Development notes:
13+
* - Injects Gitcasso content script in 'gitcasso' mode with location patching
14+
* - Location patching uses history.pushState to simulate original URLs
15+
* - Chrome APIs are mocked for extension testing outside browser context
16+
* - Content script is fetched from http://localhost:3000 (dev server)
17+
*/
118
import { error } from 'node:console'
219
import fs from 'node:fs/promises'
320
import path from 'node:path'

0 commit comments

Comments
 (0)