playwriter 0.0.25 → 0.0.29

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 (105) hide show
  1. package/bin.js +1 -1
  2. package/dist/bippy.js +966 -0
  3. package/dist/{extension/cdp-relay.d.ts → cdp-relay.d.ts} +3 -2
  4. package/dist/cdp-relay.d.ts.map +1 -0
  5. package/dist/{extension/cdp-relay.js → cdp-relay.js} +101 -3
  6. package/dist/cdp-relay.js.map +1 -0
  7. package/dist/cdp-session.d.ts +1 -1
  8. package/dist/cdp-session.d.ts.map +1 -1
  9. package/dist/cdp-session.js +4 -4
  10. package/dist/cdp-session.js.map +1 -1
  11. package/dist/cli.d.ts +3 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +71 -0
  14. package/dist/cli.js.map +1 -0
  15. package/dist/create-logger.d.ts.map +1 -1
  16. package/dist/create-logger.js +2 -1
  17. package/dist/create-logger.js.map +1 -1
  18. package/dist/debugger-examples-types.d.ts +18 -0
  19. package/dist/debugger-examples-types.d.ts.map +1 -0
  20. package/dist/debugger-examples-types.js +2 -0
  21. package/dist/debugger-examples-types.js.map +1 -0
  22. package/dist/debugger-examples.d.ts +6 -0
  23. package/dist/debugger-examples.d.ts.map +1 -0
  24. package/dist/debugger-examples.js +53 -0
  25. package/dist/debugger-examples.js.map +1 -0
  26. package/dist/debugger-examples.ts +66 -0
  27. package/dist/debugger.d.ts +380 -0
  28. package/dist/debugger.d.ts.map +1 -0
  29. package/dist/debugger.js +631 -0
  30. package/dist/debugger.js.map +1 -0
  31. package/dist/editor-examples.d.ts +11 -0
  32. package/dist/editor-examples.d.ts.map +1 -0
  33. package/dist/editor-examples.js +124 -0
  34. package/dist/editor-examples.js.map +1 -0
  35. package/dist/editor.d.ts +203 -0
  36. package/dist/editor.d.ts.map +1 -0
  37. package/dist/editor.js +335 -0
  38. package/dist/editor.js.map +1 -0
  39. package/dist/index.d.ts +1 -1
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +1 -1
  42. package/dist/index.js.map +1 -1
  43. package/dist/mcp-client.d.ts +5 -1
  44. package/dist/mcp-client.d.ts.map +1 -1
  45. package/dist/mcp-client.js +13 -9
  46. package/dist/mcp-client.js.map +1 -1
  47. package/dist/mcp.d.ts +4 -1
  48. package/dist/mcp.d.ts.map +1 -1
  49. package/dist/mcp.js +170 -27
  50. package/dist/mcp.js.map +1 -1
  51. package/dist/mcp.test.d.ts.map +1 -1
  52. package/dist/mcp.test.js +886 -182
  53. package/dist/mcp.test.js.map +1 -1
  54. package/dist/prompt.md +86 -6
  55. package/dist/{extension/protocol.d.ts → protocol.d.ts} +1 -1
  56. package/dist/protocol.d.ts.map +1 -0
  57. package/dist/protocol.js.map +1 -0
  58. package/dist/react-source.d.ts +13 -0
  59. package/dist/react-source.d.ts.map +1 -0
  60. package/dist/react-source.js +66 -0
  61. package/dist/react-source.js.map +1 -0
  62. package/dist/selector-generator.js +7065 -18
  63. package/dist/start-relay-server.d.ts +4 -2
  64. package/dist/start-relay-server.d.ts.map +1 -1
  65. package/dist/start-relay-server.js +3 -3
  66. package/dist/start-relay-server.js.map +1 -1
  67. package/dist/styles.d.ts +27 -0
  68. package/dist/styles.d.ts.map +1 -0
  69. package/dist/styles.js +232 -0
  70. package/dist/styles.js.map +1 -0
  71. package/dist/utils.d.ts +3 -1
  72. package/dist/utils.d.ts.map +1 -1
  73. package/dist/utils.js +7 -3
  74. package/dist/utils.js.map +1 -1
  75. package/dist/wait-for-page-load.d.ts.map +1 -1
  76. package/dist/wait-for-page-load.js +3 -2
  77. package/dist/wait-for-page-load.js.map +1 -1
  78. package/package.json +5 -2
  79. package/src/{extension/cdp-relay.ts → cdp-relay.ts} +109 -5
  80. package/src/cdp-session.ts +4 -4
  81. package/src/cdp-timing.md +128 -0
  82. package/src/cli.ts +85 -0
  83. package/src/create-logger.ts +2 -1
  84. package/src/debugger-examples-types.ts +10 -0
  85. package/src/debugger-examples.ts +66 -0
  86. package/src/debugger.ts +711 -0
  87. package/src/editor-examples.ts +148 -0
  88. package/src/editor.ts +389 -0
  89. package/src/index.ts +1 -1
  90. package/src/mcp-client.ts +14 -9
  91. package/src/mcp.test.ts +1053 -196
  92. package/src/mcp.ts +195 -30
  93. package/src/prompt.md +86 -6
  94. package/src/{extension/protocol.ts → protocol.ts} +1 -1
  95. package/src/react-source.ts +92 -0
  96. package/src/snapshots/shadcn-ui-accessibility.md +57 -57
  97. package/src/start-relay-server.ts +3 -3
  98. package/src/styles.ts +343 -0
  99. package/src/utils.ts +8 -3
  100. package/src/wait-for-page-load.ts +3 -2
  101. package/dist/extension/cdp-relay.d.ts.map +0 -1
  102. package/dist/extension/cdp-relay.js.map +0 -1
  103. package/dist/extension/protocol.d.ts.map +0 -1
  104. package/dist/extension/protocol.js.map +0 -1
  105. /package/dist/{extension/protocol.js → protocol.js} +0 -0
