clearcote 0.10.0 → 0.10.2
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/README.md +31 -0
- package/dist/humanize.d.ts +2 -3
- package/dist/humanize.d.ts.map +1 -1
- package/dist/humanize.js +397 -60
- package/dist/humanize.js.map +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -2
- package/dist/index.js.map +1 -1
- package/dist/release.js +4 -4
- package/dist/widevine.d.ts +40 -0
- package/dist/widevine.d.ts.map +1 -0
- package/dist/widevine.js +181 -0
- package/dist/widevine.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -81,6 +81,37 @@ const context = await launchPersistentContext("./profile-7423", {
|
|
|
81
81
|
});
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
### Widevine / DRM (`widevine: true`)
|
|
85
|
+
|
|
86
|
+
clearcote ships the **EME/Widevine plumbing** compiled in, but — being 100% open source — it does
|
|
87
|
+
**not** bundle Google's proprietary CDM. Pass `widevine: true` on a **persistent** context and the SDK
|
|
88
|
+
fetches that CDM once from Google's own component server (same as a real Chrome receives it), seeds it
|
|
89
|
+
into the profile, and enables it — so `navigator.requestMediaKeySystemAccess('com.widevine.alpha')`
|
|
90
|
+
resolves and DRM streams play, instead of EME being a "no-Widevine" tell.
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
import { launchPersistentContext } from "clearcote";
|
|
94
|
+
|
|
95
|
+
const ctx = await launchPersistentContext("./profile-drm", { widevine: true }); // fetch + seed + enable
|
|
96
|
+
const page = ctx.pages()[0] ?? (await ctx.newPage());
|
|
97
|
+
await page.goto("https://example.com");
|
|
98
|
+
const ok = await page.evaluate(async () => {
|
|
99
|
+
const a = await navigator.requestMediaKeySystemAccess("com.widevine.alpha", [
|
|
100
|
+
{ initDataTypes: ["cenc"], videoCapabilities: [
|
|
101
|
+
{ contentType: 'video/mp4;codecs="avc1.42E01E"', robustness: "SW_SECURE_DECODE" }] },
|
|
102
|
+
]);
|
|
103
|
+
await a.createMediaKeys();
|
|
104
|
+
return true;
|
|
105
|
+
});
|
|
106
|
+
console.log("Widevine:", ok); // true
|
|
107
|
+
await ctx.close();
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
- Requires a **persistent** context (the CDM lives in `userDataDir`) — not the incognito `launch()`.
|
|
111
|
+
- The CDM is cached under `~/.clearcote/WidevineCdm`; fetch it ahead of time with `fetchWidevine()`.
|
|
112
|
+
- It's **opt-in**: the clearcote package never distributes Google's CDM — *you* trigger the download.
|
|
113
|
+
- Software-secure (L3) playback. Hardware-secure (L1) paths are out of scope.
|
|
114
|
+
|
|
84
115
|
### AI agent (OpenRouter)
|
|
85
116
|
|
|
86
117
|
Drive a page with an **in-browser AI agent** — it perceives the live page, asks an LLM what to do,
|
package/dist/humanize.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { Browser, BrowserContext, Page } from "playwright-core";
|
|
2
2
|
export interface HumanizeOptions {
|
|
3
|
-
/**
|
|
3
|
+
/** Humanize all input (move/click/drag/scroll/type) as native trusted events. */
|
|
4
4
|
humanize?: boolean;
|
|
5
5
|
/** Show a red cursor dot that tracks the motion (visualization). */
|
|
6
6
|
showCursor?: boolean;
|
|
7
7
|
}
|
|
8
8
|
/** Overlay: a red dot that follows real mousemove events. Idempotent IIFE so it works both as
|
|
9
|
-
* an addInitScript source string AND when passed to page.evaluate
|
|
10
|
-
* string as an uncalled expression — an IIFE actually runs). */
|
|
9
|
+
* an addInitScript source string AND when passed to page.evaluate. */
|
|
11
10
|
export declare const CURSOR_OVERLAY = "(() => {\n if (window.__clearcoteCursor) return; window.__clearcoteCursor = 1;\n const make = () => {\n if (document.getElementById('__clearcote_cursor')) return;\n const d = document.createElement('div'); d.id = '__clearcote_cursor';\n d.style.cssText = 'position:fixed;left:0;top:0;width:20px;height:20px;margin:-10px 0 0 -10px;' +\n 'border-radius:50%;border:2px solid #ff3b3b;background:rgba(255,59,59,.22);' +\n 'box-shadow:0 0 10px rgba(255,59,59,.6);pointer-events:none;z-index:2147483647';\n (document.body || document.documentElement).appendChild(d);\n };\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', make); else make();\n document.addEventListener('mousemove', (e) => {\n const d = document.getElementById('__clearcote_cursor');\n if (d) { d.style.left = e.clientX + 'px'; d.style.top = e.clientY + 'px'; }\n }, true);\n})();";
|
|
12
11
|
/** Wrap a single page's input methods + (optionally) inject the cursor overlay. */
|
|
13
12
|
export declare function attachHumanize(browser: Browser, page: Page, opts: HumanizeOptions): Promise<void>;
|
package/dist/humanize.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"humanize.d.ts","sourceRoot":"","sources":["../src/humanize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"humanize.d.ts","sourceRoot":"","sources":["../src/humanize.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAW,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE9E,MAAM,WAAW,eAAe;IAC9B,iFAAiF;IACjF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oEAAoE;IACpE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;sEACsE;AACtE,eAAO,MAAM,cAAc,o5BAerB,CAAC;AA+BP,mFAAmF;AACnF,wBAAsB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA+OvG;AAiGD,mGAAmG;AACnG,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,GAAG,IAAI,CAc7E;AAED,0FAA0F;AAC1F,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,GACvE,IAAI,CAQN"}
|
package/dist/humanize.js
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
// Humanized input + cursor visualization.
|
|
2
2
|
//
|
|
3
|
-
// `humanize: true`
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
3
|
+
// `humanize: true` installs ONE consistent human-input standard covering moving, clicking,
|
|
4
|
+
// dragging, scrolling and typing — dispatched as native trusted input (isTrusted===true,
|
|
5
|
+
// navigator.webdriver stays false). It works whether you drive the page directly or via
|
|
6
|
+
// locators:
|
|
7
|
+
// page level — page.click / hover / dblclick / type / fill / press, page.mouse.move /
|
|
8
|
+
// click / wheel and held-button drags (down -> move -> up), page.keyboard.type
|
|
9
|
+
// locator level — locator.click / type / fill / hover / dblclick / press /
|
|
10
|
+
// pressSequentially / clear / check / uncheck / tap / dragTo (routed through
|
|
11
|
+
// the humanized page methods; main-frame locators only, native fallback)
|
|
12
|
+
// `showCursor: true` — injects a red cursor dot that follows the real mousemove events.
|
|
8
13
|
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
14
|
+
// Mouse moves build an eased, slightly bowed cubic-bezier path SDK-side from the tracked cursor
|
|
15
|
+
// position (continuous — no snap back to 0,0) using Playwright's NATIVE mouse.move. Because it is
|
|
16
|
+
// native input, the button state is carried: down() -> move() -> up() is a real held-button drag
|
|
17
|
+
// (slider captchas work) with no separate CDP channel to desync. Typing goes key-by-key through
|
|
18
|
+
// the native keyboard (trusted; shift handled by the engine) with human inter-key timing. No
|
|
19
|
+
// special binary command required.
|
|
11
20
|
/** Overlay: a red dot that follows real mousemove events. Idempotent IIFE so it works both as
|
|
12
|
-
* an addInitScript source string AND when passed to page.evaluate
|
|
13
|
-
* string as an uncalled expression — an IIFE actually runs). */
|
|
21
|
+
* an addInitScript source string AND when passed to page.evaluate. */
|
|
14
22
|
export const CURSOR_OVERLAY = `(() => {
|
|
15
23
|
if (window.__clearcoteCursor) return; window.__clearcoteCursor = 1;
|
|
16
24
|
const make = () => {
|
|
@@ -28,11 +36,33 @@ export const CURSOR_OVERLAY = `(() => {
|
|
|
28
36
|
}, true);
|
|
29
37
|
})();`;
|
|
30
38
|
const rand = (a, b) => a + Math.random() * (b - a);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
40
|
+
// Standard-normal sample (Box–Muller) for sub-pixel path jitter.
|
|
41
|
+
function gauss() {
|
|
42
|
+
let u = 0, v = 0;
|
|
43
|
+
while (u === 0)
|
|
44
|
+
u = Math.random();
|
|
45
|
+
while (v === 0)
|
|
46
|
+
v = Math.random();
|
|
47
|
+
return Math.sqrt(-2 * Math.log(u)) * Math.cos(2 * Math.PI * v);
|
|
35
48
|
}
|
|
49
|
+
// Compact keyboard-adjacency map for realistic fat-finger typos.
|
|
50
|
+
const NEARBY = {
|
|
51
|
+
a: "sqwz", b: "vghn", c: "xdfv", d: "sfecx", e: "wrsdf", f: "dgrtcv",
|
|
52
|
+
g: "fhtyb", h: "gjybn", i: "ujko", j: "hkunm", k: "jloi", l: "kop",
|
|
53
|
+
m: "njk", n: "bhjm", o: "iklp", p: "ol", q: "wa", r: "edft",
|
|
54
|
+
s: "awedxz", t: "rfgy", u: "yhji", v: "cfgb", w: "qase", x: "zsdc",
|
|
55
|
+
y: "tghu", z: "asx",
|
|
56
|
+
};
|
|
57
|
+
function nearbyKey(ch) {
|
|
58
|
+
const lo = ch.toLowerCase();
|
|
59
|
+
const n = NEARBY[lo];
|
|
60
|
+
if (!n)
|
|
61
|
+
return ch;
|
|
62
|
+
const w = n[Math.floor(Math.random() * n.length)];
|
|
63
|
+
return ch === ch.toUpperCase() && ch !== ch.toLowerCase() ? w.toUpperCase() : w;
|
|
64
|
+
}
|
|
65
|
+
const SELECT_ALL = "Control+a"; // Clearcote ships a Windows binary; Control is correct.
|
|
36
66
|
/** Wrap a single page's input methods + (optionally) inject the cursor overlay. */
|
|
37
67
|
export async function attachHumanize(browser, page, opts) {
|
|
38
68
|
if (opts.showCursor) {
|
|
@@ -44,66 +74,218 @@ export async function attachHumanize(browser, page, opts) {
|
|
|
44
74
|
}
|
|
45
75
|
if (!opts.humanize)
|
|
46
76
|
return;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
let supported = true;
|
|
50
|
-
const humanizedMove = async (x, y, noClick, duration) => {
|
|
51
|
-
if (!supported)
|
|
52
|
-
return false;
|
|
53
|
-
try {
|
|
54
|
-
bsession ??= await browser.newBrowserCDPSession();
|
|
55
|
-
tid ??= await pageTargetId(page);
|
|
56
|
-
await bsession.send("Browser.humanizedClick", {
|
|
57
|
-
targetId: tid, x: Math.round(x), y: Math.round(y),
|
|
58
|
-
duration: duration ?? rand(0.45, 0.95), noClick,
|
|
59
|
-
});
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
|
-
catch (e) {
|
|
63
|
-
// older binary without the command -> stop trying, fall back to native input
|
|
64
|
-
supported = false;
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
77
|
+
// Tracked cursor position so each move continues from where the last one ended.
|
|
78
|
+
const st = { x: rand(140, 380), y: rand(90, 240) };
|
|
68
79
|
const mouse = page.mouse;
|
|
69
80
|
const nativeMove = mouse.move.bind(mouse);
|
|
70
81
|
const nativeClick = mouse.click.bind(mouse);
|
|
71
82
|
const nativeWheel = mouse.wheel.bind(mouse);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
83
|
+
// Move from the tracked position to (x, y) along an eased, slightly bowed cubic-bezier path,
|
|
84
|
+
// emitting native (trusted) mousemove events the whole way. Native input means a button pressed
|
|
85
|
+
// via mouse.down() stays pressed across the glide — so the same code powers move AND drag.
|
|
86
|
+
const glide = async (x, y, jitter = 0.6) => {
|
|
87
|
+
const x0 = st.x, y0 = st.y;
|
|
88
|
+
const dx = x - x0, dy = y - y0;
|
|
89
|
+
const dist = Math.hypot(dx, dy);
|
|
90
|
+
const steps = Math.floor(Math.max(10, Math.min(38, dist / 14)));
|
|
91
|
+
const nx = dist > 1e-6 ? -dy / dist : 0;
|
|
92
|
+
const ny = dist > 1e-6 ? dx / dist : 0;
|
|
93
|
+
const bow = (Math.random() * 0.22 - 0.11) * dist;
|
|
94
|
+
const cp1x = x0 + dx * 0.33 + nx * bow, cp1y = y0 + dy * 0.33 + ny * bow;
|
|
95
|
+
const cp2x = x0 + dx * 0.66 + nx * bow, cp2y = y0 + dy * 0.66 + ny * bow;
|
|
96
|
+
for (let i = 1; i <= steps; i++) {
|
|
97
|
+
const t = i / steps;
|
|
98
|
+
const e = t * t * (3 - 2 * t); // smoothstep: slow out of start, slow into target
|
|
99
|
+
const mt = 1 - e;
|
|
100
|
+
const bx = mt * mt * mt * x0 + 3 * mt * mt * e * cp1x + 3 * mt * e * e * cp2x + e * e * e * x;
|
|
101
|
+
const by = mt * mt * mt * y0 + 3 * mt * mt * e * cp1y + 3 * mt * e * e * cp2y + e * e * e * y;
|
|
102
|
+
try {
|
|
103
|
+
await nativeMove(bx + gauss() * jitter, by + gauss() * jitter);
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
await sleep(rand(7, 20)); // off-protocol pacing, ~60fps-ish
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
await nativeMove(x, y);
|
|
112
|
+
}
|
|
113
|
+
catch { /* exact landing best-effort */ }
|
|
114
|
+
st.x = x;
|
|
115
|
+
st.y = y;
|
|
75
116
|
};
|
|
76
|
-
mouse.
|
|
77
|
-
|
|
78
|
-
|
|
117
|
+
mouse.move = async (x, y) => { await glide(x, y); };
|
|
118
|
+
mouse.click = async (x, y) => {
|
|
119
|
+
await glide(x, y);
|
|
120
|
+
await sleep(rand(40, 130)); // brief dwell before pressing, like a human
|
|
121
|
+
try {
|
|
122
|
+
await nativeClick(x, y);
|
|
123
|
+
}
|
|
124
|
+
catch { /* best-effort */ }
|
|
79
125
|
};
|
|
80
|
-
// scroll easing
|
|
126
|
+
// scroll easing: break into eased chunks of native wheel deltas
|
|
81
127
|
mouse.wheel = async (dx, dy) => {
|
|
82
128
|
const steps = Math.max(5, Math.min(20, Math.round((Math.abs(dx) + Math.abs(dy)) / 80)));
|
|
83
129
|
const ease = (u) => u * u * (3 - 2 * u);
|
|
84
130
|
let px = 0, py = 0;
|
|
85
131
|
for (let i = 1; i <= steps; i++) {
|
|
86
132
|
const f = ease(i / steps);
|
|
87
|
-
const
|
|
88
|
-
await nativeWheel(
|
|
89
|
-
px =
|
|
90
|
-
py =
|
|
133
|
+
const nxw = Math.round(dx * f), nyw = Math.round(dy * f);
|
|
134
|
+
await nativeWheel(nxw - px, nyw - py);
|
|
135
|
+
px = nxw;
|
|
136
|
+
py = nyw;
|
|
91
137
|
// local sleep, NOT page.waitForTimeout: the latter is a CDP round-trip per call, so it
|
|
92
138
|
// emits protocol traffic bot-detectors (e.g. reCAPTCHA) can score — a self-inflicted tell
|
|
93
139
|
// inside the humanize path. setTimeout is off-protocol.
|
|
94
|
-
await
|
|
140
|
+
await sleep(rand(12, 45));
|
|
95
141
|
}
|
|
96
142
|
if (px !== dx || py !== dy)
|
|
97
143
|
await nativeWheel(dx - px, dy - py);
|
|
98
144
|
};
|
|
145
|
+
// ----------------------------------------------------------------- keyboard
|
|
146
|
+
const keyboard = page.keyboard;
|
|
147
|
+
const nativeKbType = keyboard.type.bind(keyboard);
|
|
148
|
+
const nativeKbPress = keyboard.press.bind(keyboard);
|
|
149
|
+
// Type text key-by-key with human timing. Each char goes through the native keyboard (trusted;
|
|
150
|
+
// shift/symbols handled by the engine), so this stays isTrusted===true.
|
|
151
|
+
const humanTypeText = async (text) => {
|
|
152
|
+
const n = text.length;
|
|
153
|
+
for (let i = 0; i < n; i++) {
|
|
154
|
+
const ch = text[i];
|
|
155
|
+
if (/[a-zA-Z0-9]/.test(ch) && Math.random() < 0.02) {
|
|
156
|
+
try {
|
|
157
|
+
await nativeKbType(nearbyKey(ch));
|
|
158
|
+
await sleep(rand(120, 300));
|
|
159
|
+
await nativeKbPress("Backspace");
|
|
160
|
+
await sleep(rand(80, 200));
|
|
161
|
+
}
|
|
162
|
+
catch { /* typo path best-effort */ }
|
|
163
|
+
}
|
|
164
|
+
try {
|
|
165
|
+
await nativeKbType(ch);
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
if (i < n - 1) {
|
|
171
|
+
if (Math.random() < 0.06)
|
|
172
|
+
await sleep(rand(180, 450)); // brief thinking pause
|
|
173
|
+
else
|
|
174
|
+
await sleep(rand(45, 150));
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
keyboard.type = async (text) => { await humanTypeText(text); };
|
|
179
|
+
// ------------------------------------------------------- page-level targeted helpers
|
|
180
|
+
const isFocused = async (selector) => {
|
|
181
|
+
try {
|
|
182
|
+
return await page.evaluate((s) => {
|
|
183
|
+
const e = globalThis.document.querySelector(s);
|
|
184
|
+
return !!e && e === globalThis.document.activeElement;
|
|
185
|
+
}, selector);
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
const pointFor = async (selector, timeout) => {
|
|
192
|
+
const loc = page.locator(selector).first();
|
|
193
|
+
await loc.waitFor({ state: "visible", timeout });
|
|
194
|
+
await loc.scrollIntoViewIfNeeded({ timeout });
|
|
195
|
+
if (!(await loc.isEnabled()))
|
|
196
|
+
return null;
|
|
197
|
+
let box = await loc.boundingBox();
|
|
198
|
+
if (!box)
|
|
199
|
+
return null;
|
|
200
|
+
await sleep(50); // stability: a box that's still moving = an animation in flight
|
|
201
|
+
const box2 = await loc.boundingBox();
|
|
202
|
+
if (!box2 || Math.abs(box2.x - box.x) > 1 || Math.abs(box2.y - box.y) > 1)
|
|
203
|
+
return null;
|
|
204
|
+
box = box2;
|
|
205
|
+
return { x: box.x + box.width * rand(0.3, 0.7), y: box.y + box.height * rand(0.3, 0.7) };
|
|
206
|
+
};
|
|
207
|
+
const focusClick = async (selector, timeout) => {
|
|
208
|
+
const pt = await pointFor(selector, timeout);
|
|
209
|
+
if (!pt)
|
|
210
|
+
return false;
|
|
211
|
+
await glide(pt.x, pt.y);
|
|
212
|
+
await sleep(rand(40, 130));
|
|
213
|
+
await nativeClick(pt.x, pt.y);
|
|
214
|
+
return true;
|
|
215
|
+
};
|
|
216
|
+
const nativePageType = page.type ? page.type.bind(page) : null;
|
|
217
|
+
const nativePageFill = page.fill.bind(page);
|
|
218
|
+
const nativePagePress = page.press.bind(page);
|
|
219
|
+
const nativePageDblclick = page.dblclick.bind(page);
|
|
220
|
+
page.type = async (selector, text, options = {}) => {
|
|
221
|
+
try {
|
|
222
|
+
const timeout = options.timeout ?? 30000;
|
|
223
|
+
if (!(await isFocused(selector))) {
|
|
224
|
+
if (!(await focusClick(selector, timeout))) {
|
|
225
|
+
return nativePageType ? nativePageType(selector, text, options) : nativePageFill(selector, text, options);
|
|
226
|
+
}
|
|
227
|
+
await sleep(rand(40, 120));
|
|
228
|
+
}
|
|
229
|
+
await humanTypeText(text);
|
|
230
|
+
}
|
|
231
|
+
catch {
|
|
232
|
+
return nativePageType ? nativePageType(selector, text, options) : nativePageFill(selector, text, options);
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
page.fill = async (selector, value, options = {}) => {
|
|
236
|
+
try {
|
|
237
|
+
const timeout = options.timeout ?? 30000;
|
|
238
|
+
if (value.length > 200)
|
|
239
|
+
return nativePageFill(selector, value, options); // bulk -> atomic
|
|
240
|
+
if (!(await focusClick(selector, timeout)))
|
|
241
|
+
return nativePageFill(selector, value, options);
|
|
242
|
+
await sleep(rand(40, 120));
|
|
243
|
+
try {
|
|
244
|
+
await nativeKbPress(SELECT_ALL);
|
|
245
|
+
await sleep(rand(30, 80));
|
|
246
|
+
await nativeKbPress("Backspace");
|
|
247
|
+
await sleep(rand(40, 120));
|
|
248
|
+
}
|
|
249
|
+
catch { /* clear best-effort */ }
|
|
250
|
+
await humanTypeText(value);
|
|
251
|
+
}
|
|
252
|
+
catch {
|
|
253
|
+
return nativePageFill(selector, value, options);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
page.dblclick = async (selector, options = {}) => {
|
|
257
|
+
try {
|
|
258
|
+
const timeout = options.timeout ?? 30000;
|
|
259
|
+
const pt = await pointFor(selector, timeout);
|
|
260
|
+
if (!pt)
|
|
261
|
+
return nativePageDblclick(selector, options);
|
|
262
|
+
await glide(pt.x, pt.y);
|
|
263
|
+
await sleep(rand(40, 130));
|
|
264
|
+
await nativeClick(pt.x, pt.y, { clickCount: 2, delay: rand(40, 90) });
|
|
265
|
+
}
|
|
266
|
+
catch {
|
|
267
|
+
return nativePageDblclick(selector, options);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
page.press = async (selector, key, options = {}) => {
|
|
271
|
+
try {
|
|
272
|
+
const timeout = options.timeout ?? 30000;
|
|
273
|
+
if (!(await isFocused(selector))) {
|
|
274
|
+
if (!(await focusClick(selector, timeout)))
|
|
275
|
+
return nativePagePress(selector, key, options);
|
|
276
|
+
await sleep(rand(40, 120));
|
|
277
|
+
}
|
|
278
|
+
await nativeKbPress(key);
|
|
279
|
+
}
|
|
280
|
+
catch {
|
|
281
|
+
return nativePagePress(selector, key, options);
|
|
282
|
+
}
|
|
283
|
+
};
|
|
99
284
|
const wrapTargeted = (name, noClick) => {
|
|
100
285
|
const orig = page[name].bind(page);
|
|
101
286
|
page[name] = async (selector, options = {}) => {
|
|
102
|
-
// Actionability pre-flight before a TRUSTED humanized click:
|
|
103
|
-
//
|
|
104
|
-
// event at a point, so without these checks it could fire under a cookie banner/overlay or
|
|
105
|
-
// mid-animation. Each check falls back to the native click (which has its own actionability
|
|
106
|
-
// waits), so this only improves — it never regresses.
|
|
287
|
+
// Actionability pre-flight before a TRUSTED humanized click: visible+enabled+stable+
|
|
288
|
+
// not-covered, else fall back to the native click (which has its own waits) — only improves.
|
|
107
289
|
try {
|
|
108
290
|
const timeout = options.timeout ?? 30000;
|
|
109
291
|
const loc = page.locator(selector).first();
|
|
@@ -114,8 +296,7 @@ export async function attachHumanize(browser, page, opts) {
|
|
|
114
296
|
let box = await loc.boundingBox();
|
|
115
297
|
if (!box)
|
|
116
298
|
return orig(selector, options);
|
|
117
|
-
|
|
118
|
-
await new Promise((r) => setTimeout(r, 50));
|
|
299
|
+
await sleep(50);
|
|
119
300
|
const box2 = await loc.boundingBox();
|
|
120
301
|
if (!box2 || Math.abs(box2.x - box.x) > 1 || Math.abs(box2.y - box.y) > 1) {
|
|
121
302
|
return orig(selector, options);
|
|
@@ -123,8 +304,6 @@ export async function attachHumanize(browser, page, opts) {
|
|
|
123
304
|
box = box2;
|
|
124
305
|
const x = box.x + box.width * rand(0.3, 0.7);
|
|
125
306
|
const y = box.y + box.height * rand(0.3, 0.7);
|
|
126
|
-
// covered-by: don't fire a trusted click at a point some overlay owns. The callback runs
|
|
127
|
-
// in the browser; this is a Node tsconfig (no DOM lib), so reach document via globalThis.
|
|
128
307
|
try {
|
|
129
308
|
const handle = await loc.elementHandle();
|
|
130
309
|
const covered = handle &&
|
|
@@ -135,12 +314,13 @@ export async function attachHumanize(browser, page, opts) {
|
|
|
135
314
|
if (covered)
|
|
136
315
|
return orig(selector, options); // covered -> let PW wait for it on top
|
|
137
316
|
}
|
|
138
|
-
catch {
|
|
139
|
-
|
|
317
|
+
catch { /* covered-by check best-effort */ }
|
|
318
|
+
await glide(x, y);
|
|
319
|
+
if (!noClick) {
|
|
320
|
+
await sleep(rand(40, 130));
|
|
321
|
+
await nativeClick(x, y);
|
|
140
322
|
}
|
|
141
|
-
|
|
142
|
-
return;
|
|
143
|
-
return orig(selector, options);
|
|
323
|
+
return;
|
|
144
324
|
}
|
|
145
325
|
catch {
|
|
146
326
|
return orig(selector, options);
|
|
@@ -149,6 +329,163 @@ export async function attachHumanize(browser, page, opts) {
|
|
|
149
329
|
};
|
|
150
330
|
wrapTargeted("click", false);
|
|
151
331
|
wrapTargeted("hover", true);
|
|
332
|
+
// Marker the Locator-class patch keys off: humanize is active for THIS page.
|
|
333
|
+
page._clearcoteHumanized = true;
|
|
334
|
+
patchLocatorClass(page.locator("html"));
|
|
335
|
+
}
|
|
336
|
+
// --------------------------------------------------------------------------- locator patch
|
|
337
|
+
let locatorPatched = false;
|
|
338
|
+
/** Patch the Locator prototype once so locator.* interactions route through the humanized page.*
|
|
339
|
+
* methods. Each is a no-op unless the locator's page has humanize active AND the locator targets
|
|
340
|
+
* the main frame; anything else (frame locators, exotic selectors, errors) falls through to the
|
|
341
|
+
* original Playwright behaviour. Composes if another library already patched the prototype. */
|
|
342
|
+
function patchLocatorClass(sample) {
|
|
343
|
+
if (locatorPatched)
|
|
344
|
+
return;
|
|
345
|
+
locatorPatched = true;
|
|
346
|
+
const proto = Object.getPrototypeOf(sample);
|
|
347
|
+
if (!proto)
|
|
348
|
+
return;
|
|
349
|
+
const oFill = proto.fill, oClick = proto.click, oType = proto.type, oDbl = proto.dblclick, oHover = proto.hover, oPress = proto.press, oPressSeq = proto.pressSequentially, oClear = proto.clear, oTap = proto.tap, oCheck = proto.check, oUncheck = proto.uncheck, oDragTo = proto.dragTo;
|
|
350
|
+
const on = (self) => {
|
|
351
|
+
const pg = self.page();
|
|
352
|
+
if (!pg || !pg._clearcoteHumanized)
|
|
353
|
+
return false;
|
|
354
|
+
try {
|
|
355
|
+
return self._frame === pg.mainFrame();
|
|
356
|
+
}
|
|
357
|
+
catch {
|
|
358
|
+
return false;
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
const sel = (self) => self._selector;
|
|
362
|
+
const fwd = (kw) => (kw && kw.timeout != null ? { timeout: kw.timeout } : {});
|
|
363
|
+
proto.fill = async function (value, kw = {}) {
|
|
364
|
+
if (on(this)) {
|
|
365
|
+
try {
|
|
366
|
+
return await this.page().fill(sel(this), value, fwd(kw));
|
|
367
|
+
}
|
|
368
|
+
catch { /* fall back */ }
|
|
369
|
+
}
|
|
370
|
+
return oFill.call(this, value, kw);
|
|
371
|
+
};
|
|
372
|
+
proto.click = async function (kw = {}) {
|
|
373
|
+
if (on(this)) {
|
|
374
|
+
try {
|
|
375
|
+
return await this.page().click(sel(this), fwd(kw));
|
|
376
|
+
}
|
|
377
|
+
catch { /* fall back */ }
|
|
378
|
+
}
|
|
379
|
+
return oClick.call(this, kw);
|
|
380
|
+
};
|
|
381
|
+
proto.type = async function (text, kw = {}) {
|
|
382
|
+
if (on(this)) {
|
|
383
|
+
try {
|
|
384
|
+
return await this.page().type(sel(this), text, fwd(kw));
|
|
385
|
+
}
|
|
386
|
+
catch { /* fall back */ }
|
|
387
|
+
}
|
|
388
|
+
return oType.call(this, text, kw);
|
|
389
|
+
};
|
|
390
|
+
proto.dblclick = async function (kw = {}) {
|
|
391
|
+
if (on(this)) {
|
|
392
|
+
try {
|
|
393
|
+
return await this.page().dblclick(sel(this), fwd(kw));
|
|
394
|
+
}
|
|
395
|
+
catch { /* fall back */ }
|
|
396
|
+
}
|
|
397
|
+
return oDbl.call(this, kw);
|
|
398
|
+
};
|
|
399
|
+
proto.hover = async function (kw = {}) {
|
|
400
|
+
if (on(this)) {
|
|
401
|
+
try {
|
|
402
|
+
return await this.page().hover(sel(this), fwd(kw));
|
|
403
|
+
}
|
|
404
|
+
catch { /* fall back */ }
|
|
405
|
+
}
|
|
406
|
+
return oHover.call(this, kw);
|
|
407
|
+
};
|
|
408
|
+
proto.press = async function (key, kw = {}) {
|
|
409
|
+
if (on(this)) {
|
|
410
|
+
try {
|
|
411
|
+
return await this.page().press(sel(this), key, fwd(kw));
|
|
412
|
+
}
|
|
413
|
+
catch { /* fall back */ }
|
|
414
|
+
}
|
|
415
|
+
return oPress.call(this, key, kw);
|
|
416
|
+
};
|
|
417
|
+
proto.pressSequentially = async function (text, kw = {}) {
|
|
418
|
+
if (on(this)) {
|
|
419
|
+
try {
|
|
420
|
+
return await this.page().type(sel(this), text, fwd(kw));
|
|
421
|
+
}
|
|
422
|
+
catch { /* fall back */ }
|
|
423
|
+
}
|
|
424
|
+
return oPressSeq.call(this, text, kw);
|
|
425
|
+
};
|
|
426
|
+
proto.clear = async function (kw = {}) {
|
|
427
|
+
if (on(this)) {
|
|
428
|
+
try {
|
|
429
|
+
return await this.page().fill(sel(this), "", fwd(kw));
|
|
430
|
+
}
|
|
431
|
+
catch { /* fall back */ }
|
|
432
|
+
}
|
|
433
|
+
return oClear.call(this, kw);
|
|
434
|
+
};
|
|
435
|
+
proto.tap = async function (kw = {}) {
|
|
436
|
+
if (on(this)) {
|
|
437
|
+
try {
|
|
438
|
+
return await this.page().click(sel(this), fwd(kw));
|
|
439
|
+
}
|
|
440
|
+
catch { /* fall back */ }
|
|
441
|
+
}
|
|
442
|
+
return oTap.call(this, kw);
|
|
443
|
+
};
|
|
444
|
+
proto.check = async function (kw = {}) {
|
|
445
|
+
if (on(this)) {
|
|
446
|
+
try {
|
|
447
|
+
if (!(await this.isChecked()))
|
|
448
|
+
return await this.page().click(sel(this), fwd(kw));
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
catch { /* fall back */ }
|
|
452
|
+
}
|
|
453
|
+
return oCheck.call(this, kw);
|
|
454
|
+
};
|
|
455
|
+
proto.uncheck = async function (kw = {}) {
|
|
456
|
+
if (on(this)) {
|
|
457
|
+
try {
|
|
458
|
+
if (await this.isChecked())
|
|
459
|
+
return await this.page().click(sel(this), fwd(kw));
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
catch { /* fall back */ }
|
|
463
|
+
}
|
|
464
|
+
return oUncheck.call(this, kw);
|
|
465
|
+
};
|
|
466
|
+
proto.dragTo = async function (target, kw = {}) {
|
|
467
|
+
if (on(this)) {
|
|
468
|
+
try {
|
|
469
|
+
const pg = this.page();
|
|
470
|
+
const sb = await this.boundingBox();
|
|
471
|
+
const tb = await target.boundingBox();
|
|
472
|
+
if (sb && tb) {
|
|
473
|
+
const sx = sb.x + sb.width / 2, sy = sb.y + sb.height / 2;
|
|
474
|
+
const tx = tb.x + tb.width / 2, ty = tb.y + tb.height / 2;
|
|
475
|
+
await pg.mouse.move(sx, sy);
|
|
476
|
+
await sleep(rand(100, 200));
|
|
477
|
+
await pg.mouse.down();
|
|
478
|
+
await sleep(rand(80, 150)); // native -> button held across glide
|
|
479
|
+
await pg.mouse.move(tx, ty);
|
|
480
|
+
await sleep(rand(80, 150)); // humanized held-button drag
|
|
481
|
+
await pg.mouse.up();
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
catch { /* fall back */ }
|
|
486
|
+
}
|
|
487
|
+
return oDragTo.call(this, target, kw);
|
|
488
|
+
};
|
|
152
489
|
}
|
|
153
490
|
/** Install humanize/showCursor on a browser: wraps newPage/newContext so every page is covered. */
|
|
154
491
|
export function installHumanize(browser, opts) {
|
package/dist/humanize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"humanize.js","sourceRoot":"","sources":["../src/humanize.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,EAAE;AACF,0FAA0F;AAC1F,gGAAgG;AAChG,wFAAwF;AACxF,kGAAkG;AAClG,mFAAmF;AACnF,EAAE;AACF,8FAA8F;AAC9F,oGAAoG;AAWpG;;gEAEgE;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;MAexB,CAAC;AAEP,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEnE,KAAK,UAAU,YAAY,CAAC,IAAU;IACpC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,IAAI,GAAQ,MAAM,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC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AC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { type FingerprintOptions } from "./fingerprint.js";
|
|
|
4
4
|
import { type HumanizeOptions } from "./humanize.js";
|
|
5
5
|
import { type AgentOptions } from "./agent.js";
|
|
6
6
|
import { Profile } from "./profile.js";
|
|
7
|
+
import { fetchWidevine, seedWidevine } from "./widevine.js";
|
|
7
8
|
export type { FingerprintOptions } from "./fingerprint.js";
|
|
8
9
|
export type { DownloadOptions } from "./download.js";
|
|
9
10
|
export { resolveGeo, type Geo } from "./geoip.js";
|
|
@@ -11,6 +12,7 @@ export type { HumanizeOptions } from "./humanize.js";
|
|
|
11
12
|
export { Profile, listProfiles, loadProfile, PROFILE_DIR, type ProfileOptions } from "./profile.js";
|
|
12
13
|
export { runAgentTask, agentArgs, OPENROUTER_BASE_URL, type AgentOptions, type AgentTaskOptions, type AgentTaskResult, type AgentStep, } from "./agent.js";
|
|
13
14
|
export { RELEASE } from "./release.js";
|
|
15
|
+
export { fetchWidevine, seedWidevine } from "./widevine.js";
|
|
14
16
|
/** When true (and a proxy is set), resolve the proxy's exit-IP geo and auto-fill any unset
|
|
15
17
|
* `timezone` + `acceptLanguage` (+ `location`) so they match the proxy region. */
|
|
16
18
|
interface GeoipOption {
|
|
@@ -35,6 +37,13 @@ export interface LaunchOptions extends PlaywrightLaunchOptions, FingerprintOptio
|
|
|
35
37
|
}
|
|
36
38
|
/** Options for {@link launchPersistentContext}. */
|
|
37
39
|
export interface PersistentContextOptions extends PlaywrightLaunchOptions, BrowserContextOptions, FingerprintOptions, AgentOptions, GeoipOption, ProfileOption, ExtensionsOption, HumanizeOptions, DownloadOptions {
|
|
40
|
+
/**
|
|
41
|
+
* Seed + enable the opt-in Widevine CDM in this profile so DRM/EME works
|
|
42
|
+
* (`requestMediaKeySystemAccess('com.widevine.alpha')` resolves) and the EME surface matches a
|
|
43
|
+
* real Chrome instead of being a no-Widevine tell. The CDM is fetched once from Google's
|
|
44
|
+
* component server (see {@link fetchWidevine}); clearcote never bundles Google's blob.
|
|
45
|
+
*/
|
|
46
|
+
widevine?: boolean;
|
|
38
47
|
}
|
|
39
48
|
/**
|
|
40
49
|
* Resolve the Clearcote chrome.exe path, downloading + verifying it if needed.
|
|
@@ -87,6 +96,8 @@ declare const _default: {
|
|
|
87
96
|
Profile: typeof Profile;
|
|
88
97
|
listProfiles: typeof listProfiles;
|
|
89
98
|
loadProfile: typeof loadProfile;
|
|
99
|
+
fetchWidevine: typeof fetchWidevine;
|
|
100
|
+
seedWidevine: typeof seedWidevine;
|
|
90
101
|
RELEASE: import("./release.js").ReleaseInfo;
|
|
91
102
|
};
|
|
92
103
|
export default _default;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,qBAAqB,EACrB,aAAa,IAAI,uBAAuB,EACzC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAgB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAA4C,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAErG,OAAO,EAA6C,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAChG,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAyB,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,qBAAqB,EACrB,aAAa,IAAI,uBAAuB,EACzC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAgB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;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ProfileOptions, Profile } from "./profile.js";
|
|
22
22
|
import { extensionArgs, resolveProxy, mergeFeatureFlags, privacySandboxArgs, webrtcDefaultDenyArgs, } from "./launchopts.js";
|
|
23
23
|
import { RELEASE } from "./release.js";
|
|
24
|
+
import { fetchWidevine, seedWidevine, widevineArgs } from "./widevine.js";
|
|
24
25
|
export { resolveGeo } from "./geoip.js";
|
|
25
26
|
export { Profile, listProfiles, loadProfile, PROFILE_DIR } from "./profile.js";
|
|
26
27
|
export { runAgentTask, agentArgs, OPENROUTER_BASE_URL, } from "./agent.js";
|
|
27
28
|
export { RELEASE } from "./release.js";
|
|
29
|
+
export { fetchWidevine, seedWidevine } from "./widevine.js";
|
|
28
30
|
/** Fill unset timezone/acceptLanguage/location/webrtcIp on `fp` from the proxy's exit-IP geo. */
|
|
29
31
|
async function applyGeoip(fp, proxy) {
|
|
30
32
|
const geo = await resolveGeo(proxy);
|
|
@@ -116,7 +118,7 @@ export async function launch(options = {}) {
|
|
|
116
118
|
*/
|
|
117
119
|
export async function launchPersistentContext(userDataDir, options = {}) {
|
|
118
120
|
const merged = options.profile ? { ...resolveProfileOptions(options.profile), ...options } : options;
|
|
119
|
-
const { profile: _profile, extensions, disablePrivacySandbox, executablePath: exeOption, args, geoip, humanize, showCursor, autoUpdate, cacheDir, quiet, ...rest } = merged;
|
|
121
|
+
const { profile: _profile, extensions, disablePrivacySandbox, executablePath: exeOption, args, geoip, humanize, showCursor, autoUpdate, cacheDir, quiet, widevine, ...rest } = merged;
|
|
120
122
|
const { fingerprint, rest: afterFp } = splitFingerprintOptions(rest);
|
|
121
123
|
const { agent, rest: pwOptions } = splitAgentOptions(afterFp);
|
|
122
124
|
if (geoip)
|
|
@@ -128,12 +130,32 @@ export async function launchPersistentContext(userDataDir, options = {}) {
|
|
|
128
130
|
// headed + no explicit viewport -> disable the emulated viewport (impossible-window tell)
|
|
129
131
|
if (opts.headless === false && opts.viewport === undefined)
|
|
130
132
|
opts.viewport = null;
|
|
133
|
+
// widevine=true: seed the CDM into the profile + un-suppress the component updater (Playwright
|
|
134
|
+
// disables it by default) so the engine registers it. Failure -> DRM gracefully off, launch proceeds.
|
|
135
|
+
let userArgs = args ?? [];
|
|
136
|
+
if (widevine) {
|
|
137
|
+
try {
|
|
138
|
+
await seedWidevine(userDataDir, { quiet });
|
|
139
|
+
// a user-supplied non-fast-update --component-updater mode wins but may not register the CDM
|
|
140
|
+
const cu = userArgs.filter((a) => a.includes("component-updater"));
|
|
141
|
+
if (cu.length && !cu.some((a) => a.includes("fast-update")) && !quiet) {
|
|
142
|
+
process.stderr.write("[clearcote] [widevine] note: your --component-updater mode may not register the CDM; --component-updater=fast-update is needed to scan the pre-installed component\n");
|
|
143
|
+
}
|
|
144
|
+
const tweak = widevineArgs(opts.ignoreDefaultArgs, userArgs);
|
|
145
|
+
opts.ignoreDefaultArgs = tweak.ignoreDefaultArgs;
|
|
146
|
+
userArgs = tweak.args;
|
|
147
|
+
}
|
|
148
|
+
catch (e) {
|
|
149
|
+
if (!quiet)
|
|
150
|
+
process.stderr.write(`[clearcote] [widevine] setup failed (continuing without DRM): ${String(e)}\n`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
131
153
|
const exe = await executablePath({ executablePath: exeOption, autoUpdate, cacheDir, quiet });
|
|
132
154
|
ensureRunnableHere(exe);
|
|
133
155
|
const context = await chromium.launchPersistentContext(userDataDir, {
|
|
134
156
|
...opts,
|
|
135
157
|
executablePath: exe,
|
|
136
|
-
args: assembleArgs(fingerprintArgs(fingerprint), agentArgs(agent), extensionArgs(extensions), proxyArgs, disablePrivacySandbox, fingerprint.webrtcIp,
|
|
158
|
+
args: assembleArgs(fingerprintArgs(fingerprint), agentArgs(agent), extensionArgs(extensions), proxyArgs, disablePrivacySandbox, fingerprint.webrtcIp, userArgs),
|
|
137
159
|
});
|
|
138
160
|
installHumanizeOnContext(context, { humanize, showCursor });
|
|
139
161
|
return context;
|
|
@@ -172,6 +194,8 @@ export default {
|
|
|
172
194
|
Profile,
|
|
173
195
|
listProfiles,
|
|
174
196
|
loadProfile,
|
|
197
|
+
fetchWidevine,
|
|
198
|
+
seedWidevine,
|
|
175
199
|
RELEASE,
|
|
176
200
|
};
|
|
177
201
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,EAAE;AACF,wCAAwC;AACxC,oFAAoF;AACpF,0CAA0C;AAC1C,iEAAiE;AACjE,EAAE;AACF,4FAA4F;AAC5F,gGAAgG;AAChG,gGAAgG;AAChG,sBAAsB;AAEtB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAOjC,OAAO,EAAE,YAAY,EAAwB,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAA2B,MAAM,kBAAkB,CAAC;AACrG,OAAO,EAAE,UAAU,EAAY,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAwB,MAAM,eAAe,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAqB,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,GAEtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,EAAE;AACF,wCAAw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AAM;IACN,uBAAuB;IACvB,WAAW;IACX,cAAc;IACd,QAAQ;IACR,YAAY;IACZ,OAAO;IACP,YAAY;IACZ,WAAW;IACX,aAAa;IACb,YAAY;IACZ,OAAO;CACR,CAAC"}
|
package/dist/release.js
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
// this package, the hash check guarantees you run exactly the published, signed binary.
|
|
5
5
|
// Published checksums + GPG signatures live on the release page.
|
|
6
6
|
export const RELEASE = {
|
|
7
|
-
tag: "v0.1.0-pre.
|
|
7
|
+
tag: "v0.1.0-pre.15",
|
|
8
8
|
version: "149.0.7827.114",
|
|
9
9
|
asset: "clearcote-149.0.7827.114-windows-x64.zip",
|
|
10
|
-
url: "https://github.com/clearcotelabs/clearcote-browser/releases/download/v0.1.0-pre.
|
|
11
|
-
sha256: "
|
|
10
|
+
url: "https://github.com/clearcotelabs/clearcote-browser/releases/download/v0.1.0-pre.15/clearcote-149.0.7827.114-windows-x64.zip",
|
|
11
|
+
sha256: "8fc279533a928c8c8614788000afa7ef95895859df9ea5438dee5a32a1a6e58a",
|
|
12
12
|
exeSha256: "5743595256c89c6874804bf3315acce592fc7f1883760c8d380c010151a73b23",
|
|
13
|
-
size:
|
|
13
|
+
size: 242646871,
|
|
14
14
|
os: "win32",
|
|
15
15
|
};
|
|
16
16
|
/** GitHub repo (owner/name) the releases come from — used by the opt-in auto-update resolver. */
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Chrome's component-updater app id for the Widevine CDM + Google's Omaha JSON endpoint. */
|
|
2
|
+
export declare const WIDEVINE_APP_ID = "oimompecagnajdejgnnjijobebaeigek";
|
|
3
|
+
export declare const OMAHA_URL = "https://update.googleapis.com/service/update2/json";
|
|
4
|
+
export declare const HINT_FILE = "latest-component-updated-widevine-cdm";
|
|
5
|
+
export interface WidevineOptions {
|
|
6
|
+
/** Destination root (default ~/.clearcote/WidevineCdm). */
|
|
7
|
+
dest?: string;
|
|
8
|
+
/** Suppress progress logging. */
|
|
9
|
+
quiet?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Minimal Omaha v3.1 update check for the Windows x64 Widevine CDM (version 0.0.0.0 -> latest). */
|
|
12
|
+
export declare function omahaRequestBody(): unknown;
|
|
13
|
+
/** Pull [downloadUrl, sha256, version] from an Omaha JSON response (pipelines or classic shape). */
|
|
14
|
+
export declare function parseUpdate(resp: any): [string, string, string];
|
|
15
|
+
/** A CRX3 file is 'Cr24' + u32 version + u32 headerLen + header + zip. Return the zip bytes. */
|
|
16
|
+
export declare function crx3ToZip(buf: Buffer): Buffer;
|
|
17
|
+
/**
|
|
18
|
+
* Download + verify the Windows x64 Widevine CDM into `dest` (default ~/.clearcote/WidevineCdm/
|
|
19
|
+
* <version>). Returns the versioned CDM directory (manifest.json + _platform_specific/win_x64/
|
|
20
|
+
* widevinecdm.dll). Re-fetch is skipped if already present.
|
|
21
|
+
*/
|
|
22
|
+
export declare function fetchWidevine(opts?: WidevineOptions): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Make a persistent profile load the fetched CDM: copy it under <userDataDir>/WidevineCdm/<version>/
|
|
25
|
+
* and write the component hint file the engine reads. Fetches the CDM first if needed.
|
|
26
|
+
*/
|
|
27
|
+
export declare function seedWidevine(userDataDir: string, opts?: WidevineOptions): Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Adjust launch args so the engine actually registers the seeded CDM: un-suppress the component
|
|
30
|
+
* updater (Playwright disables it by default) and force the startup scan. Pure — returns the new
|
|
31
|
+
* values. `ignoreDefaultArgs` may be a list, `undefined`, or the boolean form Playwright accepts
|
|
32
|
+
* (`true` = ignore ALL defaults, so the updater is already un-suppressed); only the list/undefined
|
|
33
|
+
* forms need `--disable-component-update` added. Verified: with these, requestMediaKeySystemAccess
|
|
34
|
+
* + createMediaKeys succeed.
|
|
35
|
+
*/
|
|
36
|
+
export declare function widevineArgs(ignoreDefaultArgs: string[] | boolean | undefined, userArgs: string[]): {
|
|
37
|
+
ignoreDefaultArgs: string[] | boolean | undefined;
|
|
38
|
+
args: string[];
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=widevine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widevine.d.ts","sourceRoot":"","sources":["../src/widevine.ts"],"names":[],"mappings":"AAmBA,6FAA6F;AAC7F,eAAO,MAAM,eAAe,qCAAqC,CAAC;AAClE,eAAO,MAAM,SAAS,uDAAuD,CAAC;AAC9E,eAAO,MAAM,SAAS,0CAA0C,CAAC;AAKjE,MAAM,WAAW,eAAe;IAC9B,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAUD,oGAAoG;AACpG,wBAAgB,gBAAgB,IAAI,OAAO,CAgB1C;AAgBD,oGAAoG;AACpG,wBAAgB,WAAW,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAe/D;AAED,gGAAgG;AAChG,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAM7C;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+B/E;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBnG;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,iBAAiB,EAAE,MAAM,EAAE,GAAG,OAAO,GAAG,SAAS,EACjD,QAAQ,EAAE,MAAM,EAAE,GACjB;IAAE,iBAAiB,EAAE,MAAM,EAAE,GAAG,OAAO,GAAG,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAavE"}
|
package/dist/widevine.js
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
// Opt-in Widevine CDM fetch + persistent-profile seeding (Windows).
|
|
2
|
+
//
|
|
3
|
+
// clearcote is a 100%-open-source build: it ships the EME/Widevine *plumbing* (enable_widevine=true)
|
|
4
|
+
// but NOT Google's proprietary CDM binary (that blob can't live in a FOSS package). This module lets
|
|
5
|
+
// a user *opt in* to fetching the CDM from Google's component server at runtime — exactly how a real
|
|
6
|
+
// Chrome receives it via the component updater — so requestMediaKeySystemAccess('com.widevine.alpha')
|
|
7
|
+
// resolves (DRM plays, and the EME surface matches a real Chrome instead of a no-Widevine tell).
|
|
8
|
+
//
|
|
9
|
+
// import { fetchWidevine, launchPersistentContext } from "clearcote";
|
|
10
|
+
// await fetchWidevine(); // download + verify into ~/.clearcote
|
|
11
|
+
// const ctx = await launchPersistentContext("profile", { widevine: true }); // seeds + enables it
|
|
12
|
+
import { createHash } from "node:crypto";
|
|
13
|
+
import { cpSync, existsSync, mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
|
|
14
|
+
import { rm } from "node:fs/promises";
|
|
15
|
+
import os from "node:os";
|
|
16
|
+
import path from "node:path";
|
|
17
|
+
import extract from "extract-zip";
|
|
18
|
+
/** Chrome's component-updater app id for the Widevine CDM + Google's Omaha JSON endpoint. */
|
|
19
|
+
export const WIDEVINE_APP_ID = "oimompecagnajdejgnnjijobebaeigek";
|
|
20
|
+
export const OMAHA_URL = "https://update.googleapis.com/service/update2/json";
|
|
21
|
+
export const HINT_FILE = "latest-component-updated-widevine-cdm";
|
|
22
|
+
// update.googleapis.com sits behind Google's edge; a bare fetch UA can 403 — send a browser-ish one.
|
|
23
|
+
const UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36";
|
|
24
|
+
function log(quiet, msg) {
|
|
25
|
+
if (!quiet)
|
|
26
|
+
process.stderr.write(`[clearcote] [widevine] ${msg}\n`);
|
|
27
|
+
}
|
|
28
|
+
function cacheRoot() {
|
|
29
|
+
return process.env.CLEARCOTE_WIDEVINE_DIR || path.join(os.homedir(), ".clearcote", "WidevineCdm");
|
|
30
|
+
}
|
|
31
|
+
/** Minimal Omaha v3.1 update check for the Windows x64 Widevine CDM (version 0.0.0.0 -> latest). */
|
|
32
|
+
export function omahaRequestBody() {
|
|
33
|
+
return {
|
|
34
|
+
request: {
|
|
35
|
+
"@os": "win",
|
|
36
|
+
"@updater": "clearcote",
|
|
37
|
+
acceptformat: "crx3",
|
|
38
|
+
protocol: "3.1",
|
|
39
|
+
arch: "x64",
|
|
40
|
+
nacl_arch: "x86-64",
|
|
41
|
+
prodversion: "149.0.0.0",
|
|
42
|
+
updaterversion: "149.0.0.0",
|
|
43
|
+
dedup: "cr",
|
|
44
|
+
os: { arch: "x86_64", platform: "Windows", version: "10.0.19045.0" },
|
|
45
|
+
app: [{ appid: WIDEVINE_APP_ID, version: "0.0.0.0", updatecheck: {}, ping: { r: -2 } }],
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
async function postJson(url, body) {
|
|
50
|
+
const res = await fetch(url, {
|
|
51
|
+
method: "POST",
|
|
52
|
+
headers: { "Content-Type": "application/json", "User-Agent": UA },
|
|
53
|
+
body: JSON.stringify(body),
|
|
54
|
+
redirect: "follow",
|
|
55
|
+
signal: AbortSignal.timeout(60_000),
|
|
56
|
+
});
|
|
57
|
+
if (!res.ok)
|
|
58
|
+
throw new Error(`Widevine update check HTTP ${res.status}`);
|
|
59
|
+
let raw = await res.text();
|
|
60
|
+
if (raw.startsWith(")]}'"))
|
|
61
|
+
raw = raw.includes("\n") ? raw.slice(raw.indexOf("\n") + 1) : raw.slice(4); // strip XSSI guard
|
|
62
|
+
return JSON.parse(raw);
|
|
63
|
+
}
|
|
64
|
+
/** Pull [downloadUrl, sha256, version] from an Omaha JSON response (pipelines or classic shape). */
|
|
65
|
+
export function parseUpdate(resp) {
|
|
66
|
+
const app = resp?.response?.app?.[0];
|
|
67
|
+
const uc = app?.updatecheck;
|
|
68
|
+
if (!uc || uc.status !== "ok")
|
|
69
|
+
throw new Error(`Widevine update check status: ${uc?.status}`);
|
|
70
|
+
for (const pl of uc.pipelines || []) {
|
|
71
|
+
for (const op of pl.operations || []) {
|
|
72
|
+
const urls = op.urls || [];
|
|
73
|
+
const out = op.out || {};
|
|
74
|
+
if (urls.length && out.sha256)
|
|
75
|
+
return [urls[0].url, out.sha256, app.nextversion || uc.nextversion || ""];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const base = uc.urls?.url?.[0]?.codebase;
|
|
79
|
+
const pkg = uc.manifest?.packages?.package?.[0];
|
|
80
|
+
if (base && pkg?.name)
|
|
81
|
+
return [base.replace(/\/+$/, "") + "/" + pkg.name, pkg.hash_sha256 || "", uc.manifest?.version || ""];
|
|
82
|
+
throw new Error("could not find a CDM download URL in the update response");
|
|
83
|
+
}
|
|
84
|
+
/** A CRX3 file is 'Cr24' + u32 version + u32 headerLen + header + zip. Return the zip bytes. */
|
|
85
|
+
export function crx3ToZip(buf) {
|
|
86
|
+
if (buf.subarray(0, 4).toString("latin1") !== "Cr24")
|
|
87
|
+
return buf; // already a plain zip
|
|
88
|
+
if (buf.length < 12)
|
|
89
|
+
throw new Error("malformed CRX3 (truncated header)");
|
|
90
|
+
const headerLen = buf.readUInt32LE(8);
|
|
91
|
+
if (12 + headerLen > buf.length)
|
|
92
|
+
throw new Error("malformed CRX3 (header overruns buffer)");
|
|
93
|
+
return buf.subarray(12 + headerLen);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Download + verify the Windows x64 Widevine CDM into `dest` (default ~/.clearcote/WidevineCdm/
|
|
97
|
+
* <version>). Returns the versioned CDM directory (manifest.json + _platform_specific/win_x64/
|
|
98
|
+
* widevinecdm.dll). Re-fetch is skipped if already present.
|
|
99
|
+
*/
|
|
100
|
+
export async function fetchWidevine(opts = {}) {
|
|
101
|
+
const [url, sha256, version] = parseUpdate(await postJson(OMAHA_URL, omahaRequestBody()));
|
|
102
|
+
const root = opts.dest || cacheRoot();
|
|
103
|
+
const verDir = path.join(root, version || "current");
|
|
104
|
+
const dll = path.join(verDir, "_platform_specific", "win_x64", "widevinecdm.dll");
|
|
105
|
+
if (existsSync(dll) && existsSync(path.join(verDir, "manifest.json"))) {
|
|
106
|
+
log(opts.quiet, `already present: ${verDir}`);
|
|
107
|
+
return verDir;
|
|
108
|
+
}
|
|
109
|
+
log(opts.quiet, `fetching CDM ${version || "(latest)"}`);
|
|
110
|
+
const res = await fetch(url, { headers: { "User-Agent": UA }, redirect: "follow", signal: AbortSignal.timeout(120_000) });
|
|
111
|
+
if (!res.ok)
|
|
112
|
+
throw new Error(`Widevine CDM download HTTP ${res.status}`);
|
|
113
|
+
const blob = Buffer.from(await res.arrayBuffer());
|
|
114
|
+
// The CDM is a NATIVE DLL loaded into the browser process — never install it unverified. A
|
|
115
|
+
// missing hash in the update response is a hard failure, not a skip.
|
|
116
|
+
if (!sha256)
|
|
117
|
+
throw new Error("Widevine update response had no sha256 — refusing to install an unverified CDM");
|
|
118
|
+
if (createHash("sha256").update(blob).digest("hex") !== sha256.toLowerCase()) {
|
|
119
|
+
throw new Error("Widevine CDM sha256 mismatch — refusing to install");
|
|
120
|
+
}
|
|
121
|
+
mkdirSync(verDir, { recursive: true });
|
|
122
|
+
const tmp = mkdtempSync(path.join(os.tmpdir(), "cc-wv-"));
|
|
123
|
+
const zipPath = path.join(tmp, "cdm.zip");
|
|
124
|
+
try {
|
|
125
|
+
writeFileSync(zipPath, crx3ToZip(blob));
|
|
126
|
+
await extract(zipPath, { dir: verDir });
|
|
127
|
+
}
|
|
128
|
+
finally {
|
|
129
|
+
await rm(tmp, { recursive: true, force: true });
|
|
130
|
+
}
|
|
131
|
+
if (!existsSync(dll))
|
|
132
|
+
throw new Error(`extracted CDM but widevinecdm.dll not at ${dll}`);
|
|
133
|
+
log(opts.quiet, `installed: ${verDir}`);
|
|
134
|
+
return verDir;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Make a persistent profile load the fetched CDM: copy it under <userDataDir>/WidevineCdm/<version>/
|
|
138
|
+
* and write the component hint file the engine reads. Fetches the CDM first if needed.
|
|
139
|
+
*/
|
|
140
|
+
export async function seedWidevine(userDataDir, opts = {}) {
|
|
141
|
+
const src = await fetchWidevine(opts);
|
|
142
|
+
const version = path.basename(src);
|
|
143
|
+
const wvRoot = path.join(userDataDir, "WidevineCdm");
|
|
144
|
+
const target = path.join(wvRoot, version);
|
|
145
|
+
if (!existsSync(path.join(target, "_platform_specific", "win_x64", "widevinecdm.dll"))) {
|
|
146
|
+
mkdirSync(wvRoot, { recursive: true });
|
|
147
|
+
cpSync(src, target, { recursive: true });
|
|
148
|
+
}
|
|
149
|
+
try {
|
|
150
|
+
writeFileSync(path.join(wvRoot, HINT_FILE), JSON.stringify({ Path: target }));
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
/* hint file is Linux-only; harmless if it can't be written */
|
|
154
|
+
}
|
|
155
|
+
log(opts.quiet, `seeded into ${wvRoot}`);
|
|
156
|
+
return target;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Adjust launch args so the engine actually registers the seeded CDM: un-suppress the component
|
|
160
|
+
* updater (Playwright disables it by default) and force the startup scan. Pure — returns the new
|
|
161
|
+
* values. `ignoreDefaultArgs` may be a list, `undefined`, or the boolean form Playwright accepts
|
|
162
|
+
* (`true` = ignore ALL defaults, so the updater is already un-suppressed); only the list/undefined
|
|
163
|
+
* forms need `--disable-component-update` added. Verified: with these, requestMediaKeySystemAccess
|
|
164
|
+
* + createMediaKeys succeed.
|
|
165
|
+
*/
|
|
166
|
+
export function widevineArgs(ignoreDefaultArgs, userArgs) {
|
|
167
|
+
let ida = ignoreDefaultArgs;
|
|
168
|
+
if (Array.isArray(ignoreDefaultArgs)) {
|
|
169
|
+
ida = ignoreDefaultArgs.includes("--disable-component-update")
|
|
170
|
+
? ignoreDefaultArgs
|
|
171
|
+
: [...ignoreDefaultArgs, "--disable-component-update"];
|
|
172
|
+
}
|
|
173
|
+
else if (ignoreDefaultArgs === undefined) {
|
|
174
|
+
ida = ["--disable-component-update"];
|
|
175
|
+
}
|
|
176
|
+
const args = userArgs.some((a) => a.includes("component-updater"))
|
|
177
|
+
? userArgs
|
|
178
|
+
: [...userArgs, "--component-updater=fast-update"];
|
|
179
|
+
return { ignoreDefaultArgs: ida, args };
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=widevine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widevine.js","sourceRoot":"","sources":["../src/widevine.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,qGAAqG;AACrG,qGAAqG;AACrG,qGAAqG;AACrG,sGAAsG;AACtG,iGAAiG;AACjG,EAAE;AACF,wEAAwE;AACxE,mGAAmG;AACnG,qGAAqG;AAErG,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpF,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,6FAA6F;AAC7F,MAAM,CAAC,MAAM,eAAe,GAAG,kCAAkC,CAAC;AAClE,MAAM,CAAC,MAAM,SAAS,GAAG,oDAAoD,CAAC;AAC9E,MAAM,CAAC,MAAM,SAAS,GAAG,uCAAuC,CAAC;AACjE,qGAAqG;AACrG,MAAM,EAAE,GACN,iHAAiH,CAAC;AASpH,SAAS,GAAG,CAAC,KAA0B,EAAE,GAAW;IAClD,IAAI,CAAC,KAAK;QAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,S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EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAC1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clearcote",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "Playwright drop-in for the Clearcote anti-fingerprint Chromium build. launch() returns a standard Playwright Browser backed by the verified Clearcote binary, which is auto-downloaded and SHA-256 checked.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|