@descryy/runtime-browser 0.4.1 → 0.4.3
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.
|
@@ -17,7 +17,71 @@ import type { BrowserConfiguration } from "@descryy/runtime-contracts";
|
|
|
17
17
|
* look-alike declared independently of `ExecutionConfiguration.browser` --
|
|
18
18
|
* two shapes with the same field would drift.
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* One cookie to seed, as a caller names it.
|
|
22
|
+
*
|
|
23
|
+
* **No `domain`, on purpose.** Everything in a seed is scoped to `origin`
|
|
24
|
+
* below, and a caller-named domain is the one field that could widen a
|
|
25
|
+
* session beyond the origin its consent was granted for. There is nothing to
|
|
26
|
+
* accept-and-drop because there is nothing to accept.
|
|
27
|
+
*/
|
|
28
|
+
export interface SeededCookie {
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly value: string;
|
|
31
|
+
/** Defaults to "/". */
|
|
32
|
+
readonly path?: string;
|
|
33
|
+
readonly httpOnly?: boolean;
|
|
34
|
+
readonly secure?: boolean;
|
|
35
|
+
readonly sameSite?: "Strict" | "Lax" | "None";
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* How a session reaches a logged-in screen -- B1 of `descry-core`'s
|
|
39
|
+
* `documents/plans/browser-reliability.md`.
|
|
40
|
+
*
|
|
41
|
+
* ## Why this is not on `BrowserConfiguration`
|
|
42
|
+
*
|
|
43
|
+
* RT-068 made `BrowserSessionOptions` the contracts type itself rather than a
|
|
44
|
+
* look-alike, precisely so the two could not drift, and that reasoning still
|
|
45
|
+
* holds for everything already on it. It does not hold for a credential, and
|
|
46
|
+
* the reason is structural rather than stylistic: **`BrowserConfiguration` is
|
|
47
|
+
* part of `ExecutionConfiguration`, which is persisted with the execution
|
|
48
|
+
* record for replay.** `EvidenceStore`'s redaction pass is key-name driven --
|
|
49
|
+
* `cookie` matches, `cookies` and `value` do not -- so a seed carried on the
|
|
50
|
+
* contracts type would be written to disk in full, by a store whose whole
|
|
51
|
+
* reason for existing is that raw evidence must not become unrestricted
|
|
52
|
+
* context. So the auth seed is a launch-time argument and never part of a
|
|
53
|
+
* configuration anything persists.
|
|
54
|
+
*
|
|
55
|
+
* ## One origin, and the header rule
|
|
56
|
+
*
|
|
57
|
+
* `origin` is the session's consented origin. Cookies and `localStorage` are
|
|
58
|
+
* scoped to it by construction. `extraHttpHeaders` is scoped to it by
|
|
59
|
+
* `launchWithExecutable` **at request time**, which is not a nicety: a
|
|
60
|
+
* context-level `extraHTTPHeaders` travels with every request the context
|
|
61
|
+
* makes, so a bearer token would be handed to every third-party script, font
|
|
62
|
+
* and analytics endpoint the page loads.
|
|
63
|
+
*/
|
|
64
|
+
export interface BrowserSessionAuth {
|
|
65
|
+
/** The one origin everything here is scoped to. */
|
|
66
|
+
readonly origin: string;
|
|
67
|
+
readonly cookies?: readonly SeededCookie[];
|
|
68
|
+
/** Entries to place in `localStorage` for `origin` before the first navigation. */
|
|
69
|
+
readonly localStorage?: Readonly<Record<string, string>>;
|
|
70
|
+
/** Headers added to requests **on `origin` only**. */
|
|
71
|
+
readonly extraHttpHeaders?: Readonly<Record<string, string>>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* RT-068: this used to be its own interface, declared independently of
|
|
75
|
+
* `ExecutionConfiguration.browser`. Two shapes with the same one field would
|
|
76
|
+
* have been exactly the "parallel copy that could drift" this codebase
|
|
77
|
+
* already refuses elsewhere -- so the persisted half is the contracts type,
|
|
78
|
+
* not a look-alike of it. `auth` is added here and deliberately nowhere else;
|
|
79
|
+
* see `BrowserSessionAuth` for why a credential must not be part of a
|
|
80
|
+
* configuration that gets written down.
|
|
81
|
+
*/
|
|
82
|
+
export type BrowserSessionOptions = BrowserConfiguration & {
|
|
83
|
+
readonly auth?: BrowserSessionAuth;
|
|
84
|
+
};
|
|
21
85
|
export interface BrowserSession {
|
|
22
86
|
readonly sessionId: string;
|
|
23
87
|
readonly page: Page;
|
|
@@ -47,6 +111,22 @@ export interface BrowserSession {
|
|
|
47
111
|
* tradeoff `screenshot()` makes at a smaller scale.
|
|
48
112
|
*/
|
|
49
113
|
finishedVideo(): Promise<Uint8Array | null>;
|
|
114
|
+
/**
|
|
115
|
+
* Write this context's cookies and per-origin storage to `path`, so a login
|
|
116
|
+
* performed once can seed a later session -- B1's "log in once" half.
|
|
117
|
+
*
|
|
118
|
+
* **Must be called before `close()`.** A closed context has no state to
|
|
119
|
+
* read, and Playwright would either throw from inside or, worse, a caller
|
|
120
|
+
* catching that would end up with no file and no idea why. It refuses by
|
|
121
|
+
* name instead, the same shape `finishedVideo()` already uses for its own
|
|
122
|
+
* ordering requirement in the opposite direction.
|
|
123
|
+
*
|
|
124
|
+
* The file it writes is a live credential. Deciding where that may land is
|
|
125
|
+
* the caller's -- `descry-core` refuses a path inside the repository -- and
|
|
126
|
+
* deliberately not decided here, because this package has no idea what a
|
|
127
|
+
* repository is.
|
|
128
|
+
*/
|
|
129
|
+
saveStorageState(path: string): Promise<void>;
|
|
50
130
|
}
|
|
51
131
|
/**
|
|
52
132
|
* Why this exists, and why it's not a throw.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-session.d.ts","sourceRoot":"","sources":["../src/browser-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAA+C,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAMzF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEvE;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"browser-session.d.ts","sourceRoot":"","sources":["../src/browser-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAA+C,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAMzF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4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AAED;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAAC,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAOrH;AAED,wBAAsB,oBAAoB,CAAC,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,cAAc,CAAC,CAOvG"}
|
package/dist/browser-session.js
CHANGED
|
@@ -76,8 +76,39 @@ async function launchWithExecutable(options, executablePath) {
|
|
|
76
76
|
// session-scoped temp dir, never caller-supplied (see BrowserConfiguration.recordVideo).
|
|
77
77
|
// created before newContext(): Playwright's recordVideo.dir must exist and be known at context-creation time.
|
|
78
78
|
const videoDir = options.recordVideo === true ? await mkdtemp(join(tmpdir(), `descry-video-${sessionId}-`)) : null;
|
|
79
|
-
const
|
|
79
|
+
const auth = options.auth;
|
|
80
|
+
const context = await browser.newContext({
|
|
81
|
+
...(videoDir === null ? {} : { recordVideo: { dir: videoDir } }),
|
|
82
|
+
// Built rather than passed through: what a caller names is a cookie and a
|
|
83
|
+
// key/value map for one origin, and Playwright's own storage-state shape
|
|
84
|
+
// wants a domain per cookie and an array per origin. Deriving the domain
|
|
85
|
+
// from `auth.origin` here is what makes "scoped to the consented origin"
|
|
86
|
+
// a property of the code rather than of a caller getting it right.
|
|
87
|
+
...(auth === undefined ? {} : { storageState: seedStateFor(auth) }),
|
|
88
|
+
});
|
|
80
89
|
const page = await context.newPage();
|
|
90
|
+
// Only installed when there is a header to send. Route interception is not
|
|
91
|
+
// free -- it puts a handler in front of every request the context makes --
|
|
92
|
+
// and a session with no header must behave exactly as it did before this
|
|
93
|
+
// option existed. `context.setExtraHTTPHeaders` would have been one line,
|
|
94
|
+
// and would have sent the credential to every host the page touches.
|
|
95
|
+
if (auth?.extraHttpHeaders !== undefined && Object.keys(auth.extraHttpHeaders).length > 0) {
|
|
96
|
+
const headers = auth.extraHttpHeaders;
|
|
97
|
+
const consented = auth.origin;
|
|
98
|
+
await context.route("**/*", async (route) => {
|
|
99
|
+
let sameOrigin = false;
|
|
100
|
+
try {
|
|
101
|
+
sameOrigin = new URL(route.request().url()).origin === consented;
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
sameOrigin = false;
|
|
105
|
+
}
|
|
106
|
+
// A request off the consented origin continues untouched -- not
|
|
107
|
+
// blocked. This seam exists to stop a credential travelling, not to
|
|
108
|
+
// become a second, undisclosed network policy.
|
|
109
|
+
await route.continue(sameOrigin ? { headers: { ...route.request().headers(), ...lowerCased(headers) } } : {});
|
|
110
|
+
});
|
|
111
|
+
}
|
|
81
112
|
const startedAt = new Date().toISOString();
|
|
82
113
|
let crashed = false;
|
|
83
114
|
page.on("crash", () => {
|
|
@@ -92,6 +123,14 @@ async function launchWithExecutable(options, executablePath) {
|
|
|
92
123
|
await context.close();
|
|
93
124
|
await browser.close();
|
|
94
125
|
},
|
|
126
|
+
async saveStorageState(path) {
|
|
127
|
+
if (page.isClosed()) {
|
|
128
|
+
throw new Error("saveStorageState() called after close() -- a closed browser context holds no cookies or storage to " +
|
|
129
|
+
"read, so this would write an empty file that looks like a session with nothing in it. Call it " +
|
|
130
|
+
"while the session is still open.");
|
|
131
|
+
}
|
|
132
|
+
await context.storageState({ path });
|
|
133
|
+
},
|
|
95
134
|
async finishedVideo() {
|
|
96
135
|
if (videoDir === null)
|
|
97
136
|
return null;
|
|
@@ -113,4 +152,48 @@ async function launchWithExecutable(options, executablePath) {
|
|
|
113
152
|
},
|
|
114
153
|
};
|
|
115
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* A caller's one-origin seed as a browser's own storage-state shape.
|
|
157
|
+
*
|
|
158
|
+
* The cookie domain is the consented origin's hostname and nothing else --
|
|
159
|
+
* which is the whole of the same-origin guarantee, stated in one place rather
|
|
160
|
+
* than checked in several.
|
|
161
|
+
*/
|
|
162
|
+
function seedStateFor(auth) {
|
|
163
|
+
const host = hostnameOf(auth.origin);
|
|
164
|
+
const cookies = (auth.cookies ?? []).map((cookie) => ({
|
|
165
|
+
name: cookie.name,
|
|
166
|
+
value: cookie.value,
|
|
167
|
+
domain: host,
|
|
168
|
+
path: cookie.path ?? "/",
|
|
169
|
+
// -1 is a session cookie: it lives as long as the browser context and is
|
|
170
|
+
// never written to disk. That is the right default for a seeded
|
|
171
|
+
// credential -- an absent expiry should not quietly become a persistent
|
|
172
|
+
// one -- and a caller who wants otherwise has the cookie jar for it.
|
|
173
|
+
expires: -1,
|
|
174
|
+
httpOnly: cookie.httpOnly ?? false,
|
|
175
|
+
secure: cookie.secure ?? false,
|
|
176
|
+
sameSite: cookie.sameSite ?? "Lax",
|
|
177
|
+
}));
|
|
178
|
+
const stored = Object.entries(auth.localStorage ?? {}).map(([name, value]) => ({ name, value }));
|
|
179
|
+
return { cookies, origins: stored.length === 0 ? [] : [{ origin: auth.origin, localStorage: stored }] };
|
|
180
|
+
}
|
|
181
|
+
function hostnameOf(origin) {
|
|
182
|
+
try {
|
|
183
|
+
return new URL(origin).hostname;
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
// A caller that hands over something unparseable gets a domain that will
|
|
187
|
+
// simply match nothing, rather than a throw from inside a launch.
|
|
188
|
+
return origin;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Header names are case-insensitive on the wire and case-sensitive in the
|
|
193
|
+
* object Playwright is handed. Lower-casing means a caller's `Authorization`
|
|
194
|
+
* replaces the page's own `authorization` instead of both being sent.
|
|
195
|
+
*/
|
|
196
|
+
function lowerCased(headers) {
|
|
197
|
+
return Object.fromEntries(Object.entries(headers).map(([name, value]) => [name.toLowerCase(), value]));
|
|
198
|
+
}
|
|
116
199
|
//# sourceMappingURL=browser-session.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-session.js","sourceRoot":"","sources":["../src/browser-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAgD,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MA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session.ts";
|
|
1
|
+
export type { BrowserSessionOptions, BrowserSession, BrowserSessionAuth, SeededCookie, ChromiumUnavailable, ChromiumAvailability, BrowserSessionLaunch } from "./browser-session.ts";
|
|
2
2
|
export { launchBrowserSession, launchBrowserSessionOrRefuse, resolveChromiumExecutable, BrowserUnavailableError, CHROMIUM_INSTALL_REMEDY, } from "./browser-session.ts";
|
|
3
3
|
export type { DomElementSnapshot } from "./dom-evidence.ts";
|
|
4
4
|
export { captureElementSnapshot } from "./dom-evidence.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACrL,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,YAAY,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC3H,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,YAAY,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAE/E,YAAY,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAE/E,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAEvE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descryy/runtime-browser",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Browser runtime: launch, isolated context, navigation, click/type/wait, DOM inspection, screenshots, console/page-error/network capture, all through the Collector contract (plan §7/§8). See documents/decisions-inbox/PROPOSAL-B-playwright-for-browser-runtime.md for the Playwright-vs-CDP call.",
|
|
6
6
|
"license": "UNLICENSED",
|