chrome-devtools-frontend 1.0.1603822 → 1.0.1604514

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 (42) hide show
  1. package/front_end/core/host/AidaClient.ts +39 -462
  2. package/front_end/core/host/AidaClientTypes.ts +470 -0
  3. package/front_end/core/host/AidaGcaTranslation.ts +225 -122
  4. package/front_end/core/host/GcaTypes.ts +107 -155
  5. package/front_end/core/protocol_client/DevToolsCDPConnection.ts +1 -1
  6. package/front_end/core/sdk/DOMModel.ts +24 -22
  7. package/front_end/core/sdk/EmulationModel.ts +21 -23
  8. package/front_end/core/sdk/HeapProfilerModel.ts +4 -7
  9. package/front_end/core/sdk/NetworkManager.ts +35 -28
  10. package/front_end/core/sdk/OverlayModel.ts +10 -10
  11. package/front_end/core/sdk/PreloadingModel.ts +3 -4
  12. package/front_end/core/sdk/ServiceWorkerManager.ts +2 -3
  13. package/front_end/core/sdk/SourceMapScopesInfo.ts +93 -63
  14. package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +1 -3
  15. package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +22 -48
  16. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +1 -1
  17. package/front_end/generated/InspectorBackendCommands.ts +4 -0
  18. package/front_end/generated/SupportedCSSProperties.js +68 -2
  19. package/front_end/generated/protocol-mapping.d.ts +7 -0
  20. package/front_end/generated/protocol-proxy-api.d.ts +14 -0
  21. package/front_end/generated/protocol.ts +22 -0
  22. package/front_end/models/bindings/TempFile.ts +1 -4
  23. package/front_end/models/extensions/ExtensionAPI.ts +1 -1
  24. package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +34 -47
  25. package/front_end/models/javascript_metadata/NativeFunctions.js +6 -6
  26. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +88 -19
  27. package/front_end/panels/ai_assistance/components/ChatMessage.ts +14 -20
  28. package/front_end/panels/ai_assistance/components/ChatView.ts +3 -2
  29. package/front_end/panels/ai_assistance/components/WalkthroughView.ts +35 -7
  30. package/front_end/panels/elements/ElementsTreeElement.ts +91 -13
  31. package/front_end/panels/elements/elementsTreeOutline.css +18 -0
  32. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +15 -19
  33. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +4 -2
  34. package/front_end/panels/profiler/HeapSnapshotProxy.ts +12 -16
  35. package/front_end/panels/profiler/HeapSnapshotView.ts +3 -10
  36. package/front_end/panels/profiler/ProfilesPanel.ts +5 -7
  37. package/front_end/panels/sensors/SensorsView.ts +0 -2
  38. package/front_end/panels/timeline/TimelinePanel.ts +1 -3
  39. package/front_end/panels/timeline/components/LiveMetricsView.ts +35 -63
  40. package/front_end/panels/timeline/components/liveMetricsView.css +4 -0
  41. package/front_end/third_party/chromium/README.chromium +1 -1
  42. package/package.json +1 -1
@@ -168,40 +168,40 @@ export enum Mode {
168
168
  NONE = 3,
169
169
  }
170
170
 
171
- /* eslint-disable @typescript-eslint/naming-convention */
172
171
  export interface GenerateContentRequest {
173
172
  model?: string;
174
- aicode?: AiCodeConfig;
173
+ aicode: AiCodeConfig;
175
174
  contents: Content[];
176
- system_instruction?: Content;
175
+ systemInstruction?: Content;
177
176
  tools?: Tool[];
178
- tool_config?: ToolConfig;
177
+ toolConfig?: ToolConfig;
179
178
  labels?: Record<string, string>;
180
- safety_settings?: SafetySetting[];
181
- generation_config?: GenerationConfig;
182
- session_id?: string;
179
+ safetySettings?: SafetySetting[];
180
+ generationConfig?: GenerationConfig;
181
+ sessionId?: string;
183
182
  }
184
- /* eslint-enable @typescript-eslint/naming-convention */
185
183
 
186
184
  export interface AiCodeConfig {
187
185
  experience: string;
188
186
  files?: SourceFile[];
189
187
  }
190
188
 
