chrome-devtools-frontend 1.0.939277 → 1.0.939473

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 (31) hide show
  1. package/.stylelintrc.json +1 -7
  2. package/config/gni/all_devtools_files.gni +0 -1
  3. package/config/gni/devtools_grd_files.gni +2 -0
  4. package/docs/triage_guidelines.md +13 -11
  5. package/front_end/Tests.js +33 -0
  6. package/front_end/core/host/UserMetrics.ts +1 -0
  7. package/front_end/core/i18n/locales/en-US.json +15 -0
  8. package/front_end/core/i18n/locales/en-XL.json +15 -0
  9. package/front_end/core/protocol_client/InspectorBackend.ts +4 -0
  10. package/front_end/core/root/Runtime.ts +4 -0
  11. package/front_end/core/sdk/CategorizedBreakpoint.ts +35 -0
  12. package/front_end/core/sdk/DOMDebuggerModel.ts +10 -41
  13. package/front_end/core/sdk/EventBreakpointsModel.ts +178 -0
  14. package/front_end/core/sdk/Target.ts +2 -1
  15. package/front_end/core/sdk/sdk.ts +4 -0
  16. package/front_end/entrypoints/main/main-meta.ts +0 -2
  17. package/front_end/entrypoints/shell/shell.js +1 -0
  18. package/front_end/entrypoints/shell/shell.json +0 -1
  19. package/front_end/panels/browser_debugger/CSPViolationBreakpointsSidebarPane.ts +2 -2
  20. package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +7 -7
  21. package/front_end/panels/browser_debugger/EventListenerBreakpointsSidebarPane.ts +14 -6
  22. package/front_end/panels/network/RequestPayloadView.ts +2 -0
  23. package/front_end/panels/network/requestPayloadTree.css +5 -0
  24. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +1 -0
  25. package/front_end/panels/sources/DebuggerPausedMessage.ts +14 -7
  26. package/package.json +1 -1
  27. package/scripts/eslint_rules/lib/check_component_naming.js +1 -1
  28. package/scripts/eslint_rules/lib/enforce_custom_event_names.js +1 -1
  29. package/scripts/eslint_rules/lib/l10n_no_i18nString_calls_module_instantiation.js +1 -1
  30. package/scripts/eslint_rules/lib/no_underscored_properties.js +1 -1
  31. package/front_end/entrypoints/main/module.json +0 -5
package/.stylelintrc.json CHANGED
@@ -27,11 +27,5 @@
27
27
  "property-no-vendor-prefix": null,
28
28
  "value-no-vendor-prefix": null,
29
29
  "media-feature-name-no-vendor-prefix": null
30
- },
31
- "overrides": [
32
- {
33
- "files": ["**/*.ts"],
34
- "customSyntax": "html"
35
- }
36
- ]
30
+ }
37
31
  }