@@ -0,0 +1,631 @@
1
+ /**
2
+ * A class for debugging JavaScript code via Chrome DevTools Protocol.
3
+ * Works with both Node.js (--inspect) and browser debugging.
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * const cdp = await getCDPSessionForPage({ page, wsUrl })
8
+ * const dbg = new Debugger({ cdp })
9
+ *
10
+ * await dbg.setBreakpoint({ file: 'https://example.com/app.js', line: 42 })
11
+ * // trigger the code path, then:
12
+ * const location = await dbg.getLocation()
13
+ * const vars = await dbg.inspectLocalVariables()
14
+ * await dbg.resume()
15
+ * ```
16
+ */
17
+ export class Debugger {
18
+ cdp;
19
+ debuggerEnabled = false;
20
+ paused = false;
21
+ currentCallFrames = [];
22
+ breakpoints = new Map();
23
+ scripts = new Map();
24
+ xhrBreakpoints = new Set();
25
+ blackboxPatterns = [];
26
+ /**
27
+ * Creates a new Debugger instance.
28
+ *
29
+ * @param options - Configuration options
30
+ * @param options.cdp - A CDPSession instance for sending CDP commands
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const cdp = await getCDPSessionForPage({ page, wsUrl })
35
+ * const dbg = new Debugger({ cdp })
36
+ * ```
37
+ */
38
+ constructor({ cdp }) {
39
+ this.cdp = cdp;
40
+ this.setupEventListeners();
41
+ }
42
+ setupEventListeners() {
43
+ this.cdp.on('Debugger.paused', (params) => {
44
+ this.paused = true;
45
+ this.currentCallFrames = params.callFrames;
46
+ });
47
+ this.cdp.on('Debugger.resumed', () => {
48
+ this.paused = false;
49
+ this.currentCallFrames = [];
50
+ });
51
+ this.cdp.on('Debugger.scriptParsed', (params) => {
52
+ if (params.url && !params.url.startsWith('chrome') && !params.url.startsWith('devtools')) {
53
+ this.scripts.set(params.scriptId, {
54
+ scriptId: params.scriptId,
55
+ url: params.url,
56
+ });
57
+ }
58
+ });
59
+ }
60
+ /**
61
+ * Enables the debugger and runtime domains. Called automatically by other methods.
62
+ * Also resumes execution if the target was started with --inspect-brk.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * await dbg.enable()
67
+ * ```
68
+ */
69
+ async enable() {
70
+ if (this.debuggerEnabled) {
71
+ return;
72
+ }
73
+ await this.cdp.send('Debugger.disable');
74
+ await this.cdp.send('Runtime.disable');
75
+ this.scripts.clear();
76
+ const scriptsReady = new Promise((resolve) => {
77
+ let timeout;
78
+ const listener = () => {
79
+ clearTimeout(timeout);
80
+ timeout = setTimeout(() => {
81
+ this.cdp.off('Debugger.scriptParsed', listener);
82
+ resolve();
83
+ }, 100);
84
+ };
85
+ this.cdp.on('Debugger.scriptParsed', listener);
86
+ timeout = setTimeout(() => {
87
+ this.cdp.off('Debugger.scriptParsed', listener);
88
+ resolve();
89
+ }, 100);
90
+ });
91
+ await this.cdp.send('Debugger.enable');
92
+ await this.cdp.send('Runtime.enable');
93
+ await this.cdp.send('Runtime.runIfWaitingForDebugger');
94
+ await scriptsReady;
95
+ this.debuggerEnabled = true;
96
+ }
97
+ /**
98
+ * Sets a breakpoint at a specified URL and line number.
99
+ * Use the URL from listScripts() to find available scripts.
100
+ *
101
+ * @param options - Breakpoint options
102
+ * @param options.file - Script URL (e.g. https://example.com/app.js)
103
+ * @param options.line - Line number (1-based)
104
+ * @param options.condition - Optional JS expression; only pause when it evaluates to true
105
+ * @returns The breakpoint ID for later removal
106
+ *
107
+ * @example
108
+ * ```ts
109
+ * const id = await dbg.setBreakpoint({ file: 'https://example.com/app.js', line: 42 })
110
+ * // later:
111
+ * await dbg.deleteBreakpoint({ breakpointId: id })
112
+ *
113
+ * // Conditional breakpoint - only pause when userId is 123
114
+ * await dbg.setBreakpoint({
115
+ * file: 'https://example.com/app.js',
116
+ * line: 42,
117
+ * condition: 'userId === 123'
118
+ * })
119
+ * ```
120
+ */
121
+ async setBreakpoint({ file, line, condition }) {
122
+ await this.enable();
123
+ const response = await this.cdp.send('Debugger.setBreakpointByUrl', {
124
+ lineNumber: line - 1,
125
+ urlRegex: file.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'),
126
+ columnNumber: 0,
127
+ condition,
128
+ });
129
+ this.breakpoints.set(response.breakpointId, { id: response.breakpointId, file, line });
130
+ return response.breakpointId;
131
+ }
132
+ /**
133
+ * Removes a breakpoint by its ID.
134
+ *
135
+ * @param options - Options
136
+ * @param options.breakpointId - The breakpoint ID returned by setBreakpoint
137
+ *
138
+ * @example
139
+ * ```ts
140
+ * await dbg.deleteBreakpoint({ breakpointId: 'bp-123' })
141
+ * ```
142
+ */
143
+ async deleteBreakpoint({ breakpointId }) {
144
+ await this.enable();
145
+ await this.cdp.send('Debugger.removeBreakpoint', { breakpointId });
146
+ this.breakpoints.delete(breakpointId);
147
+ }
148
+ /**
149
+ * Returns a list of all active breakpoints set by this debugger instance.
150
+ *
151
+ * @returns Array of breakpoint info objects
152
+ *
153
+ * @example
154
+ * ```ts
155
+ * const breakpoints = dbg.listBreakpoints()
156
+ * // [{ id: 'bp-123', file: 'https://example.com/index.js', line: 42 }]
157
+ * ```
158
+ */
159
+ listBreakpoints() {
160
+ return Array.from(this.breakpoints.values());
161
+ }
162
+ /**
163
+ * Inspects local variables in the current call frame.
164
+ * Must be paused at a breakpoint. String values over 1000 chars are truncated.
165
+ * Use evaluate() for full control over reading specific values.
166
+ *
167
+ * @returns Record of variable names to values
168
+ * @throws Error if not paused or no active call frames
169
+ *
170
+ * @example
171
+ * ```ts
172
+ * const vars = await dbg.inspectLocalVariables()
173
+ * // { myVar: 'hello', count: 42 }
174
+ * ```
175
+ */
176
+ async inspectLocalVariables() {
177
+ await this.enable();
178
+ if (!this.paused || this.currentCallFrames.length === 0) {
179
+ throw new Error('Debugger is not paused at a breakpoint');
180
+ }
181
+ const frame = this.currentCallFrames[0];
182
+ const result = {};
183
+ for (const scopeObj of frame.scopeChain) {
184
+ if (scopeObj.type === 'global') {
185
+ continue;
186
+ }
187
+ if (!scopeObj.object.objectId) {
188
+ continue;
189
+ }
190
+ const objProperties = await this.cdp.send('Runtime.getProperties', {
191
+ objectId: scopeObj.object.objectId,
192
+ ownProperties: true,
193
+ accessorPropertiesOnly: false,
194
+ generatePreview: true,
195
+ });
196
+ for (const prop of objProperties.result) {
197
+ if (prop.value && prop.configurable) {
198
+ result[prop.name] = this.formatPropertyValue(prop.value);
199
+ }
200
+ }
201
+ }
202
+ return result;
203
+ }
204
+ /**
205
+ * Returns global lexical scope variable names.
206
+ *
207
+ * @returns Array of global variable names
208
+ *
209
+ * @example
210
+ * ```ts
211
+ * const globals = await dbg.inspectGlobalVariables()
212
+ * // ['myGlobal', 'CONFIG']
213
+ * ```
214
+ */
215
+ async inspectGlobalVariables() {
216
+ await this.enable();
217
+ const response = await this.cdp.send('Runtime.globalLexicalScopeNames', {});
218
+ return response.names;
219
+ }
220
+ /**
221
+ * Evaluates a JavaScript expression and returns the result.
222
+ * When paused at a breakpoint, evaluates in the current stack frame scope,
223
+ * allowing access to local variables. Otherwise evaluates in global scope.
224
+ * Values are not truncated, use this for full control over reading specific variables.
225
+ *
226
+ * @param options - Options
227
+ * @param options.expression - JavaScript expression to evaluate
228
+ * @returns The result value
229
+ *
230
+ * @example
231
+ * ```ts
232
+ * // When paused, can access local variables:
233
+ * const result = await dbg.evaluate({ expression: 'localVar + 1' })
234
+ *
235
+ * // Read a large string that would be truncated in inspectLocalVariables:
236
+ * const full = await dbg.evaluate({ expression: 'largeStringVar' })
237
+ * ```
238
+ */
239
+ async evaluate({ expression }) {
240
+ await this.enable();
241
+ const wrappedExpression = `
242
+ try {
243
+ ${expression}
244
+ } catch (e) {
245
+ e;
246
+ }
247
+ `;
248
+ let response;
249
+ if (this.paused && this.currentCallFrames.length > 0) {
250
+ const frame = this.currentCallFrames[0];
251
+ response = await this.cdp.send('Debugger.evaluateOnCallFrame', {
252
+ callFrameId: frame.callFrameId,
253
+ expression: wrappedExpression,
254
+ objectGroup: 'console',
255
+ includeCommandLineAPI: true,
256
+ silent: false,
257
+ returnByValue: true,
258
+ generatePreview: true,
259
+ });
260
+ }
261
+ else {
262
+ response = await this.cdp.send('Runtime.evaluate', {
263
+ expression: wrappedExpression,
264
+ objectGroup: 'console',
265
+ includeCommandLineAPI: true,
266
+ silent: false,
267
+ returnByValue: true,
268
+ generatePreview: true,
269
+ awaitPromise: true,
270
+ });
271
+ }
272
+ const value = await this.processRemoteObject(response.result);
273
+ return { value };
274
+ }
275
+ /**
276
+ * Gets the current execution location when paused at a breakpoint.
277
+ * Includes the call stack and surrounding source code for context.
278
+ *
279
+ * @returns Location info with URL, line number, call stack, and source context
280
+ * @throws Error if debugger is not paused
281
+ *
282
+ * @example
283
+ * ```ts
284
+ * const location = await dbg.getLocation()
285
+ * console.log(location.url) // 'https://example.com/src/index.js'
286
+ * console.log(location.lineNumber) // 42
287
+ * console.log(location.callstack) // [{ functionName: 'handleRequest', ... }]
288
+ * console.log(location.sourceContext)
289
+ * // ' 40: function handleRequest(req) {
290
+ * // 41: const data = req.body
291
+ * // > 42: processData(data)
292
+ * // 43: }'
293
+ * ```
294
+ */
295
+ async getLocation() {
296
+ await this.enable();
297
+ if (!this.paused || this.currentCallFrames.length === 0) {
298
+ throw new Error('Debugger is not paused at a breakpoint');
299
+ }
300
+ const frame = this.currentCallFrames[0];
301
+ const { scriptId, lineNumber, columnNumber } = frame.location;
302
+ const callstack = this.currentCallFrames.map((f) => ({
303
+ functionName: f.functionName || '(anonymous)',
304
+ url: f.url,
305
+ lineNumber: f.location.lineNumber + 1,
306
+ columnNumber: f.location.columnNumber || 0,
307
+ }));
308
+ let sourceContext = '';
309
+ try {
310
+ const scriptSource = await this.cdp.send('Debugger.getScriptSource', { scriptId });
311
+ const lines = scriptSource.scriptSource.split('\n');
312
+ const startLine = Math.max(0, lineNumber - 3);
313
+ const endLine = Math.min(lines.length - 1, lineNumber + 3);
314
+ for (let i = startLine; i <= endLine; i++) {
315
+ const prefix = i === lineNumber ? '> ' : ' ';
316
+ sourceContext += `${prefix}${i + 1}: ${lines[i]}\n`;
317
+ }
318
+ }
319
+ catch {
320
+ sourceContext = 'Unable to retrieve source code';
321
+ }
322
+ return {
323
+ url: frame.url,
324
+ lineNumber: lineNumber + 1,
325
+ columnNumber: columnNumber || 0,
326
+ callstack,
327
+ sourceContext,
328
+ };
329
+ }
330
+ /**
331
+ * Steps over to the next line of code, not entering function calls.
332
+ *
333
+ * @throws Error if debugger is not paused
334
+ *
335
+ * @example
336
+ * ```ts
337
+ * await dbg.stepOver()
338
+ * const newLocation = await dbg.getLocation()
339
+ * ```
340
+ */
341
+ async stepOver() {
342
+ await this.enable();
343
+ if (!this.paused) {
344
+ throw new Error('Debugger is not paused');
345
+ }
346
+ await this.cdp.send('Debugger.stepOver');
347
+ }
348
+ /**
349
+ * Steps into a function call on the current line.
350
+ *
351
+ * @throws Error if debugger is not paused
352
+ *
353
+ * @example
354
+ * ```ts
355
+ * await dbg.stepInto()
356
+ * const location = await dbg.getLocation()
357
+ * // now inside the called function
358
+ * ```
359
+ */
360
+ async stepInto() {
361
+ await this.enable();
362
+ if (!this.paused) {
363
+ throw new Error('Debugger is not paused');
364
+ }
365
+ await this.cdp.send('Debugger.stepInto');
366
+ }
367
+ /**
368
+ * Steps out of the current function, returning to the caller.
369
+ *
370
+ * @throws Error if debugger is not paused
371
+ *
372
+ * @example
373
+ * ```ts
374
+ * await dbg.stepOut()
375
+ * const location = await dbg.getLocation()
376
+ * // back in the calling function
377
+ * ```
378
+ */
379
+ async stepOut() {
380
+ await this.enable();
381
+ if (!this.paused) {
382
+ throw new Error('Debugger is not paused');
383
+ }
384
+ await this.cdp.send('Debugger.stepOut');
385
+ }
386
+ /**
387
+ * Resumes code execution until the next breakpoint or completion.
388
+ *
389
+ * @throws Error if debugger is not paused
390
+ *
391
+ * @example
392
+ * ```ts
393
+ * await dbg.resume()
394
+ * // execution continues
395
+ * ```
396
+ */
397
+ async resume() {
398
+ await this.enable();
399
+ if (!this.paused) {
400
+ throw new Error('Debugger is not paused');
401
+ }
402
+ await this.cdp.send('Debugger.resume');
403
+ }
404
+ /**
405
+ * Returns whether the debugger is currently paused at a breakpoint.
406
+ *
407
+ * @returns true if paused, false otherwise
408
+ *
409
+ * @example
410
+ * ```ts
411
+ * if (dbg.isPaused()) {
412
+ * const vars = await dbg.inspectLocalVariables()
413
+ * }
414
+ * ```
415
+ */
416
+ isPaused() {
417
+ return this.paused;
418
+ }
419
+ /**
420
+ * Configures the debugger to pause on exceptions.
421
+ *
422
+ * @param options - Options
423
+ * @param options.state - When to pause: 'none' (never), 'uncaught' (only uncaught), or 'all' (all exceptions)
424
+ *
425
+ * @example
426
+ * ```ts
427
+ * // Pause only on uncaught exceptions
428
+ * await dbg.setPauseOnExceptions({ state: 'uncaught' })
429
+ *
430
+ * // Pause on all exceptions (caught and uncaught)
431
+ * await dbg.setPauseOnExceptions({ state: 'all' })
432
+ *
433
+ * // Disable pausing on exceptions
434
+ * await dbg.setPauseOnExceptions({ state: 'none' })
435
+ * ```
436
+ */
437
+ async setPauseOnExceptions({ state }) {
438
+ await this.enable();
439
+ await this.cdp.send('Debugger.setPauseOnExceptions', { state });
440
+ }
441
+ /**
442
+ * Lists available scripts where breakpoints can be set.
443
+ * Automatically enables the debugger if not already enabled.
444
+ *
445
+ * @param options - Options
446
+ * @param options.search - Optional string to filter scripts by URL (case-insensitive)
447
+ * @returns Array of up to 20 matching scripts with scriptId and url
448
+ *
449
+ * @example
450
+ * ```ts
451
+ * // List all scripts
452
+ * const scripts = await dbg.listScripts()
453
+ * // [{ scriptId: '1', url: 'https://example.com/app.js' }, ...]
454
+ *
455
+ * // Search for specific files
456
+ * const handlers = await dbg.listScripts({ search: 'handler' })
457
+ * // [{ scriptId: '5', url: 'https://example.com/handlers.js' }]
458
+ * ```
459
+ */
460
+ async listScripts({ search } = {}) {
461
+ await this.enable();
462
+ const scripts = Array.from(this.scripts.values());
463
+ const filtered = search
464
+ ? scripts.filter((s) => s.url.toLowerCase().includes(search.toLowerCase()))
465
+ : scripts;
466
+ return filtered.slice(0, 20);
467
+ }
468
+ async setXHRBreakpoint({ url }) {
469
+ await this.enable();
470
+ await this.cdp.send('DOMDebugger.setXHRBreakpoint', { url });
471
+ this.xhrBreakpoints.add(url);
472
+ }
473
+ async removeXHRBreakpoint({ url }) {
474
+ await this.enable();
475
+ await this.cdp.send('DOMDebugger.removeXHRBreakpoint', { url });
476
+ this.xhrBreakpoints.delete(url);
477
+ }
478
+ listXHRBreakpoints() {
479
+ return Array.from(this.xhrBreakpoints);
480
+ }
481
+ /**
482
+ * Sets regex patterns for scripts to blackbox (skip when stepping).
483
+ * Blackboxed scripts are hidden from the call stack and stepped over automatically.
484
+ * Useful for ignoring framework/library code during debugging.
485
+ *
486
+ * @param options - Options
487
+ * @param options.patterns - Array of regex patterns to match script URLs
488
+ *
489
+ * @example
490
+ * ```ts
491
+ * // Skip all node_modules
492
+ * await dbg.setBlackboxPatterns({ patterns: ['node_modules'] })
493
+ *
494
+ * // Skip React and other frameworks
495
+ * await dbg.setBlackboxPatterns({
496
+ * patterns: [
497
+ * 'node_modules/react',
498
+ * 'node_modules/react-dom',
499
+ * 'node_modules/next',
500
+ * 'webpack://',
501
+ * ]
502
+ * })
503
+ *
504
+ * // Skip all third-party scripts
505
+ * await dbg.setBlackboxPatterns({ patterns: ['^https://cdn\\.'] })
506
+ *
507
+ * // Clear all blackbox patterns
508
+ * await dbg.setBlackboxPatterns({ patterns: [] })
509
+ * ```
510
+ */
511
+ async setBlackboxPatterns({ patterns }) {
512
+ await this.enable();
513
+ this.blackboxPatterns = patterns;
514
+ await this.cdp.send('Debugger.setBlackboxPatterns', { patterns });
515
+ }
516
+ /**
517
+ * Adds a single regex pattern to the blackbox list.
518
+ *
519
+ * @param options - Options
520
+ * @param options.pattern - Regex pattern to match script URLs
521
+ *
522
+ * @example
523
+ * ```ts
524
+ * await dbg.addBlackboxPattern({ pattern: 'node_modules/lodash' })
525
+ * await dbg.addBlackboxPattern({ pattern: 'node_modules/axios' })
526
+ * ```
527
+ */
528
+ async addBlackboxPattern({ pattern }) {
529
+ await this.enable();
530
+ if (!this.blackboxPatterns.includes(pattern)) {
531
+ this.blackboxPatterns.push(pattern);
532
+ await this.cdp.send('Debugger.setBlackboxPatterns', { patterns: this.blackboxPatterns });
533
+ }
534
+ }
535
+ /**
536
+ * Removes a pattern from the blackbox list.
537
+ *
538
+ * @param options - Options
539
+ * @param options.pattern - The exact pattern string to remove
540
+ */
541
+ async removeBlackboxPattern({ pattern }) {
542
+ await this.enable();
543
+ this.blackboxPatterns = this.blackboxPatterns.filter((p) => p !== pattern);
544
+ await this.cdp.send('Debugger.setBlackboxPatterns', { patterns: this.blackboxPatterns });
545
+ }
546
+ /**
547
+ * Returns the current list of blackbox patterns.
548
+ */
549
+ listBlackboxPatterns() {
550
+ return [...this.blackboxPatterns];
551
+ }
552
+ truncateValue(value) {
553
+ if (typeof value === 'string' && value.length > 1000) {
554
+ return value.slice(0, 1000) + `... (${value.length} chars)`;
555
+ }
556
+ return value;
557
+ }
558
+ formatPropertyValue(value) {
559
+ if (value.type === 'object' && value.subtype !== 'null') {
560
+ return `[${value.subtype || value.type}]`;
561
+ }
562
+ if (value.type === 'function') {
563
+ return '[function]';
564
+ }
565
+ if (value.value !== undefined) {
566
+ return this.truncateValue(value.value);
567
+ }
568
+ return `[${value.type}]`;
569
+ }
570
+ async processRemoteObject(obj) {
571
+ if (obj.type === 'undefined') {
572
+ return undefined;
573
+ }
574
+ if (obj.value !== undefined) {
575
+ return obj.value;
576
+ }
577
+ if (obj.type === 'object' && obj.objectId) {
578
+ try {
579
+ const props = await this.cdp.send('Runtime.getProperties', {
580
+ objectId: obj.objectId,
581
+ ownProperties: true,
582
+ accessorPropertiesOnly: false,
583
+ generatePreview: true,
584
+ });
585
+ const result = {};
586
+ for (const prop of props.result) {
587
+ if (prop.value) {
588
+ if (prop.value.type === 'object' && prop.value.objectId && prop.value.subtype !== 'null') {
589
+ try {
590
+ const nestedProps = await this.cdp.send('Runtime.getProperties', {
591
+ objectId: prop.value.objectId,
592
+ ownProperties: true,
593
+ accessorPropertiesOnly: false,
594
+ generatePreview: true,
595
+ });
596
+ const nestedObj = {};
597
+ for (const nestedProp of nestedProps.result) {
598
+ if (nestedProp.value) {
599
+ nestedObj[nestedProp.name] =
600
+ nestedProp.value.value !== undefined
601
+ ? nestedProp.value.value
602
+ : nestedProp.value.description || `[${nestedProp.value.subtype || nestedProp.value.type}]`;
603
+ }
604
+ }
605
+ result[prop.name] = nestedObj;
606
+ }
607
+ catch {
608
+ result[prop.name] = prop.value.description || `[${prop.value.subtype || prop.value.type}]`;
609
+ }
610
+ }
611
+ else if (prop.value.type === 'function') {
612
+ result[prop.name] = '[function]';
613
+ }
614
+ else if (prop.value.value !== undefined) {
615
+ result[prop.name] = prop.value.value;
616
+ }
617
+ else {
618
+ result[prop.name] = `[${prop.value.type}]`;
619
+ }
620
+ }
621
+ }
622
+ return result;
623
+ }
624
+ catch {
625
+ return obj.description || `[${obj.subtype || obj.type}]`;
626
+ }
627
+ }
628
+ return obj.description || `[${obj.type}]`;
629
+ }
630
+ }
631
+ //# sourceMappingURL=debugger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debugger.js","sourceRoot":"","sources":["../src/debugger.ts"],"names":[],"mappings":"AAiCA;;;;;;;;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;CACF"}
@@ -0,0 +1,11 @@
1
+ declare function listScripts(): Promise<void>;
2
+ declare function readScript(): Promise<void>;
3
+ declare function editScript(): Promise<void>;
4
+ declare function searchScripts(): Promise<void>;
5
+ declare function writeScript(): Promise<void>;
6
+ declare function editInlineScript(): Promise<void>;
7
+ declare function readStylesheet(): Promise<void>;
8
+ declare function editStylesheet(): Promise<void>;
9
+ declare function searchStyles(): Promise<void>;
10
+ export { listScripts, readScript, editScript, searchScripts, writeScript, editInlineScript, readStylesheet, editStylesheet, searchStyles };
11
+ //# sourceMappingURL=editor-examples.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-examples.d.ts","sourceRoot":"","sources":["../src/editor-examples.ts"],"names":[],"mappings":"AAGA,iBAAe,WAAW,kBAOzB;AAGD,iBAAe,UAAU,kBAiBxB;AAGD,iBAAe,UAAU,kBAkBxB;AAGD,iBAAe,aAAa,kBAa3B;AAGD,iBAAe,WAAW,kBAYzB;AAGD,iBAAe,gBAAgB,kBAgB9B;AAGD,iBAAe,cAAc,kBAe5B;AAGD,iBAAe,cAAc,kBAU5B;AAGD,iBAAe,YAAY,kBAU1B;AAED,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,CAAA"}