191
- /* eslint-disable @typescript-eslint/naming-convention */
192
189
  export interface SourceFile {
193
- inclusion_reason?: InclusionReason[];
194
- file_uri: string;
195
- programming_language?: string;
190
+ inclusionReason?: InclusionReason[];
191
+ fileUri: string;
192
+ programmingLanguage?: string;
193
+ segments?: FileSegment[];
194
+ }
195
+
196
+ export interface FileSegment {
197
+ content: string;
198
+ isSelected: boolean;
196
199
  }
197
- /* eslint-enable @typescript-eslint/naming-convention */
198
200
 
199
- /* eslint-disable @typescript-eslint/naming-convention */
200
201
  export interface FileEdit {
201
- file_uri: string;
202
+ fileUri: string;
202
203
  content: string;
203
204
  }
204
- /* eslint-enable @typescript-eslint/naming-convention */
205
205
 
206
206
  export type Role = 'user'|'model';
207
207
 
@@ -210,34 +210,28 @@ export interface Content {
210
210
  role: Role;
211
211
  }
212
212
 
213
- /* eslint-disable @typescript-eslint/naming-convention */
214
213
  export interface Part {
215
214
  text?: string;
216
- inline_data?: Blob;
217
- file_data?: FileData;
218
- function_call?: FunctionCall;
219
- function_response?: FunctionResponse;
220
- executable_code?: ExecutableCode;
221
- code_execution_result?: CodeExecutionResult;
222
- video_metadata?: VideoMetadata;
215
+ inlineData?: Blob;
216
+ fileData?: FileData;
217
+ functionCall?: FunctionCall;
218
+ functionResponse?: FunctionResponse;
219
+ executableCode?: ExecutableCode;
220
+ codeExecutionResult?: CodeExecutionResult;
221
+ videoMetadata?: VideoMetadata;
223
222
  thought?: boolean;
224
- thought_signature?: string; // bytes as base64 string
223
+ thoughtSignature?: string; // bytes as base64 string
225
224
  }
226
- /* eslint-enable @typescript-eslint/naming-convention */
227
225
 
228
- /* eslint-disable @typescript-eslint/naming-convention */
229
226
  export interface Blob {
230
- mime_type: string;
227
+ mimeType: string;
231
228
  data: string; // bytes as base64 string
232
229
  }
233
- /* eslint-enable @typescript-eslint/naming-convention */
234
230
 
235
- /* eslint-disable @typescript-eslint/naming-convention */
236
231
  export interface FileData {
237
- mime_type: string;
238
- file_uri: string;
232
+ mimeType: string;
233
+ fileUri: string;
239
234
  }
240
- /* eslint-enable @typescript-eslint/naming-convention */
241
235
 