@@ -58,7 +58,6 @@ all_devtools_files = [
58
58
  "front_end/legacy_test_runner/layers_test_runner/layers_test_runner.js",
59
59
  "front_end/panels/layer_viewer/module.json",
60
60
  "front_end/panels/layers/module.json",
61
- "front_end/entrypoints/main/module.json",
62
61
  "front_end/panels/media/module.json",
63
62
  "front_end/entrypoints/ndb_app/ndb_app.json",
64
63
  "front_end/legacy_test_runner/network_test_runner/network_test_runner.js",
@@ -595,6 +595,7 @@ grd_files_debug_sources = [
595
595
  "front_end/core/sdk/CSSRule.js",
596
596
  "front_end/core/sdk/CSSStyleDeclaration.js",
597
597
  "front_end/core/sdk/CSSStyleSheetHeader.js",
598
+ "front_end/core/sdk/CategorizedBreakpoint.js",
598
599
  "front_end/core/sdk/ChildTargetManager.js",
599
600
  "front_end/core/sdk/CompilerSourceMappingContentProvider.js",
600
601
  "front_end/core/sdk/Connections.js",
@@ -607,6 +608,7 @@ grd_files_debug_sources = [
607
608
  "front_end/core/sdk/DOMModel.js",
608
609
  "front_end/core/sdk/DebuggerModel.js",
609
610
  "front_end/core/sdk/EmulationModel.js",
611
+ "front_end/core/sdk/EventBreakpointsModel.js",
610
612
  "front_end/core/sdk/FilmStripModel.js",
611
613
  "front_end/core/sdk/FrameAssociated.js",
612
614
  "front_end/core/sdk/FrameManager.js",
@@ -43,22 +43,24 @@ Issues in the untriaged queue should receive a meaningful response within a busi
43
43
 
44
44
  ## How should issues be triaged?
45
45
 
46
- An issue is triaged when it meets the following criteria:
47
-
48
- - Priority is set correctly
49
- - Component is set correctly
50
- - Type is set correctly especially consider Feature vs Bug vs Bug-Regression
51
- - Status is set correctly (Available most of the time)
52
- - Request bisection from the Chrome Test Engineer team by adding the label "Needs-Bisect".
46
+ - Close issues as `WontFix` if they don't reproduce (in simple cases) or are requests for features we've already concluded not to pursue.
47
+ - Close issues as `Archived` that are valid, but it seems unlikely that we will get there anytime soon.
48
+ - Move issues out of `Platform>DevTools` if they are not DevTools issues (but just reported via the menu item in DevTools), put on the `Hotlist-DevTools-Triaged` and leave the `Untriaged` status as is.
49
+ - Assign regression bugs with bisects to individuals directly and set the status to `Assigned`.
50
+ - Put proper `Platform>DevTools>XXX` component(s) on the issue and do an initial check-in regarding the priority.
51
+ - Put one of the following labels on it and set the status to "Available":
52
+ - `Hotlist-DevTools-ProductReview` if it's controversial or clear that consensus needs to be built first.
53
+ - `Hotlist-DevTools-BrowserAutomation-Backlog` if it's an issue related to ChromeDriver or puppeteer.
54
+ - `Hotlist-DevTools-Debugging-Backlog` if it's a debugging issue.
55
+ - `Hotlist-DevTools-DesignAccessibility-Backlog` if it's a design or accessibility issue.
56
+ - `Hotlist-DevTools-Performance-Backlog` if the issue is related to our performance tooling (i.e. Performance panel, Lighthouse).
57
+ - `Hotlist-DevTools-Backlog` if it's a general DevTools issue that is not specific to one of the core areas.
58
+ - Also remember to put the Needs-UX label on it, if help from a designer is likely to be required.
53
59
 
54
60
  ### Setting Assigned or Available
55
61
 
56
62
  Set issues to Available if they don’t need immediate action and nobody right now and in the short-term future (an iteration) needs to work on it.
57
63
 
58
- If you think they should be addressed in the short-term please add the label “Hotlist-DevTools-CurrentSprint”.
59
-
60
- If you think they should be addressed mid-term or the next iteration, please add the label “Hotlist-DevTools-Backlog”
61
-
62
64
  Issues that are handled by Microsoft have the label “Hotlist-DevTools-MS-Backlog” and “Hotlist-DevTools-MS-CurrentSprint” respectively and can be considered triaged.
63
65
 
64
66
  If you think they are super urgent, please assign them to yangguo@chromium.org and cc bmeurer@chromium.org and hablich@chromium.org.
@@ -1290,6 +1290,7 @@
1290
1290
 
1291
1291
  TestSuite.prototype.testInspectedElementIs = async function(nodeName) {
1292
1292
  this.takeControl();
1293
+ await self.runtime.loadLegacyModule('panels/elements/elements-legacy.js');
1293
1294
  if (!Elements.ElementsPanel.firstInspectElementNodeNameForTest) {
1294
1295
  await new Promise(f => this.addSniffer(Elements.ElementsPanel, 'firstInspectElementCompletedForTest', f));
1295
1296
  }
@@ -1438,6 +1439,38 @@
1438
1439
  this.releaseControl();
1439
1440
  };
1440
1441
 
1442
+ TestSuite.prototype.testInputDispatchEventsToCorrectTarget = async function() {
1443
+ this.takeControl();
1444
+
1445
+ const mainTarget = self.SDK.targetManager.mainTarget();
1446
+ const otherTarget = await createIsolatedTarget('about:blank');
1447
+
1448
+ const setupLogging = `
1449
+ window.logs = [];
1450
+ ['dragenter', 'keydown', 'mousedown', 'mouseenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover', 'mouseup',
1451
+ 'click', 'touchcancel', 'touchend', 'touchmove', 'touchstart',
1452
+ ].forEach((event) => window.addEventListener(event, (e) => logs.push(e.type)));`;
1453
+ await evalCode(mainTarget, setupLogging);
1454
+ await evalCode(otherTarget, setupLogging);
1455
+
1456
+ const inputAgent = mainTarget.inputAgent();
1457
+ await inputAgent.invoke_dispatchMouseEvent({type: 'mousePressed', button: 'left', clickCount: 1, x: 100, y: 250});
1458
+ await inputAgent.invoke_dispatchMouseEvent({type: 'mouseMoved', button: 'left', clickCount: 1, x: 110, y: 270});
1459
+ await inputAgent.invoke_dispatchMouseEvent({type: 'mouseReleased', button: 'left', clickCount: 1, x: 110, y: 270});
1460
+ await inputAgent.invoke_dispatchDragEvent(
1461
+ {type: 'dragEnter', x: 100, y: 250, data: {items: [], dragOperationsMask: 1}});
1462
+ await inputAgent.invoke_synthesizeTapGesture({x: 100, y: 250});
1463
+ await inputAgent.invoke_dispatchKeyEvent({type: 'keyDown', key: 'a'});
1464
+
1465
+ const mainTargetEvents = await evalCode(mainTarget, ' logs.join(\' \')');
1466
+ const otherTargetEvents = await evalCode(otherTarget, 'logs.join(\' \')');
1467
+ this.assertEquals(
1468
+ 'mainTargetEvents: mouseover mousedown mousemove mouseup click dragenter keydown; otherTargetEvents: ',
1469
+ `mainTargetEvents: ${mainTargetEvents}; otherTargetEvents: ${otherTargetEvents}`);
1470
+
1471
+ this.releaseControl();
1472
+ };
1473
+
1441
1474
  TestSuite.prototype.testLoadResourceForFrontend = async function(baseURL, fileURL) {
1442
1475
  const test = this;
1443
1476
  const loggedHeaders = new Set(['cache-control', 'pragma']);
@@ -378,6 +378,7 @@ export const PanelCodes: {
378
378
  'issues-pane': 37,
379
379
  'settings-keybinds': 38,
380
380
  'cssoverview': 39,
381
+ 'chrome_recorder': 40,
381
382
  };
382
383
 
383
384
  export const SidebarPaneCodes: {
@@ -401,6 +401,21 @@
401
401
  "core/sdk/DOMDebuggerModel.ts | xhr": {
402
402
  "message": "XHR"
403
403
  },
404
+ "core/sdk/EventBreakpointsModel.ts | auctionWorklet": {
405
+ "message": "Ad Auction Worklet"
406
+ },
407
+ "core/sdk/EventBreakpointsModel.ts | beforeBidderWorkletBiddingStart": {
408
+ "message": "Bidder Bidding Phase Start"
409
+ },
410
+ "core/sdk/EventBreakpointsModel.ts | beforeBidderWorkletReportingStart": {
411
+ "message": "Bidder Reporting Phase Start"
412
+ },
413
+ "core/sdk/EventBreakpointsModel.ts | beforeSellerWorkletReportingStart": {
414
+ "message": "Seller Reporting Phase Start"
415
+ },
416
+ "core/sdk/EventBreakpointsModel.ts | beforeSellerWorkletScoringStart": {
417
+ "message": "Seller Scoring Phase Start"
418
+ },
404
419
  "core/sdk/NetworkManager.ts | crossoriginReadBlockingCorb": {
405
420
  "message": "Cross-Origin Read Blocking (CORB) blocked cross-origin response {PH1} with MIME type {PH2}. See https://www.chromestatus.com/feature/5629709824032768 for more details."
406
421
  },
@@ -401,6 +401,21 @@
401
401
  "core/sdk/DOMDebuggerModel.ts | xhr": {
402
402
  "message": "X̂H́R̂"
403
403
  },
404
+ "core/sdk/EventBreakpointsModel.ts | auctionWorklet": {
405
+ "message": "Âd́ Âúĉt́îón̂ Ẃôŕk̂ĺêt́"
406
+ },
407
+ "core/sdk/EventBreakpointsModel.ts | beforeBidderWorkletBiddingStart": {
408
+ "message": "B̂íd̂d́êŕ B̂íd̂d́îńĝ Ṕĥáŝé Ŝt́âŕt̂"
409
+ },
410
+ "core/sdk/EventBreakpointsModel.ts | beforeBidderWorkletReportingStart": {
411
+ "message": "B̂íd̂d́êŕ R̂ép̂ór̂t́îńĝ Ṕĥáŝé Ŝt́âŕt̂"
412
+ },
413
+ "core/sdk/EventBreakpointsModel.ts | beforeSellerWorkletReportingStart": {
414
+ "message": "Ŝél̂ĺêŕ R̂ép̂ór̂t́îńĝ Ṕĥáŝé Ŝt́âŕt̂"
415
+ },
416
+ "core/sdk/EventBreakpointsModel.ts | beforeSellerWorkletScoringStart": {
417
+ "message": "Ŝél̂ĺêŕ Ŝćôŕîńĝ Ṕĥáŝé Ŝt́âŕt̂"
418
+ },
404
419
  "core/sdk/NetworkManager.ts | crossoriginReadBlockingCorb": {
405
420
  "message": "Ĉŕôśŝ-Ór̂íĝín̂ Ŕêád̂ B́l̂óĉḱîńĝ (ĆÔŔB̂) b́l̂óĉḱêd́ ĉŕôśŝ-ór̂íĝín̂ ŕêśp̂ón̂śê {PH1} ẃît́ĥ ḾÎḾÊ t́ŷṕê {PH2}. Śêé ĥt́t̂ṕŝ://ẃŵẃ.ĉh́r̂óm̂éŝt́ât́ûś.ĉóm̂/f́êát̂úr̂é/5629709824032768 f̂ór̂ ḿôŕê d́êt́âíl̂ś."
406
421
  },
@@ -644,6 +644,10 @@ export class TargetBase {
644
644
  return this.getAgent('Emulation');
645
645
  }
646
646
 
647
+ eventBreakpointsAgent(): ProtocolProxyApi.EventBreakpointsApi {
648
+ return this.getAgent('EventBreakpoints');
649
+ }
650
+
647
651
  heapProfilerAgent(): ProtocolProxyApi.HeapProfilerApi {
648
652
  return this.getAgent('HeapProfiler');
649
653
  }
@@ -232,6 +232,10 @@ export class Runtime {
232
232
  getModulesMap(): {[x: string]: Module} {
233
233
  return this.modulesMap;
234
234
  }
235
+
236
+ loadLegacyModule(modulePath: string): Promise<void> {
237
+ return import(`../../${modulePath}`);
238
+ }
235
239
  }
236
240
 
237
241
  export class ModuleDescriptor {
@@ -0,0 +1,35 @@
1
+ // Copyright 2021 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ export class CategorizedBreakpoint {
6
+ readonly #categoryInternal: string;
7
+ titleInternal: string;
8
+ enabledInternal: boolean;
9
+
10
+ constructor(category: string, title: string) {
11
+ this.#categoryInternal = category;
12
+ this.titleInternal = title;
13
+ this.enabledInternal = false;
14
+ }
15
+
16
+ category(): string {
17
+ return this.#categoryInternal;
18
+ }
19
+
20
+ enabled(): boolean {
21
+ return this.enabledInternal;
22
+ }
23
+
24
+ setEnabled(enabled: boolean): void {
25
+ this.enabledInternal = enabled;
26
+ }
27
+
28
+ title(): string {
29
+ return this.titleInternal;
30
+ }
31
+
32
+ setTitle(title: string): void {
33
+ this.titleInternal = title;
34
+ }
35
+ }
@@ -7,6 +7,7 @@ import * as i18n from '../i18n/i18n.js';
7
7
  import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
8
8
  import * as Protocol from '../../generated/protocol.js';
9
9
 
10
+ import {CategorizedBreakpoint} from './CategorizedBreakpoint.js';
10
11
  import type {Location} from './DebuggerModel.js';
11
12
  import type {DOMNode} from './DOMModel.js';
12
13
  import {DOMModel, Events as DOMModelEvents} from './DOMModel.js';
@@ -690,38 +691,6 @@ export namespace EventListener {
690
691
  }
691
692
  }
692
693
 
693
- export class CategorizedBreakpoint {
694
- readonly #categoryInternal: string;
695
- titleInternal: string;
696
- enabledInternal: boolean;
697
-
698
- constructor(category: string, title: string) {
699
- this.#categoryInternal = category;
700
- this.titleInternal = title;
701
- this.enabledInternal = false;
702
- }
703
-
704
- category(): string {
705
- return this.#categoryInternal;
706
- }
707
-
708
- enabled(): boolean {
709
- return this.enabledInternal;
710
- }
711
-
712
- setEnabled(enabled: boolean): void {
713
- this.enabledInternal = enabled;
714
- }
715
-
716
- title(): string {
717
- return this.titleInternal;
718
- }
719
-
720
- setTitle(title: string): void {
721
- this.titleInternal = title;
722
- }
723
- }
724
-
725
694
  export class CSPViolationBreakpoint extends CategorizedBreakpoint {
726
695
  readonly #typeInternal: Protocol.DOMDebugger.CSPViolationType;
727
696
  constructor(category: string, title: string, type: Protocol.DOMDebugger.CSPViolationType) {
@@ -734,7 +703,7 @@ export class CSPViolationBreakpoint extends CategorizedBreakpoint {
734
703
  }
735
704
  }
736
705
 
737
- export class EventListenerBreakpoint extends CategorizedBreakpoint {
706
+ export class DOMEventListenerBreakpoint extends CategorizedBreakpoint {
738
707
  readonly instrumentationName: string;
739
708
  readonly eventName: string;
740
709
  readonly eventTargetNames: string[];
@@ -784,7 +753,7 @@ export class DOMDebuggerManager implements SDKModelObserver<DOMDebuggerModel> {
784
753
  readonly #xhrBreakpointsSetting: Common.Settings.Setting<{url: string, enabled: boolean}[]>;
785
754
  readonly #xhrBreakpointsInternal: Map<string, boolean>;
786
755
  readonly #cspViolationsToBreakOn: CSPViolationBreakpoint[];
787
- readonly #eventListenerBreakpointsInternal: EventListenerBreakpoint[];
756
+ readonly #eventListenerBreakpointsInternal: DOMEventListenerBreakpoint[];
788
757
 
789
758
  constructor() {
790
759
  this.#xhrBreakpointsSetting = Common.Settings.Settings.instance().createLocalSetting('xhrBreakpoints', []);
@@ -933,19 +902,19 @@ export class DOMDebuggerManager implements SDKModelObserver<DOMDebuggerModel> {
933
902
  private createInstrumentationBreakpoints(category: string, instrumentationNames: string[]): void {
934
903
  for (const instrumentationName of instrumentationNames) {
935
904
  this.#eventListenerBreakpointsInternal.push(
936
- new EventListenerBreakpoint(instrumentationName, '', [], category, instrumentationName));
905
+ new DOMEventListenerBreakpoint(instrumentationName, '', [], category, instrumentationName));
937
906
  }
938
907
  }
939
908
 
940
909
  private createEventListenerBreakpoints(category: string, eventNames: string[], eventTargetNames: string[]): void {
941
910
  for (const eventName of eventNames) {
942
911
  this.#eventListenerBreakpointsInternal.push(
943
- new EventListenerBreakpoint('', eventName, eventTargetNames, category, eventName));
912
+ new DOMEventListenerBreakpoint('', eventName, eventTargetNames, category, eventName));
944
913
  }
945
914
  }
946
915
 
947
- private resolveEventListenerBreakpointInternal(eventName: string, eventTargetName?: string): EventListenerBreakpoint
948
- |null {
916
+ private resolveEventListenerBreakpointInternal(eventName: string, eventTargetName?: string):
917
+ DOMEventListenerBreakpoint|null {
949
918
  const instrumentationPrefix = 'instrumentation:';
950
919
  const listenerPrefix = 'listener:';
951
920
  let instrumentationName = '';
@@ -958,7 +927,7 @@ export class DOMDebuggerManager implements SDKModelObserver<DOMDebuggerModel> {
958
927
  return null;
959
928
  }
960
929
  eventTargetName = (eventTargetName || '*').toLowerCase();
961
- let result: EventListenerBreakpoint|null = null;
930
+ let result: DOMEventListenerBreakpoint|null = null;
962
931
  for (const breakpoint of this.#eventListenerBreakpointsInternal) {
963
932
  if (instrumentationName && breakpoint.instrumentationName === instrumentationName) {
964
933
  result = breakpoint;
@@ -975,7 +944,7 @@ export class DOMDebuggerManager implements SDKModelObserver<DOMDebuggerModel> {
975
944
  return result;
976
945
  }
977
946
 
978
- eventListenerBreakpoints(): EventListenerBreakpoint[] {
947
+ eventListenerBreakpoints(): DOMEventListenerBreakpoint[] {
979
948
  return this.#eventListenerBreakpointsInternal.slice();
980
949
  }
981
950
 
@@ -1008,7 +977,7 @@ export class DOMDebuggerManager implements SDKModelObserver<DOMDebuggerModel> {
1008
977
  resolveEventListenerBreakpoint(auxData: {
1009
978
  eventName: string,
1010
979
  targetName: string,
1011
- }): EventListenerBreakpoint|null {
980
+ }): DOMEventListenerBreakpoint|null {
1012
981
  return this.resolveEventListenerBreakpointInternal(auxData['eventName'], auxData['targetName']);
1013
982
  }
1014
983
 
@@ -0,0 +1,178 @@
1
+ // Copyright 2021 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import type * as Common from '../common/common.js';
6
+ import * as i18n from '../i18n/i18n.js';
7
+ import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
8
+
9
+ import {CategorizedBreakpoint} from './CategorizedBreakpoint.js';
10
+ import type {Target} from './Target.js';
11
+ import {Capability} from './Target.js';
12
+ import {SDKModel} from './SDKModel.js';
13
+ import type {SDKModelObserver} from './TargetManager.js';
14
+ import {TargetManager} from './TargetManager.js';
15
+
16
+ const UIStrings = {
17
+ /**
18
+ * @description Category of breakpoints
19
+ */
20
+ auctionWorklet: 'Ad Auction Worklet',
21
+
22
+ /**
23
+ * @description Name of a breakpoint type.
24
+ * https://github.com/WICG/turtledove/blob/main/FLEDGE.md#32-on-device-bidding
25
+ */
26
+ beforeBidderWorkletBiddingStart: 'Bidder Bidding Phase Start',
27
+
28
+ /**
29
+ * @description Name of a breakpoint type.
30
+ * https://github.com/WICG/turtledove/blob/main/FLEDGE.md#52-buyer-reporting-on-render-and-ad-events
31
+ */
32
+ beforeBidderWorkletReportingStart: 'Bidder Reporting Phase Start',
33
+
34
+ /**
35
+ * @description Name of a breakpoint type.
36
+ * https://github.com/WICG/turtledove/blob/main/FLEDGE.md#23-scoring-bids
37
+ */
38
+ beforeSellerWorkletScoringStart: 'Seller Scoring Phase Start',
39
+
40
+ /**
41
+ * @description Name of a breakpoint type.
42
+ * https://github.com/WICG/turtledove/blob/main/FLEDGE.md#51-seller-reporting-on-render
43
+ */
44
+ beforeSellerWorkletReportingStart: 'Seller Reporting Phase Start',
45
+ };
46
+
47
+ const str_ = i18n.i18n.registerUIStrings('core/sdk/EventBreakpointsModel.ts', UIStrings);
48
+ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
49
+
50
+ const enum InstrumentationNames {
51
+ BeforeBidderWorkletBiddingStart = 'beforeBidderWorkletBiddingStart',
52
+ BeforeBidderWorkletReportingStart = 'beforeBidderWorkletReportingStart',
53
+ BeforeSellerWorkletScoringStart = 'beforeSellerWorkletScoringStart',
54
+ BeforeSellerWorkletReportingStart = 'beforeSellerWorkletReportingStart',
55
+ }
56
+
57
+ function getTitleForInstrumentationName(instrumentationName: InstrumentationNames): Common.UIString.LocalizedString {
58
+ switch (instrumentationName) {
59
+ case InstrumentationNames.BeforeBidderWorkletBiddingStart:
60
+ return i18nString(UIStrings.beforeBidderWorkletBiddingStart);
61
+
62
+ case InstrumentationNames.BeforeBidderWorkletReportingStart:
63
+ return i18nString(UIStrings.beforeBidderWorkletReportingStart);
64
+
65
+ case InstrumentationNames.BeforeSellerWorkletScoringStart:
66
+ return i18nString(UIStrings.beforeSellerWorkletScoringStart);
67
+
68
+ case InstrumentationNames.BeforeSellerWorkletReportingStart:
69
+ return i18nString(UIStrings.beforeSellerWorkletReportingStart);
70
+ }
71
+ }
72
+
73
+ export class EventBreakpointsModel extends SDKModel<void> {
74
+ readonly agent: ProtocolProxyApi.EventBreakpointsApi;
75
+
76
+ constructor(target: Target) {
77
+ super(target);
78
+ this.agent = target.eventBreakpointsAgent();
79
+ }
80
+ }
81
+
82
+ // This implementation (as opposed to similar class in DOMDebuggerModel) is for
83
+ // instrumentation breakpoints in targets that run JS but do not have a DOM.
84
+ class EventListenerBreakpoint extends CategorizedBreakpoint {
85
+ readonly instrumentationName: string;
86
+ constructor(instrumentationName: InstrumentationNames, category: string) {
87
+ super(category, getTitleForInstrumentationName(instrumentationName));
88
+ this.instrumentationName = instrumentationName;
89
+ }
90
+
91
+ setEnabled(enabled: boolean): void {
92
+ if (this.enabled() === enabled) {
93
+ return;
94
+ }
95
+ super.setEnabled(enabled);
96
+ for (const model of TargetManager.instance().models(EventBreakpointsModel)) {
97
+ this.updateOnModel(model);
98
+ }
99
+ }
100
+
101
+ updateOnModel(model: EventBreakpointsModel): void {
102
+ if (this.enabled()) {
103
+ model.agent.invoke_setInstrumentationBreakpoint({eventName: this.instrumentationName});
104
+ } else {
105
+ model.agent.invoke_removeInstrumentationBreakpoint({eventName: this.instrumentationName});
106
+ }
107
+ }
108
+
109
+ static readonly instrumentationPrefix = 'instrumentation:';
110
+ }
111
+
112
+ let eventBreakpointManagerInstance: EventBreakpointsManager;
113
+
114
+ export class EventBreakpointsManager implements SDKModelObserver<EventBreakpointsModel> {
115
+ readonly #eventListenerBreakpointsInternal: EventListenerBreakpoint[] = [];
116
+
117
+ constructor() {
118
+ this.createInstrumentationBreakpoints(i18nString(UIStrings.auctionWorklet), [
119
+ InstrumentationNames.BeforeBidderWorkletBiddingStart,
120
+ InstrumentationNames.BeforeBidderWorkletReportingStart,
121
+ InstrumentationNames.BeforeSellerWorkletScoringStart,
122
+ InstrumentationNames.BeforeSellerWorkletReportingStart,
123
+ ]);
124
+
125
+ TargetManager.instance().observeModels(EventBreakpointsModel, this);
126
+ }
127
+
128
+ static instance(opts: {
129
+ forceNew: boolean|null,
130
+ } = {forceNew: null}): EventBreakpointsManager {
131
+ const {forceNew} = opts;
132
+ if (!eventBreakpointManagerInstance || forceNew) {
133
+ eventBreakpointManagerInstance = new EventBreakpointsManager();
134
+ }
135
+
136
+ return eventBreakpointManagerInstance;
137
+ }
138
+
139
+ private createInstrumentationBreakpoints(category: string, instrumentationNames: InstrumentationNames[]): void {
140
+ for (const instrumentationName of instrumentationNames) {
141
+ this.#eventListenerBreakpointsInternal.push(new EventListenerBreakpoint(instrumentationName, category));
142
+ }
143
+ }
144
+
145
+ eventListenerBreakpoints(): EventListenerBreakpoint[] {
146
+ return this.#eventListenerBreakpointsInternal.slice();
147
+ }
148
+
149
+ resolveEventListenerBreakpointTitle(auxData: {
150
+ eventName: string,
151
+ }): string|null {
152
+ const breakpoint = this.resolveEventListenerBreakpoint(auxData);
153
+ return breakpoint ? breakpoint.title() : null;
154
+ }
155
+
156
+ resolveEventListenerBreakpoint(auxData: {eventName: string}): EventListenerBreakpoint|null {
157
+ const eventName = auxData.eventName;
158
+ if (!eventName.startsWith(EventListenerBreakpoint.instrumentationPrefix)) {
159
+ return null;
160
+ }
161
+
162
+ const instrumentationName = eventName.substring(EventListenerBreakpoint.instrumentationPrefix.length);
163
+ return this.#eventListenerBreakpointsInternal.find(b => b.instrumentationName === instrumentationName) || null;
164
+ }
165
+
166
+ modelAdded(eventBreakpointModel: EventBreakpointsModel): void {
167
+ for (const breakpoint of this.#eventListenerBreakpointsInternal) {
168
+ if (breakpoint.enabled()) {
169
+ breakpoint.updateOnModel(eventBreakpointModel);
170
+ }
171
+ }
172
+ }
173
+
174
+ modelRemoved(_eventBreakpointModel: EventBreakpointsModel): void {
175
+ }
176
+ }
177
+
178
+ SDKModel.register(EventBreakpointsModel, {capabilities: Capability.EventBreakpoints, autostart: false});
@@ -67,7 +67,7 @@ export class Target extends ProtocolClient.InspectorBackend.TargetBase {
67
67
  this.#capabilitiesMask = Capability.JS;
68
68
  break;
69
69
  case Type.AuctionWorklet:
70
- this.#capabilitiesMask = Capability.JS;
70
+ this.#capabilitiesMask = Capability.JS | Capability.EventBreakpoints;
71
71
  break;
72
72
  case Type.Browser:
73
73
  this.#capabilitiesMask = Capability.Target | Capability.IO;
@@ -249,5 +249,6 @@ export enum Capability {
249
249
  WebAuthn = 1 << 16,
250
250
  IO = 1 << 17,
251
251
  Media = 1 << 18,
252
+ EventBreakpoints = 1 << 19,
252
253
  None = 0,
253
254
  }
@@ -11,6 +11,7 @@ import './NetworkManager.js';
11
11
  import './RuntimeModel.js';
12
12
 
13
13
  import * as AccessibilityModel from './AccessibilityModel.js';
14
+ import * as CategorizedBreakpoint from './CategorizedBreakpoint.js';
14
15
  import * as ChildTargetManager from './ChildTargetManager.js';
15
16
  import * as CompilerSourceMappingContentProvider from './CompilerSourceMappingContentProvider.js';
16
17
  import * as Connections from './Connections.js';
@@ -37,6 +38,7 @@ import * as DebuggerModel from './DebuggerModel.js';
37
38
  import * as DOMDebuggerModel from './DOMDebuggerModel.js';
38
39
  import * as DOMModel from './DOMModel.js';
39
40
  import * as EmulationModel from './EmulationModel.js';
41
+ import * as EventBreakpointsModel from './EventBreakpointsModel.js';
40
42
  import * as FilmStripModel from './FilmStripModel.js';
41
43
  import * as FrameManager from './FrameManager.js';
42
44
  import * as HeapProfilerModel from './HeapProfilerModel.js';
@@ -76,6 +78,7 @@ import * as WebAuthnModel from './WebAuthnModel.js';
76
78
 
77
79
  export {
78
80
  AccessibilityModel,
81
+ CategorizedBreakpoint,
79
82
  ChildTargetManager,
80
83
  CompilerSourceMappingContentProvider,
81
84
  Connections,
@@ -102,6 +105,7 @@ export {
102
105
  DOMDebuggerModel,
103
106
  DOMModel,
104
107
  EmulationModel,
108
+ EventBreakpointsModel,
105
109
  FilmStripModel,
106
110
  FrameManager,
107
111
  HeapProfilerModel,
@@ -223,8 +223,6 @@ let loadedInspectorMainModule: (typeof InspectorMain|undefined);
223
223
 
224
224
  async function loadMainModule(): Promise<typeof Main> {
225
225
  if (!loadedMainModule) {
226
- // Side-effect import resources in module.json
227
- await Root.Runtime.Runtime.instance().loadModulePromise('entrypoints/main');
228
226
  loadedMainModule = await import('./main.js');
229
227
  }
230
228
  return loadedMainModule;
@@ -20,4 +20,5 @@ import '../../models/persistence/persistence-legacy.js';
20
20
  import '../../models/extensions/extensions-legacy.js';
21
21
 
22
22
  import './shell-meta-files.js';
23
+ import '../main/main.js';
23
24
  // We generate the descriptors in this file, which depend on the runtime.
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "modules": [
3
- { "name": "entrypoints/main", "type": "autostart" },
4
3
  { "name": "ui/legacy", "type": "autostart" },
5
4
  { "name": "ui/legacy/components/text_editor", "type": "autostart" },
6
5
  { "name": "ui/legacy/components/source_frame", "type": "autostart" },
@@ -26,14 +26,14 @@ export class CSPViolationBreakpointsSidebarPane extends CategorizedBreakpointsSi
26
26
  }
27
27
 
28
28
  protected getBreakpointFromPausedDetails(details: SDK.DebuggerModel.DebuggerPausedDetails):
29
- SDK.DOMDebuggerModel.CategorizedBreakpoint|null {
29
+ SDK.CategorizedBreakpoint.CategorizedBreakpoint|null {
30
30
  const breakpointType = details.auxData && details.auxData['violationType'] ? details.auxData['violationType'] : '';
31
31
  const breakpoints = SDK.DOMDebuggerModel.DOMDebuggerManager.instance().cspViolationBreakpoints();
32
32
  const breakpoint = breakpoints.find(x => x.type() === breakpointType);
33
33
  return breakpoint ? breakpoint : null;
34
34
  }
35
35
 
36
- protected toggleBreakpoint(breakpoint: SDK.DOMDebuggerModel.CategorizedBreakpoint, enabled: boolean): void {
36
+ protected toggleBreakpoint(breakpoint: SDK.CategorizedBreakpoint.CategorizedBreakpoint, enabled: boolean): void {
37
37
  breakpoint.setEnabled(enabled);
38
38
  SDK.DOMDebuggerModel.DOMDebuggerManager.instance().updateCSPViolationBreakpoints();
39
39
  }
@@ -24,10 +24,10 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
24
24
  readonly #viewId: string;
25
25
  readonly #detailsPausedReason: Protocol.Debugger.PausedEventReason;
26
26
  readonly #categories: Map<string, Item>;
27
- readonly #breakpoints: Map<SDK.DOMDebuggerModel.CategorizedBreakpoint, Item>;
27
+ readonly #breakpoints: Map<SDK.CategorizedBreakpoint.CategorizedBreakpoint, Item>;
28
28
  #highlightedElement?: HTMLLIElement;
29
29
  constructor(
30
- categories: string[], breakpoints: SDK.DOMDebuggerModel.CategorizedBreakpoint[], viewId: string,
30
+ categories: string[], breakpoints: SDK.CategorizedBreakpoint.CategorizedBreakpoint[], viewId: string,
31
31
  detailsPausedReason: Protocol.Debugger.PausedEventReason) {
32
32
  super(true);
33
33
  this.#categoriesTreeOutline = new UI.TreeOutline.TreeOutlineInShadow();
@@ -66,7 +66,7 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
66
66
  return this.#categories;
67
67
  }
68
68
 
69
- get breakpoints(): Map<SDK.DOMDebuggerModel.CategorizedBreakpoint, Item> {
69
+ get breakpoints(): Map<SDK.CategorizedBreakpoint.CategorizedBreakpoint, Item> {
70
70
  return this.#breakpoints;
71
71
  }
72
72
 
@@ -96,7 +96,7 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
96
96
  this.#categories.set(name, {element: treeElement, checkbox: labelNode.checkboxElement});
97
97
  }
98
98
 
99
- protected createBreakpoint(breakpoint: SDK.DOMDebuggerModel.CategorizedBreakpoint): void {
99
+ protected createBreakpoint(breakpoint: SDK.CategorizedBreakpoint.CategorizedBreakpoint): void {
100
100
  const labelNode = UI.UIUtils.CheckboxLabel.create(breakpoint.title());
101
101
  labelNode.classList.add('source-code');
102
102
  labelNode.checkboxElement.addEventListener('click', this.breakpointCheckboxClicked.bind(this, breakpoint), true);
@@ -124,7 +124,7 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
124
124
  }
125
125
 
126
126
  protected getBreakpointFromPausedDetails(_details: SDK.DebuggerModel.DebuggerPausedDetails):
127
- SDK.DOMDebuggerModel.CategorizedBreakpoint|null {
127
+ SDK.CategorizedBreakpoint.CategorizedBreakpoint|null {
128
128
  return null;
129
129
  }
130
130
 
@@ -180,11 +180,11 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
180
180
  }
181
181
  }
182
182
 
183
- protected toggleBreakpoint(breakpoint: SDK.DOMDebuggerModel.CategorizedBreakpoint, enabled: boolean): void {
183
+ protected toggleBreakpoint(breakpoint: SDK.CategorizedBreakpoint.CategorizedBreakpoint, enabled: boolean): void {
184
184
  breakpoint.setEnabled(enabled);
185
185
  }
186
186
 
187
- private breakpointCheckboxClicked(breakpoint: SDK.DOMDebuggerModel.CategorizedBreakpoint): void {
187
+ private breakpointCheckboxClicked(breakpoint: SDK.CategorizedBreakpoint.CategorizedBreakpoint): void {
188
188
  const item = this.#breakpoints.get(breakpoint);
189
189
  if (!item) {
190
190
  return;
@@ -11,10 +11,13 @@ let eventListenerBreakpointsSidebarPaneInstance: EventListenerBreakpointsSidebar
11
11
 
12
12
  export class EventListenerBreakpointsSidebarPane extends CategorizedBreakpointsSidebarPane {
13
13
  private constructor() {
14
- const categories = SDK.DOMDebuggerModel.DOMDebuggerManager.instance().eventListenerBreakpoints().map(
15
- breakpoint => breakpoint.category());
14
+ let breakpoints: SDK.CategorizedBreakpoint.CategorizedBreakpoint[] =
15
+ SDK.DOMDebuggerModel.DOMDebuggerManager.instance().eventListenerBreakpoints();
16
+ const nonDomBreakpoints = SDK.EventBreakpointsModel.EventBreakpointsManager.instance().eventListenerBreakpoints();
17
+ breakpoints = breakpoints.concat(nonDomBreakpoints);
18
+
19
+ const categories = breakpoints.map(breakpoint => breakpoint.category());
16
20
  categories.sort();
17
- const breakpoints = SDK.DOMDebuggerModel.DOMDebuggerManager.instance().eventListenerBreakpoints();
18
21
  super(
19
22
  categories, breakpoints, 'sources.eventListenerBreakpoints', Protocol.Debugger.PausedEventReason.EventListener);
20
23
  }
@@ -27,10 +30,15 @@ export class EventListenerBreakpointsSidebarPane extends CategorizedBreakpointsS
27
30
  }
28
31
 
29
32
  getBreakpointFromPausedDetails(details: SDK.DebuggerModel.DebuggerPausedDetails):
30
- SDK.DOMDebuggerModel.CategorizedBreakpoint|null {
31
- return SDK.DOMDebuggerModel.DOMDebuggerManager.instance().resolveEventListenerBreakpoint(details.auxData as {
33
+ SDK.CategorizedBreakpoint.CategorizedBreakpoint|null {
34
+ const auxData = details.auxData as {
32
35
  eventName: string,
33
36
  targetName: string,
34
- });
37
+ };
38
+ const domBreakpoint = SDK.DOMDebuggerModel.DOMDebuggerManager.instance().resolveEventListenerBreakpoint(auxData);
39
+ if (domBreakpoint) {
40
+ return domBreakpoint;
41
+ }
42
+ return SDK.EventBreakpointsModel.EventBreakpointsManager.instance().resolveEventListenerBreakpoint(auxData);
35
43
  }
36
44
  }
@@ -491,6 +491,8 @@ export class RequestPayloadView extends UI.Widget.VBox {
491
491
  private createToggleButton(title: string): Element {
492
492
  const button = document.createElement('span');
493
493
  button.classList.add('payload-toggle');
494
+ button.tabIndex = 0;
495
+ button.setAttribute('role', 'button');
494
496
  button.textContent = title;
495
497
  return button;
496
498
  }
@@ -64,6 +64,11 @@
64
64
  color: var(--color-text-primary);
65
65
  }
66
66
 
67
+ .tree-outline li.expanded .payload-toggle:focus-visible {
68
+ border: 2px solid var(--color-button-outline-focus);
69
+ border-radius: 5px;
70
+ }
71
+
67
72
  .tree-outline li .header-toggle:hover {
68
73
  color: var(--color-text-secondary);
69
74
  cursor: pointer;
@@ -142,6 +142,7 @@ export class ProtocolMonitorImpl extends UI.Widget.VBox {
142
142
  clearButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, () => {
143
143
  this.messages = [];
144
144
  this.dataGridIntegrator.update({...this.dataGridIntegrator.data(), rows: []});
145
+ this.infoWidget.render(null);
145
146
  });
146
147
  topToolbar.appendToolbarItem(clearButton);
147
148
 
@@ -191,13 +191,20 @@ export class DebuggerPausedMessage {
191
191
  } else if (details.reason === Protocol.Debugger.PausedEventReason.EventListener) {
192
192
  let eventNameForUI = '';
193
193
  if (details.auxData) {
194
- eventNameForUI =
195
- SDK.DOMDebuggerModel.DOMDebuggerManager.instance().resolveEventListenerBreakpointTitle((details.auxData as {
196
- directiveText: string,
197
- eventName: string,
198
- targetName: string,
199
- webglErrorName: string,
200
- }));
194
+ const maybeNonDomEventNameForUI =
195
+ SDK.EventBreakpointsModel.EventBreakpointsManager.instance().resolveEventListenerBreakpointTitle(
196
+ (details.auxData as {eventName: string}));
197
+ if (maybeNonDomEventNameForUI) {
198
+ eventNameForUI = maybeNonDomEventNameForUI;
199
+ } else {
200
+ eventNameForUI = SDK.DOMDebuggerModel.DOMDebuggerManager.instance().resolveEventListenerBreakpointTitle(
201
+ (details.auxData as {
202
+ directiveText: string,
203
+ eventName: string,
204
+ targetName: string,
205
+ webglErrorName: string,
206
+ }));
207
+ }
201
208
  }
202
209
  messageWrapper = buildWrapper(i18nString(UIStrings.pausedOnEventListener), eventNameForUI);
203
210
  } else if (details.reason === Protocol.Debugger.PausedEventReason.XHR) {
package/package.json CHANGED
@@ -55,5 +55,5 @@
55
55
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
56
56
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
57
57
  },
58
- "version": "1.0.939277"
58
+ "version": "1.0.939473"
59
59
  }
@@ -44,7 +44,7 @@ module.exports = {
44
44
 
45
45
  function findComponentTagNameFromStaticProperty(classBodyNode) {
46
46
  return classBodyNode.body.find(node => {
47
- return node.type === 'ClassProperty' && node.key.name === 'litTagName';
47
+ return node.type === 'PropertyDefinition' && node.key.name === 'litTagName';
48
48
  });
49
49
  }
50
50
 
@@ -73,7 +73,7 @@ module.exports = {
73
73
 
74
74
  // If the reference is right, let's find the value of the static eventName property and make sure it is valid.
75
75
  const eventNameProperty = node.body.body.find(classBodyPart => {
76
- return classBodyPart.type === 'ClassProperty' && classBodyPart.key.name === 'eventName';
76
+ return classBodyPart.type === 'PropertyDefinition' && classBodyPart.key.name === 'eventName';
77
77
  });
78
78
 
79
79
  // This should always exist because we checked for its existence
@@ -7,7 +7,7 @@
7
7
  // One of these AST nodes must be an ancestor of an i18nString call.
8
8
  const REQUIRED_ANCESTOR = new Set([
9
9
  'ArrowFunctionExpression',
10
- 'ClassProperty',
10
+ 'PropertyDefinition',
11
11
  'FunctionDeclaration',
12
12
  'FunctionExpression',
13
13
  'MethodDefinition',
@@ -49,7 +49,7 @@ module.exports = {
49
49
  },
50
50
  create: function(context) {
51
51
  return {
52
- ClassProperty(node) {
52
+ PropertyDefinition(node) {
53
53
  checkNodeForUnderscoredProperties(context, node, 'property');
54
54
  },
55
55
  MethodDefinition(node) {
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy"
4
- ]
5
- }