242
236
  export interface FunctionCall {
243
237
  name: string;
@@ -261,30 +255,25 @@ export interface CodeExecutionResult {
261
255
  output: string;
262
256
  }
263
257
 
264
- /* eslint-disable @typescript-eslint/naming-convention */
265
258
  export interface Tool {
266
- function_declarations?: FunctionDeclaration[];
267
- google_search?: {
268
- time_range_filter?: {
269
- start_time?: string, // Timestamp
270
- end_time?: string, // Timestamp
259
+ functionDeclarations?: FunctionDeclaration[];
260
+ googleSearch?: {
261
+ timeRangeFilter?: {
262
+ startTime?: string, // Timestamp
263
+ endTime?: string, // Timestamp
271
264
  },
272
265
  };
273
266
  }
274
- /* eslint-enable @typescript-eslint/naming-convention */
275
267
 
276
- /* eslint-disable @typescript-eslint/naming-convention */
277
268
  export interface FunctionDeclaration {
278
269
  name: string;
279
270
  description: string;
280
271
  parameters?: Schema;
281
- parameters_json_schema?: unknown; // google.protobuf.Value
272
+ parametersJsonSchema?: unknown; // google.protobuf.Value
282
273
  response?: Schema;
283
- response_json_schema?: unknown; // google.protobuf.Value
274
+ responseJsonSchema?: unknown; // google.protobuf.Value
284
275
  }
285
- /* eslint-enable @typescript-eslint/naming-convention */
286
276
 
287
- /* eslint-disable @typescript-eslint/naming-convention */
288
277
  export interface Schema {
289
278
  type?: Type;
290
279
  format?: string;
@@ -296,25 +285,20 @@ export interface Schema {
296
285
  required?: string[];
297
286
  minimum?: number;
298
287
  maximum?: number;
299
- min_length?: number;
300
- max_length?: number;
288
+ minLength?: number;
289
+ maxLength?: number;
301
290
  pattern?: string;
302
291
  example?: unknown; // google.protobuf.Value
303
292
  }
304
- /* eslint-enable @typescript-eslint/naming-convention */
305
293
 
306
- /* eslint-disable @typescript-eslint/naming-convention */
307
294
  export interface ToolConfig {
308
- function_calling_config?: FunctionCallingConfig;
295
+ functionCallingConfig?: FunctionCallingConfig;
309
296
  }
310
- /* eslint-enable @typescript-eslint/naming-convention */
311
297
 
312
- /* eslint-disable @typescript-eslint/naming-convention */
313
298
  export interface FunctionCallingConfig {
314
299
  mode: Mode;
315
- allowed_function_names?: string[];
300
+ allowedFunctionNames?: string[];
316
301
  }
317
- /* eslint-enable @typescript-eslint/naming-convention */
318
302
 
319
303
  export interface SafetySetting {
320
304
  category: HarmCategory;
@@ -322,52 +306,44 @@ export interface SafetySetting {
322
306
  method?: HarmBlockMethod;
323
307
  }
324
308
 
325
- /* eslint-disable @typescript-eslint/naming-convention */
326
309
  export interface GenerationConfig {
327
- candidate_count?: number;
328
- stop_sequences?: string[];
329
- max_output_tokens?: number;
310
+ candidateCount?: number;
311
+ stopSequences?: string[];
312
+ maxOutputTokens?: number;
330
313
  temperature?: number;
331
- top_p?: number;
332
- top_k?: number;
314
+ topP?: number;
315
+ topK?: number;
333
316
  seed?: number;
334
- response_mime_type?: string;
335
- response_schema?: Schema;
336
- response_json_schema?: unknown; // google.protobuf.Value
337
- presence_penalty?: number;
338
- frequency_penalty?: number;
339
- thinking_config?: ThinkingConfig;
317
+ responseMimeType?: string;
318
+ responseSchema?: Schema;
319
+ responseJsonSchema?: unknown; // google.protobuf.Value
320
+ presencePenalty?: number;
321
+ frequencyPenalty?: number;
322
+ thinkingConfig?: ThinkingConfig;
340
323
  }
341
- /* eslint-enable @typescript-eslint/naming-convention */
342
324
 
343
- /* eslint-disable @typescript-eslint/naming-convention */
344
325
  export interface ThinkingConfig {
345
- include_thoughts?: boolean;
346
- thinking_budget?: number;
326
+ includeThoughts?: boolean;
327
+ thinkingBudget?: number;
347
328
  }
348
- /* eslint-enable @typescript-eslint/naming-convention */
349
329
 
350
- /* eslint-disable @typescript-eslint/naming-convention */
351
330
  export interface GenerateContentResponse {
352
331
  candidates: Candidate[];
353
- prompt_feedback: PromptFeedback;
354
- usage_metadata: UsageMetadata;
355
- model_version: string;
356
- response_id: string;
332
+ promptFeedback: PromptFeedback;
333
+ usageMetadata: UsageMetadata;
334
+ modelVersion: string;
335
+ responseId: string;
357
336
  }
358
- /* eslint-enable @typescript-eslint/naming-convention */
359
337
 
360
- /* eslint-disable @typescript-eslint/naming-convention */
361
338
  export interface Candidate {
362
339
  index: number;
363
340
  content: Content;
364
- finish_reason: FinishReason;
365
- safety_ratings: SafetyRating[];
366
- citation_metadata: CitationMetadata;
367
- grounding_metadata: GroundingMetadata;
368
- aicode_output: AiCodeOutput;
341
+ finishReason: FinishReason;
342
+ safetyRatings: SafetyRating[];
343
+ citationMetadata: CitationMetadata;
344
+ groundingMetadata: GroundingMetadata;
345
+ aicodeOutput: AiCodeOutput;
369
346
  }
370
- /* eslint-enable @typescript-eslint/naming-convention */
371
347
 
372
348
  export interface SafetyRating {
373
349
  category: HarmCategory;
@@ -379,142 +355,118 @@ export interface CitationMetadata {
379
355
  citations: Citation[];
380
356
  }
381
357
 
382
- /* eslint-disable @typescript-eslint/naming-convention */
383
358
  export interface Citation {
384
- start_index: number;
385
- end_index: number;
359
+ startIndex: number;
360
+ endIndex: number;
386
361
  uri: string;
387
362
  license: string;
388
363
  }
389
- /* eslint-enable @typescript-eslint/naming-convention */
390
364
 
391
- /* eslint-disable @typescript-eslint/naming-convention */
392
365
  export interface GroundingMetadata {
393
- web_search_queries?: string[];
394
- search_entry_point?: {
395
- rendered_content?: string,
396
- sdk_blob?: string, // bytes as base64 string
366
+ webSearchQueries?: string[];
367
+ searchEntryPoint?: {
368
+ renderedContent?: string,
369
+ sdkBlob?: string, // bytes as base64 string
397
370
  };
398
- grounding_chunks?: Array<{
371
+ groundingChunks?: Array<{
399
372
  web?: {
400
373
  uri?: string,
401
374
  title?: string,
402
375
  },
403
376
  }>;
404
- grounding_supports?: Array<{
377
+ groundingSupports?: Array<{
405
378
  segment?: {
406
- part_index?: number,
407
- start_index?: number,
408
- end_index?: number,
379
+ partIndex?: number,
380
+ startIndex?: number,
381
+ endIndex?: number,
409
382
  text?: string,
410
383
  },
411
- grounding_chunk_indices?: number[],
412
- confidence_scores?: number[],
384
+ groundingChunkIndices?: number[],
385
+ confidenceScores?: number[],
413
386
  }>;
414
- retrieval_metadata?: {
415
- google_search_dynamic_retrieval_score?: number,
387
+ retrievalMetadata?: {
388
+ googleSearchDynamicRetrievalScore?: number,
416
389
  };
417
390
  }
418
- /* eslint-enable @typescript-eslint/naming-convention */
419
391
 
420
392
  export interface AiCodeOutput {
421
393
  contents: DerivedContent[];
422
394
  }
423
395
 
424
- /* eslint-disable @typescript-eslint/naming-convention */
425
396
  export interface DerivedContent {
426
- start_index?: number;
427
- end_index?: number;
397
+ startIndex?: number;
398
+ endIndex?: number;
428
399
  file?: OutputSourceFile;
429
- code_block?: CodeBlock;
430
- text_block?: TextBlock;
431
- prediction_metadata?: PredictionMetadata;
400
+ codeBlock?: CodeBlock;
401
+ textBlock?: TextBlock;
402
+ predictionMetadata?: PredictionMetadata;
432
403
  }
433
- /* eslint-enable @typescript-eslint/naming-convention */
434
404
 
435
- /* eslint-disable @typescript-eslint/naming-convention */
436
405
  export interface OutputSourceFile {
437
- file_uri: string;
406
+ fileUri: string;
438
407
  content: string;
439
408
  }
440
409
 
441
- /* eslint-disable @typescript-eslint/naming-convention */
442
410
  export interface CodeBlock {
443
411
  content: string;
444
- programming_language: string;
412
+ programmingLanguage: string;
445
413
  }
446
- /* eslint-enable @typescript-eslint/naming-convention */
447
414
 
448
415
  export interface TextBlock {
449
416
  content: string;
450
417
  }
451
418
 
452
- /* eslint-disable @typescript-eslint/naming-convention */
453
419
  export interface PredictionMetadata {
454
420
  score: number;
455
- classifier_score: number;
421
+ classifierScore: number;
456
422
  }
457
423
 
458
- /* eslint-disable @typescript-eslint/naming-convention */
459
424
  export interface PromptFeedback {
460
- block_reason: BlockReason;
461
- safety_ratings: SafetyRating[];
462
- block_reason_message: string;
425
+ blockReason: BlockReason;
426
+ safetyRatings: SafetyRating[];
427
+ blockReasonMessage: string;
463
428
  }
464
- /* eslint-enable @typescript-eslint/naming-convention */
465
429
 
466
- /* eslint-disable @typescript-eslint/naming-convention */
467
430
  export interface UsageMetadata {
468
- prompt_token_count: number;
469
- candidates_token_count: number;
470
- total_token_count: number;
471
- thoughts_token_count: number;
472
- cached_content_token_count: number;
431
+ promptTokenCount: number;
432
+ candidatesTokenCount: number;
433
+ totalTokenCount: number;
434
+ thoughtsTokenCount: number;
435
+ cachedContentTokenCount: number;
473
436
  }
474
- /* eslint-enable @typescript-eslint/naming-convention */
475
437
 
476
- /* eslint-disable @typescript-eslint/naming-convention */
477
438
  export interface VideoMetadata {
478
- start_offset?: string; // Duration
479
- end_offset?: string; // Duration
439
+ startOffset?: string; // Duration
440
+ endOffset?: string; // Duration
480
441
  fps?: number;
481
442
  }
482
- /* eslint-enable @typescript-eslint/naming-convention */
483
443
 
484
- /* eslint-disable @typescript-eslint/naming-convention */
485
444
  export interface SendTelemetryRequest {
486
- feedback_metrics: FeedbackMetric[];
445
+ feedbackMetrics: FeedbackMetric[];
487
446
  }
488
- /* eslint-enable @typescript-eslint/naming-convention */
489
447
 
490
- /* eslint-disable @typescript-eslint/naming-convention */
491
448
  export interface FeedbackMetric {
492
- event_time: string; // Timestamp
493
- response_id: string;
494
- suggestion_offered?: SuggestionOffered;
495
- suggestion_interaction?: SuggestionInteraction;
449
+ eventTime: string; // Timestamp
450
+ responseId: string;
451
+ suggestionOffered?: SuggestionOffered;
452
+ suggestionInteraction?: SuggestionInteraction;
496
453
  }
497
- /* eslint-enable @typescript-eslint/naming-convention */
498
454
 
499
- /* eslint-disable @typescript-eslint/naming-convention */
500
455
  export interface SuggestionOffered {
501
456
  method?: Method;
502
457
  status?: SuggestionStatus;
503
- first_message_latency?: string; // Duration
504
- response_latency?: string; // Duration
458
+ firstMessageLatency?: string; // Duration
459
+ responseLatency?: string; // Duration
505
460
  displayed?: boolean;
506
- e2e_latency?: string; // Duration
507
- display_duration?: string; // Duration
508
- programming_language?: string;
461
+ e2eLatency?: string; // Duration
462
+ displayDuration?: string; // Duration
463
+ programmingLanguage?: string;
509
464
  }
510
- /* eslint-enable @typescript-eslint/naming-convention */
511
465
 
512
- /* eslint-disable @typescript-eslint/naming-convention */
513
466
  export interface SuggestionInteraction {
514
467
  interaction?: InteractionType;
515
- accepted_lines?: number;
516
- accepted_characters?: number;
517
- accepted_comment_lines?: number;
518
- candidate_index?: number;
468
+ acceptedLines?: number;
469
+ acceptedCharacters?: number;
470
+ acceptedCommentLines?: number;
471
+ candidateIndex?: number;
519
472
  }
520
- /* eslint-enable @typescript-eslint/naming-convention */
@@ -112,7 +112,7 @@ export class DevToolsCDPConnection implements CDPConnection {
112
112
  if ('error' in response && response.error) {
113
113
  callback?.(response.error, null);
114
114
  } else if ('result' in response) {
115
- callback?.(null, response.result as Object | null);
115
+ callback?.(null, response.result);
116
116
  }
117
117
  });
118
118
  }
@@ -190,7 +190,7 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
190
190
  /**
191
191
  * Set if a DOMNode is ad related.
192
192
  */
193
- #isAdRelatedInternal = false;
193
+ #adProvenance?: Protocol.Network.AdProvenance;
194
194
 
195
195
  constructor(domModel: DOMModel) {
196
196
  super();
@@ -292,7 +292,7 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
292
292
  this.setPseudoElements(payload.pseudoElements);
293
293
 
294
294
  if (payload.adProvenance) {
295
- this.#isAdRelatedInternal = true;
295
+ this.#adProvenance = payload.adProvenance;
296
296
  }
297
297
 
298
298
  if (this.#nodeType === Node.ELEMENT_NODE) {
@@ -331,21 +331,24 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
331
331
  return this.#topLayerIndex;
332
332
  }
333
333
 
334
- isAdRelatedNode(): boolean {
335
- // For iframes, we rely on `AdFrameType` to preserve legacy behavior and
336
- // prevent regressions.
337
- //
338
- // TODO(yaoxia): Deprecate the iframe-specific logic and consolidate
339
- // everything to use `#isAdRelatedInternal`.
340
- if (this.isIframe() && this.#frameOwnerFrameId) {
341
- const frame = FrameManager.instance().getFrame(this.#frameOwnerFrameId);
342
- if (!frame) {
343
- return false;
344
- }
345
- return frame.adFrameType() !== Protocol.Page.AdFrameType.None;
334
+ adProvenance(): Protocol.Network.AdProvenance|undefined {
335
+ if (this.#adProvenance !== undefined) {
336
+ return this.#adProvenance;
337
+ }
338
+
339
+ // AdProvenance can be unavailable for deeply nested OOPIF ad iframes
340
+ // (crbug.com/421202278). We rely on `AdFrameType` as a fallback.
341
+ if (!this.isIframe() || !this.#frameOwnerFrameId) {
342
+ return undefined;
346
343
  }
347
344
 
348
- return this.#isAdRelatedInternal;
345
+ const frame = FrameManager.instance().getFrame(this.#frameOwnerFrameId);
346
+ if (frame && frame.adFrameType() !== Protocol.Page.AdFrameType.None) {
347
+ // The frame is ad-related, but provenance information is unavailable.
348
+ return {};
349
+ }
350
+
351
+ return undefined;
349
352
  }
350
353
 
351
354
  isRootNode(): boolean {
@@ -425,8 +428,8 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
425
428
  }
426
429
  }
427
430
 
428
- setIsAdRelated(isAdRelated: boolean): void {
429
- this.#isAdRelatedInternal = isAdRelated;
431
+ setIsAdRelated(adProvenance?: Protocol.Network.AdProvenance): void {
432
+ this.#adProvenance = adProvenance;
430
433
  this.dispatchEventToListeners(DOMNodeEvents.AD_RELATED_STATE_UPDATED);
431
434
  }
432
435
 
@@ -1476,8 +1479,8 @@ export class DOMModel extends SDKModel<EventTypes> {
1476
1479
  return this.target().model(OverlayModel) as OverlayModel;
1477
1480
  }
1478
1481
 
1479
- static cancelSearch(): void {
1480
- for (const domModel of TargetManager.instance().models(DOMModel)) {
1482
+ static cancelSearch(targetManager: TargetManager = TargetManager.instance()): void {
1483
+ for (const domModel of targetManager.models(DOMModel)) {
1481
1484
  domModel.cancelSearch();
1482
1485
  }
1483
1486
  }
@@ -1832,12 +1835,11 @@ export class DOMModel extends SDKModel<EventTypes> {
1832
1835
  }
1833
1836
 
1834
1837
  adRelatedStateUpdated(nodeId: Protocol.DOM.NodeId, adProvenance?: Protocol.Network.AdProvenance): void {
1835
- const isAdRelated = adProvenance !== undefined;
1836
1838
  const node = this.nodeForId(nodeId);
1837
- if (!node || node.isAdRelatedNode() === isAdRelated) {
1839
+ if (!node) {
1838
1840
  return;
1839
1841
  }
1840
- node.setIsAdRelated(isAdRelated);
1842
+ node.setIsAdRelated(adProvenance);
1841
1843
  }
1842
1844
 
1843
1845
  affectedByStartingStylesFlagUpdated(nodeId: Protocol.DOM.NodeId, affectedByStartingStyles: boolean): void {
@@ -4,7 +4,6 @@
4
4
 
5
5
  import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
6
6
  import * as Protocol from '../../generated/protocol.js';
7
- import * as Common from '../common/common.js';
8
7
 
9
8
  import {CSSModel} from './CSSModel.js';
10
9
  import {MultitargetNetworkManager} from './NetworkManager.js';
@@ -50,7 +49,8 @@ export class EmulationModel extends SDKModel<EmulationModelEventTypes> implement
50
49
  }, this);
51
50
  }
52
51
 
53
- const disableJavascriptSetting = Common.Settings.Settings.instance().moduleSetting('java-script-disabled');
52
+ const settings = this.target().targetManager().settings;
53
+ const disableJavascriptSetting = settings.moduleSetting('java-script-disabled');
54
54
  disableJavascriptSetting.addChangeListener(
55
55
  async () =>
56
56
  await this.#emulationAgent.invoke_setScriptExecutionDisabled({value: disableJavascriptSetting.get()}));
@@ -58,14 +58,14 @@ export class EmulationModel extends SDKModel<EmulationModelEventTypes> implement
58
58
  void this.#emulationAgent.invoke_setScriptExecutionDisabled({value: true});
59
59
  }
60
60
 
61
- const touchSetting = Common.Settings.Settings.instance().moduleSetting('emulation.touch');
61
+ const touchSetting = settings.moduleSetting('emulation.touch');
62
62
  touchSetting.addChangeListener(() => {
63
63
  const settingValue = touchSetting.get();
64
64
 
65
65
  void this.overrideEmulateTouch(settingValue === 'force');
66
66
  });
67
67
 
68
- const idleDetectionSetting = Common.Settings.Settings.instance().moduleSetting('emulation.idle-detection');
68
+ const idleDetectionSetting = settings.moduleSetting('emulation.idle-detection');
69
69
  idleDetectionSetting.addChangeListener(async () => {
70
70
  const settingValue = idleDetectionSetting.get();
71
71
  if (settingValue === 'none') {
@@ -80,7 +80,7 @@ export class EmulationModel extends SDKModel<EmulationModelEventTypes> implement
80
80
  await this.setIdleOverride(emulationParams);
81
81
  });
82
82
 
83
- const cpuPressureDetectionSetting = Common.Settings.Settings.instance().moduleSetting('emulation.cpu-pressure');
83
+ const cpuPressureDetectionSetting = settings.moduleSetting('emulation.cpu-pressure');
84
84
  cpuPressureDetectionSetting.addChangeListener(async () => {
85
85
  const settingValue = cpuPressureDetectionSetting.get();
86
86
 
@@ -98,21 +98,19 @@ export class EmulationModel extends SDKModel<EmulationModelEventTypes> implement
98
98
  await this.setPressureStateOverride(settingValue);
99
99
  });
100
100
 
101
- const mediaTypeSetting = Common.Settings.Settings.instance().moduleSetting<string>('emulated-css-media');
102
- const mediaFeatureColorGamutSetting =
103
- Common.Settings.Settings.instance().moduleSetting<string>('emulated-css-media-feature-color-gamut');
101
+ const mediaTypeSetting = settings.moduleSetting<string>('emulated-css-media');
102
+ const mediaFeatureColorGamutSetting = settings.moduleSetting<string>('emulated-css-media-feature-color-gamut');
104
103
  const mediaFeaturePrefersColorSchemeSetting =
105
- Common.Settings.Settings.instance().moduleSetting<string>('emulated-css-media-feature-prefers-color-scheme');
106
- const mediaFeatureForcedColorsSetting =
107
- Common.Settings.Settings.instance().moduleSetting('emulated-css-media-feature-forced-colors');
104
+ settings.moduleSetting<string>('emulated-css-media-feature-prefers-color-scheme');
105
+ const mediaFeatureForcedColorsSetting = settings.moduleSetting('emulated-css-media-feature-forced-colors');
108
106
  const mediaFeaturePrefersContrastSetting =
109
- Common.Settings.Settings.instance().moduleSetting<string>('emulated-css-media-feature-prefers-contrast');
107
+ settings.moduleSetting<string>('emulated-css-media-feature-prefers-contrast');
110
108
  const mediaFeaturePrefersReducedDataSetting =
111
- Common.Settings.Settings.instance().moduleSetting<string>('emulated-css-media-feature-prefers-reduced-data');
112
- const mediaFeaturePrefersReducedTransparencySetting = Common.Settings.Settings.instance().moduleSetting<string>(
113
- 'emulated-css-media-feature-prefers-reduced-transparency');
109
+ settings.moduleSetting<string>('emulated-css-media-feature-prefers-reduced-data');
110
+ const mediaFeaturePrefersReducedTransparencySetting =
111
+ settings.moduleSetting<string>('emulated-css-media-feature-prefers-reduced-transparency');
114
112
  const mediaFeaturePrefersReducedMotionSetting =
115
- Common.Settings.Settings.instance().moduleSetting<string>('emulated-css-media-feature-prefers-reduced-motion');
113
+ settings.moduleSetting<string>('emulated-css-media-feature-prefers-reduced-motion');
116
114
  // Note: this uses a different format than what the CDP API expects,
117
115
  // because we want to update these values per media type/feature
118
116
  // without having to search the `features` array (inefficient) or
@@ -161,7 +159,7 @@ export class EmulationModel extends SDKModel<EmulationModelEventTypes> implement
161
159
  });
162
160
  void this.updateCssMedia();
163
161
 
164
- const autoDarkModeSetting = Common.Settings.Settings.instance().moduleSetting('emulate-auto-dark-mode');
162
+ const autoDarkModeSetting = settings.moduleSetting('emulate-auto-dark-mode');
165
163
  autoDarkModeSetting.addChangeListener(() => {
166
164
  const enabled = autoDarkModeSetting.get();
167
165
  mediaFeaturePrefersColorSchemeSetting.setDisabled(enabled);
@@ -174,13 +172,13 @@ export class EmulationModel extends SDKModel<EmulationModelEventTypes> implement
174
172
  void this.emulateAutoDarkMode(true);
175
173
  }
176
174
 
177
- const visionDeficiencySetting = Common.Settings.Settings.instance().moduleSetting('emulated-vision-deficiency');
175
+ const visionDeficiencySetting = settings.moduleSetting('emulated-vision-deficiency');
178
176
  visionDeficiencySetting.addChangeListener(() => this.emulateVisionDeficiency(visionDeficiencySetting.get()));
179
177
  if (visionDeficiencySetting.get()) {
180
178
  void this.emulateVisionDeficiency(visionDeficiencySetting.get());
181
179
  }
182
180
 
183
- const osTextScaleSetting = Common.Settings.Settings.instance().moduleSetting('emulated-os-text-scale');
181
+ const osTextScaleSetting = settings.moduleSetting('emulated-os-text-scale');
184
182
  osTextScaleSetting.addChangeListener(() => {
185
183
  void this.emulateOSTextScale(parseFloat(osTextScaleSetting.get()) || undefined);
186
184
  });
@@ -188,15 +186,15 @@ export class EmulationModel extends SDKModel<EmulationModelEventTypes> implement
188
186
  void this.emulateOSTextScale(parseFloat(osTextScaleSetting.get()) || undefined);
189
187
  }
190
188
 
191
- const localFontsDisabledSetting = Common.Settings.Settings.instance().moduleSetting('local-fonts-disabled');
189
+ const localFontsDisabledSetting = settings.moduleSetting('local-fonts-disabled');
192
190
  localFontsDisabledSetting.addChangeListener(() => this.setLocalFontsDisabled(localFontsDisabledSetting.get()));
193
191
  if (localFontsDisabledSetting.get()) {
194
192
  this.setLocalFontsDisabled(localFontsDisabledSetting.get());
195
193
  }
196
194
 
197
- const avifFormatDisabledSetting = Common.Settings.Settings.instance().moduleSetting('avif-format-disabled');
198
- const jpegXlFormatDisabledSetting = Common.Settings.Settings.instance().moduleSetting('jpeg-xl-format-disabled');
199
- const webpFormatDisabledSetting = Common.Settings.Settings.instance().moduleSetting('webp-format-disabled');
195
+ const avifFormatDisabledSetting = settings.moduleSetting('avif-format-disabled');
196
+ const jpegXlFormatDisabledSetting = settings.moduleSetting('jpeg-xl-format-disabled');
197
+ const webpFormatDisabledSetting = settings.moduleSetting('webp-format-disabled');
200
198
 
201
199
  const updateDisabledImageFormats = (): void => {
202
200
  const types = [];