chrome-devtools-frontend 1.0.998281 → 1.0.999791

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 (76) hide show
  1. package/.clang-format +1 -0
  2. package/front_end/core/common/Color.ts +9 -1
  3. package/front_end/core/common/Object.ts +2 -1
  4. package/front_end/core/common/Settings.ts +13 -1
  5. package/front_end/core/dom_extension/DOMExtension.ts +0 -10
  6. package/front_end/core/host/InspectorFrontendHost.ts +4 -1
  7. package/front_end/core/host/UserMetrics.ts +2 -1
  8. package/front_end/core/i18n/locales/en-US.json +4 -10
  9. package/front_end/core/i18n/locales/en-XL.json +4 -10
  10. package/front_end/core/sdk/CSSProperty.ts +6 -7
  11. package/front_end/core/sdk/ChildTargetManager.ts +0 -3
  12. package/front_end/core/sdk/ConsoleModel.ts +2 -1
  13. package/front_end/core/sdk/DebuggerModel.ts +4 -30
  14. package/front_end/core/sdk/NetworkManager.ts +3 -1
  15. package/front_end/core/sdk/RuntimeModel.ts +7 -1
  16. package/front_end/core/sdk/SourceMapManager.ts +10 -1
  17. package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +5 -1
  18. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +31 -0
  19. package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +15 -0
  20. package/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts +6 -0
  21. package/front_end/generated/InspectorBackendCommands.js +0 -1
  22. package/front_end/generated/protocol.ts +0 -1
  23. package/front_end/legacy/legacy-defs.d.ts +2 -2
  24. package/front_end/models/formatter/ScriptFormatter.ts +3 -1
  25. package/front_end/models/issues_manager/DeprecationIssue.ts +202 -201
  26. package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +5 -1
  27. package/front_end/models/text_utils/CodeMirrorUtils.ts +14 -17
  28. package/front_end/models/timeline_model/TimelineModel.ts +1 -1
  29. package/front_end/panels/application/IndexedDBViews.ts +5 -2
  30. package/front_end/panels/console/ConsoleView.ts +9 -1
  31. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +3 -1
  32. package/front_end/panels/elements/PropertiesWidget.ts +0 -1
  33. package/front_end/panels/elements/StylesSidebarPane.ts +7 -1
  34. package/front_end/panels/lighthouse/LighthouseController.ts +19 -12
  35. package/front_end/panels/lighthouse/LighthousePanel.ts +3 -2
  36. package/front_end/panels/lighthouse/LighthouseStartView.ts +10 -4
  37. package/front_end/panels/lighthouse/LighthouseStartViewFR.ts +50 -48
  38. package/front_end/panels/lighthouse/LighthouseTimespanView.ts +9 -2
  39. package/front_end/panels/lighthouse/lighthouseDialog.css +5 -0
  40. package/front_end/panels/lighthouse/lighthouseStartView.css +3 -3
  41. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +3 -1
  42. package/front_end/panels/network/NetworkLogView.ts +5 -1
  43. package/front_end/panels/network/NetworkLogViewColumns.ts +3 -1
  44. package/front_end/panels/network/RequestTimingView.ts +1 -1
  45. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +8 -1
  46. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +3 -1
  47. package/front_end/panels/profiler/HeapSnapshotView.ts +14 -2
  48. package/front_end/panels/sources/SourcesPanel.ts +7 -1
  49. package/front_end/panels/timeline/TimelineController.ts +1 -1
  50. package/front_end/panels/timeline/TimelineEventOverview.ts +0 -60
  51. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +1 -9
  52. package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -1
  53. package/front_end/panels/timeline/TimelineHistoryManager.ts +5 -2
  54. package/front_end/panels/timeline/TimelinePanel.ts +9 -2
  55. package/front_end/panels/timeline/TimelineUIUtils.ts +7 -34
  56. package/front_end/panels/timeline/timeline-legacy.ts +0 -3
  57. package/front_end/panels/timeline/timelinePanel.css +0 -6
  58. package/front_end/panels/web_audio/graph_visualizer/GraphView.ts +3 -1
  59. package/front_end/panels/web_audio/graph_visualizer/NodeRendererUtility.ts +8 -1
  60. package/front_end/panels/web_audio/graph_visualizer/NodeView.ts +13 -1
  61. package/front_end/panels/web_audio/web_audio.ts +8 -1
  62. package/front_end/ui/components/buttons/button.css +16 -3
  63. package/front_end/ui/components/data_grid/DataGrid.ts +9 -1
  64. package/front_end/ui/components/docs/button/basic.ts +10 -0
  65. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +11 -3
  66. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +12 -1
  67. package/front_end/ui/components/tree_outline/TreeOutline.ts +16 -11
  68. package/front_end/ui/legacy/ActionRegistration.ts +1 -0
  69. package/front_end/ui/legacy/Fragment.ts +2 -2
  70. package/front_end/ui/legacy/Toolbar.ts +4 -0
  71. package/front_end/ui/legacy/ViewManager.ts +12 -1
  72. package/front_end/ui/legacy/XLink.ts +6 -1
  73. package/front_end/ui/legacy/components/inline_editor/CSSAngle.ts +8 -1
  74. package/front_end/ui/legacy/components/inline_editor/CSSAngleEditor.ts +7 -1
  75. package/package.json +1 -1
  76. package/scripts/reformat-clang-js-ts.js +60 -0
package/.clang-format CHANGED
@@ -7,3 +7,4 @@ CommentPragmas: .*\@.*
7
7
  AllowShortBlocksOnASingleLine: false
8
8
  AllowShortFunctionsOnASingleLine: None
9
9
  ReflowComments: false
10
+ JavaScriptWrapImports: true
@@ -33,7 +33,15 @@
33
33
 
34
34
  import * as Platform from '../platform/platform.js';
35
35
 
36
- import {blendColors, contrastRatioAPCA, desiredLuminanceAPCA, luminance, luminanceAPCA, rgbaToHsla, rgbaToHwba} from './ColorUtils.js';
36
+ import {
37
+ blendColors,
38
+ contrastRatioAPCA,
39
+ desiredLuminanceAPCA,
40
+ luminance,
41
+ luminanceAPCA,
42
+ rgbaToHsla,
43
+ rgbaToHwba,
44
+ } from './ColorUtils.js';
37
45
 
38
46
  export class Color {
39
47
  #hslaInternal: number[]|undefined;
@@ -28,7 +28,8 @@
28
28
  */
29
29
 
30
30
  import type * as Platform from '../platform/platform.js';
31
- import type {EventDescriptor, EventListener, EventTarget, EventTargetEvent, EventPayloadToRestParameters} from './EventTarget.js';
31
+ import type {
32
+ EventDescriptor, EventListener, EventTarget, EventTargetEvent, EventPayloadToRestParameters} from './EventTarget.js';
32
33
 
33
34
  export interface ListenerCallbackTuple<Events, T extends keyof Events> {
34
35
  thisObject?: Object;
@@ -36,7 +36,19 @@ import {Format} from './Color.js';
36
36
  import {Console} from './Console.js';
37
37
  import type {GenericEvents, EventDescriptor, EventTargetEvent} from './EventTarget.js';
38
38
  import {ObjectWrapper} from './Object.js';
39
- import {getLocalizedSettingsCategory, getRegisteredSettings, maybeRemoveSettingExtension, type RegExpSettingItem, registerSettingExtension, registerSettingsForTest, resetSettings, SettingCategory, type SettingExtensionOption, type SettingRegistration, SettingType} from './SettingRegistration.js';
39
+ import {
40
+ getLocalizedSettingsCategory,
41
+ getRegisteredSettings,
42
+ maybeRemoveSettingExtension,
43
+ type RegExpSettingItem,
44
+ registerSettingExtension,
45
+ registerSettingsForTest,
46
+ resetSettings,
47
+ SettingCategory,
48
+ type SettingExtensionOption,
49
+ type SettingRegistration,
50
+ SettingType,
51
+ } from './SettingRegistration.js';
40
52
 
41
53
  let settingsInstance: Settings|undefined;
42
54
 
@@ -532,16 +532,6 @@ Node.prototype.setTextContentTruncatedIfNeeded = function(text: string|Node, pla
532
532
  return false;
533
533
  };
534
534
 
535
- Document.prototype.deepActiveElement = function(): Element|null {
536
- let activeElement: Element|(Element | null) = this.activeElement;
537
- while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) {
538
- activeElement = activeElement.shadowRoot.activeElement;
539
- }
540
- return activeElement;
541
- };
542
-
543
- DocumentFragment.prototype.deepActiveElement = Document.prototype.deepActiveElement;
544
-
545
535
  Element.prototype.hasFocus = function(): boolean {
546
536
  const root = this.getComponentRoot();
547
537
  return Boolean(root) && this.isSelfOrAncestor(root.activeElement);
@@ -36,7 +36,10 @@ import * as i18n from '../i18n/i18n.js';
36
36
  import * as Platform from '../platform/platform.js';
37
37
  import * as Root from '../root/root.js';
38
38
 
39
- import type {CanShowSurveyResult, ContextMenuDescriptor, EnumeratedHistogram, EventTypes, ExtensionDescriptor, InspectorFrontendHostAPI, LoadNetworkResourceResult, ShowSurveyResult, SyncInformation} from './InspectorFrontendHostAPI.js';
39
+ import type {
40
+ CanShowSurveyResult, ContextMenuDescriptor, EnumeratedHistogram, EventTypes, ExtensionDescriptor,
41
+ InspectorFrontendHostAPI, LoadNetworkResourceResult, ShowSurveyResult,
42
+ SyncInformation} from './InspectorFrontendHostAPI.js';
40
43
  import {EventDescriptors, Events} from './InspectorFrontendHostAPI.js';
41
44
  import {streamWrite as resourceLoaderStreamWrite} from './ResourceLoader.js';
42
45
 
@@ -549,7 +549,8 @@ export enum KeyboardShortcutAction {
549
549
  'layers.left' = 104,
550
550
  'layers.right' = 105,
551
551
  'help.report-translation-issue' = 106,
552
- MaxValue = 107,
552
+ 'rendering.toggle-prefers-color-scheme' = 107,
553
+ MaxValue = 108,
553
554
  }
554
555
  /* eslint-enable @typescript-eslint/naming-convention */
555
556
 
@@ -899,6 +899,9 @@
899
899
  "entrypoints/inspector_main/inspector_main-meta.ts | showRendering": {
900
900
  "message": "Show Rendering"
901
901
  },
902
+ "entrypoints/inspector_main/inspector_main-meta.ts | toggleCssPrefersColorSchemeMedia": {
903
+ "message": "Toggle forces CSS prefers-color-scheme color"
904
+ },
902
905
  "entrypoints/inspector_main/inspector_main-meta.ts | visionDeficiency": {
903
906
  "message": "vision deficiency"
904
907
  },
@@ -7479,7 +7482,7 @@
7479
7482
  "message": "Unknown"
7480
7483
  },
7481
7484
  "panels/network/RequestTimingView.ts | waitingTtfb": {
7482
- "message": "Waiting (TTFB)"
7485
+ "message": "Waiting for server response"
7483
7486
  },
7484
7487
  "panels/network/RequestTimingView.ts | waterfall": {
7485
7488
  "message": "Waterfall"
@@ -10235,9 +10238,6 @@
10235
10238
  "panels/timeline/TimelineEventOverview.ts | cpu": {
10236
10239
  "message": "CPU"
10237
10240
  },
10238
- "panels/timeline/TimelineEventOverview.ts | fps": {
10239
- "message": "FPS"
10240
- },
10241
10241
  "panels/timeline/TimelineEventOverview.ts | heap": {
10242
10242
  "message": "HEAP"
10243
10243
  },
@@ -10304,9 +10304,6 @@
10304
10304
  "panels/timeline/TimelineFlameChartDataProvider.ts | rasterizerThreadS": {
10305
10305
  "message": "Rasterizer Thread {PH1}"
10306
10306
  },
10307
- "panels/timeline/TimelineFlameChartDataProvider.ts | sFfps": {
10308
- "message": "{PH1} ~ {PH2} fps"
10309
- },
10310
10307
  "panels/timeline/TimelineFlameChartDataProvider.ts | sSelfS": {
10311
10308
  "message": "{PH1} (self {PH2})"
10312
10309
  },
@@ -10820,9 +10817,6 @@
10820
10817
  "panels/timeline/TimelineUIUtils.ts | forcedReflow": {
10821
10818
  "message": "Forced reflow"
10822
10819
  },
10823
- "panels/timeline/TimelineUIUtils.ts | fps": {
10824
- "message": "FPS"
10825
- },
10826
10820
  "panels/timeline/TimelineUIUtils.ts | frame": {
10827
10821
  "message": "Frame"
10828
10822
  },
@@ -899,6 +899,9 @@
899
899
  "entrypoints/inspector_main/inspector_main-meta.ts | showRendering": {
900
900
  "message": "Ŝh́ôẃ R̂én̂d́êŕîńĝ"
901
901
  },
902
+ "entrypoints/inspector_main/inspector_main-meta.ts | toggleCssPrefersColorSchemeMedia": {
903
+ "message": "T̂óĝǵl̂é f̂ór̂ćêś ĈŚŜ ṕr̂éf̂ér̂ś-ĉól̂ór̂-śĉh́êḿê ćôĺôŕ"
904
+ },
902
905
  "entrypoints/inspector_main/inspector_main-meta.ts | visionDeficiency": {
903
906
  "message": "v̂íŝíôń d̂éf̂íĉíêńĉý"
904
907
  },
@@ -7479,7 +7482,7 @@
7479
7482
  "message": "Ûńk̂ńôẃn̂"
7480
7483
  },
7481
7484
  "panels/network/RequestTimingView.ts | waitingTtfb": {
7482
- "message": "Ŵáît́îńĝ (T́T̂F́B̂)"
7485
+ "message": "Ŵáît́îńĝ f́ôŕ ŝér̂v́êŕ r̂éŝṕôńŝé"
7483
7486
  },
7484
7487
  "panels/network/RequestTimingView.ts | waterfall": {
7485
7488
  "message": "Ŵát̂ér̂f́âĺl̂"
@@ -10235,9 +10238,6 @@
10235
10238
  "panels/timeline/TimelineEventOverview.ts | cpu": {
10236
10239
  "message": "ĈṔÛ"
10237
10240
  },
10238
- "panels/timeline/TimelineEventOverview.ts | fps": {
10239
- "message": "F̂ṔŜ"
10240
- },
10241
10241
  "panels/timeline/TimelineEventOverview.ts | heap": {
10242
10242
  "message": "ĤÉÂṔ"
10243
10243
  },
@@ -10304,9 +10304,6 @@
10304
10304
  "panels/timeline/TimelineFlameChartDataProvider.ts | rasterizerThreadS": {
10305
10305
  "message": "R̂áŝt́êŕîźêŕ T̂h́r̂éâd́ {PH1}"
10306
10306
  },
10307
- "panels/timeline/TimelineFlameChartDataProvider.ts | sFfps": {
10308
- "message": "{PH1} ~ {PH2} f̂ṕŝ"
10309
- },
10310
10307
  "panels/timeline/TimelineFlameChartDataProvider.ts | sSelfS": {
10311
10308
  "message": "{PH1} (ŝél̂f́ {PH2})"
10312
10309
  },
@@ -10820,9 +10817,6 @@
10820
10817
  "panels/timeline/TimelineUIUtils.ts | forcedReflow": {
10821
10818
  "message": "F̂ór̂ćêd́ r̂éf̂ĺôẃ"
10822
10819
  },
10823
- "panels/timeline/TimelineUIUtils.ts | fps": {
10824
- "message": "F̂ṔŜ"
10825
- },
10826
10820
  "panels/timeline/TimelineUIUtils.ts | frame": {
10827
10821
  "message": "F̂ŕâḿê"
10828
10822
  },
@@ -163,8 +163,8 @@ export class CSSProperty {
163
163
 
164
164
  const range = this.range.relativeTo(this.ownerStyle.range.startLine, this.ownerStyle.range.startColumn);
165
165
  const indentation = this.ownerStyle.cssText ?
166
- this.detectIndentation(this.ownerStyle.cssText) :
167
- Common.Settings.Settings.instance().moduleSetting('textEditorIndent').get();
166
+ this.detectIndentation(this.ownerStyle.cssText) :
167
+ Common.Settings.Settings.instance().moduleSetting('textEditorIndent').get();
168
168
  const endIndentation = this.ownerStyle.cssText ? indentation.substring(0, this.ownerStyle.range.endColumn) : '';
169
169
  const text = new TextUtils.Text.Text(this.ownerStyle.cssText || '');
170
170
  const newStyleText = text.replaceRange(range, Platform.StringUtilities.sprintf(';%s;', propertyText));
@@ -172,8 +172,7 @@ export class CSSProperty {
172
172
  return this.ownerStyle.setText(styleText, majorChange);
173
173
  }
174
174
 
175
- static async formatStyle(
176
- styleText: string, indentation: string, endIndentation: string): Promise<string> {
175
+ static async formatStyle(styleText: string, indentation: string, endIndentation: string): Promise<string> {
177
176
  const doubleIndent = indentation.substring(endIndentation.length) + indentation;
178
177
  if (indentation) {
179
178
  indentation = '\n' + indentation;
@@ -197,7 +196,7 @@ export class CSSProperty {
197
196
  const disabledProperty = tokenType?.includes('comment') && isDisabledProperty(token);
198
197
  const isPropertyStart =
199
198
  (tokenType?.includes('string') || tokenType?.includes('meta') || tokenType?.includes('property') ||
200
- tokenType?.includes('variableName'));
199
+ tokenType?.includes('variableName'));
201
200
  if (disabledProperty) {
202
201
  result = result.trimEnd() + indentation + token;
203
202
  } else if (isPropertyStart) {
@@ -222,8 +221,8 @@ export class CSSProperty {
222
221
  // implementation takes special care to restore a single
223
222
  // whitespace token in this edge case. https://crbug.com/1071296
224
223
  const trimmedPropertyText = propertyText.trim();
225
- result =
226
- result.trimEnd() + indentation + trimmedPropertyText + (trimmedPropertyText.endsWith(':') ? ' ' : '') + token;
224
+ result = result.trimEnd() + indentation + trimmedPropertyText + (trimmedPropertyText.endsWith(':') ? ' ' : '') +
225
+ token;
227
226
  needsSemi = false;
228
227
  insideProperty = false;
229
228
  propertyName = '';
@@ -142,9 +142,6 @@ export class ChildTargetManager extends SDKModel<EventTypes> implements Protocol
142
142
  }
143
143
  const target = this.#targetManager.createTarget(
144
144
  targetInfo.targetId, targetName, type, this.#parentTarget, sessionId, undefined, undefined, targetInfo);
145
- if (type === Type.Worker || type === Type.ServiceWorker || type === Type.SharedWorker) {
146
- target.setInspectedURL(this.#parentTarget.inspectedURL());
147
- }
148
145
  this.#childTargetsBySessionId.set(sessionId, target);
149
146
  this.#childTargetsById.set(target.id(), target);
150
147
 
@@ -44,7 +44,8 @@ import {Events as DebuggerModelEvents} from './DebuggerModel.js';
44
44
  import {LogModel} from './LogModel.js';
45
45
  import {RemoteObject} from './RemoteObject.js';
46
46
  import {Events as ResourceTreeModelEvents, ResourceTreeModel} from './ResourceTreeModel.js';
47
- import type {ConsoleAPICall, ExceptionWithTimestamp, ExecutionContext, QueryObjectRequestedEvent} from './RuntimeModel.js';
47
+ import type {
48
+ ConsoleAPICall, ExceptionWithTimestamp, ExecutionContext, QueryObjectRequestedEvent} from './RuntimeModel.js';
48
49
  import {Events as RuntimeModelEvents, RuntimeModel} from './RuntimeModel.js';
49
50
  import type {Target} from './Target.js';
50
51
  import {TargetManager} from './TargetManager.js';
@@ -245,9 +245,6 @@ export class DebuggerModel extends SDKModel<EventTypes> {
245
245
  if (!Common.Settings.Settings.instance().moduleSetting('breakpointsActive').get()) {
246
246
  this.breakpointsActiveChanged();
247
247
  }
248
- if (_scheduledPauseOnAsyncCall) {
249
- void this.pauseOnAsyncCall(_scheduledPauseOnAsyncCall);
250
- }
251
248
  this.dispatchEventToListeners(Events.DebuggerWasEnabled, this);
252
249
  const [enableResult] = await Promise.all([enablePromise, instrumentationPromise]);
253
250
  this.registerDebugger(enableResult);
@@ -422,10 +419,6 @@ export class DebuggerModel extends SDKModel<EventTypes> {
422
419
  void this.agent.invoke_pause();
423
420
  }
424
421
 
425
- private pauseOnAsyncCall(parentStackTraceId: Protocol.Runtime.StackTraceId): Promise<Object> {
426
- return this.agent.invoke_pauseOnAsyncCall({parentStackTraceId: parentStackTraceId});
427
- }
428
-
429
422
  async setBreakpointByURL(
430
423
  url: Platform.DevToolsPath.UrlString, lineNumber: number, columnNumber?: number,
431
424
  condition?: string): Promise<SetBreakpointResult> {
@@ -659,8 +652,7 @@ export class DebuggerModel extends SDKModel<EventTypes> {
659
652
  async pausedScript(
660
653
  callFrames: Protocol.Debugger.CallFrame[], reason: Protocol.Debugger.PausedEventReason, auxData: Object|undefined,
661
654
  breakpointIds: string[], asyncStackTrace?: Protocol.Runtime.StackTrace,
662
- asyncStackTraceId?: Protocol.Runtime.StackTraceId,
663
- asyncCallStackTraceId?: Protocol.Runtime.StackTraceId): Promise<void> {
655
+ asyncStackTraceId?: Protocol.Runtime.StackTraceId): Promise<void> {
664
656
  if (reason === Protocol.Debugger.PausedEventReason.Instrumentation) {
665
657
  const script = this.scriptForId(callFrames[0].location.scriptId);
666
658
  if (this.#synchronizeBreakpointsCallback && script) {
@@ -670,18 +662,6 @@ export class DebuggerModel extends SDKModel<EventTypes> {
670
662
  return;
671
663
  }
672
664
 
673
- if (asyncCallStackTraceId) {
674
- // Note: this is only to support old backends. Newer ones do not send asyncCallStackTraceId.
675
- _scheduledPauseOnAsyncCall = asyncCallStackTraceId;
676
- const promises = [];
677
- for (const model of _debuggerIdToModel.values()) {
678
- promises.push(model.pauseOnAsyncCall(asyncCallStackTraceId));
679
- }
680
- await Promise.all(promises);
681
- this.resume();
682
- return;
683
- }
684
-
685
665
  const pausedDetails =
686
666
  new DebuggerPausedDetails(this, callFrames, reason, auxData, breakpointIds, asyncStackTrace, asyncStackTraceId);
687
667
 
@@ -706,8 +686,6 @@ export class DebuggerModel extends SDKModel<EventTypes> {
706
686
  } else {
707
687
  Common.EventTarget.fireEvent('DevTools.DebuggerPaused');
708
688
  }
709
-
710
- _scheduledPauseOnAsyncCall = null;
711
689
  }
712
690
 
713
691
  resumedScript(): void {
@@ -989,10 +967,6 @@ export class DebuggerModel extends SDKModel<EventTypes> {
989
967
  // eslint-disable-next-line @typescript-eslint/naming-convention
990
968
  export const _debuggerIdToModel = new Map<string, DebuggerModel>();
991
969
 
992
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
993
- // eslint-disable-next-line @typescript-eslint/naming-convention
994
- export let _scheduledPauseOnAsyncCall: Protocol.Runtime.StackTraceId|null = null;
995
-
996
970
  /**
997
971
  * Keep these in sync with WebCore::V8Debugger
998
972
  */
@@ -1037,13 +1011,13 @@ class DebuggerDispatcher implements ProtocolProxyApi.DebuggerDispatcher {
1037
1011
  this.#debuggerModel = debuggerModel;
1038
1012
  }
1039
1013
 
1040
- paused({callFrames, reason, data, hitBreakpoints, asyncStackTrace, asyncStackTraceId, asyncCallStackTraceId}:
1041
- Protocol.Debugger.PausedEvent): void {
1014
+ paused({callFrames, reason, data, hitBreakpoints, asyncStackTrace, asyncStackTraceId}: Protocol.Debugger.PausedEvent):
1015
+ void {
1042
1016
  if (!this.#debuggerModel.debuggerEnabled()) {
1043
1017
  return;
1044
1018
  }
1045
1019
  void this.#debuggerModel.pausedScript(
1046
- callFrames, reason, data, hitBreakpoints || [], asyncStackTrace, asyncStackTraceId, asyncCallStackTraceId);
1020
+ callFrames, reason, data, hitBreakpoints || [], asyncStackTrace, asyncStackTraceId);
1047
1021
  }
1048
1022
 
1049
1023
  resumed(): void {
@@ -41,7 +41,9 @@ import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
41
41
  import * as Protocol from '../../generated/protocol.js';
42
42
 
43
43
  import {Cookie} from './Cookie.js';
44
- import type {BlockedCookieWithReason, ContentData, ExtraRequestInfo, ExtraResponseInfo, MIME_TYPE, NameValue, WebBundleInfo, WebBundleInnerRequestInfo} from './NetworkRequest.js';
44
+ import type {
45
+ BlockedCookieWithReason, ContentData, ExtraRequestInfo, ExtraResponseInfo, MIME_TYPE, NameValue, WebBundleInfo,
46
+ WebBundleInnerRequestInfo} from './NetworkRequest.js';
45
47
  import {Events as NetworkRequestEvents, NetworkRequest} from './NetworkRequest.js';
46
48
  import type {Target} from './Target.js';
47
49
  import {Capability} from './Target.js';
@@ -41,7 +41,13 @@ import type {FunctionDetails} from './DebuggerModel.js';
41
41
  import {DebuggerModel} from './DebuggerModel.js';
42
42
  import {HeapProfilerModel} from './HeapProfilerModel.js';
43
43
  import type {ScopeRef} from './RemoteObject.js';
44
- import {RemoteFunction, RemoteObject, RemoteObjectImpl, RemoteObjectProperty, ScopeRemoteObject} from './RemoteObject.js';
44
+ import {
45
+ RemoteFunction,
46
+ RemoteObject,
47
+ RemoteObjectImpl,
48
+ RemoteObjectProperty,
49
+ ScopeRemoteObject,
50
+ } from './RemoteObject.js';
45
51
  import type {Target} from './Target.js';
46
52
  import {Capability, Type} from './Target.js';
47
53
  import {SDKModel} from './SDKModel.js';
@@ -8,6 +8,7 @@ import * as Platform from '../platform/platform.js';
8
8
 
9
9
  import type {FrameAssociated} from './FrameAssociated.js';
10
10
  import type {Target} from './Target.js';
11
+ import {Type} from './Target.js';
11
12
  import {Events as TargetManagerEvents, TargetManager} from './TargetManager.js';
12
13
  import type {SourceMap} from './SourceMap.js';
13
14
  import {TextSourceMap} from './SourceMap.js';
@@ -66,6 +67,14 @@ export class SourceMapManager<T extends FrameAssociated> extends Common.ObjectWr
66
67
  }
67
68
  }
68
69
 
70
+ private getBaseUrl(): Platform.DevToolsPath.UrlString {
71
+ let target: Target|null = this.#target;
72
+ while (target && target.type() !== Type.Frame) {
73
+ target = target.parentTarget();
74
+ }
75
+ return target?.inspectedURL() ?? Platform.DevToolsPath.EmptyUrlString;
76
+ }
77
+
69
78
  private inspectedURLChanged(event: Common.EventTarget.EventTargetEvent<Target>): void {
70
79
  if (event.data !== this.#target) {
71
80
  return;
@@ -156,7 +165,7 @@ export class SourceMapManager<T extends FrameAssociated> extends Common.ObjectWr
156
165
  }|null {
157
166
  // |#sourceURL| can be a random string, but is generally an absolute path.
158
167
  // Complete it to inspected page url for relative links.
159
- const resolvedSourceURL = Common.ParsedURL.ParsedURL.completeURL(this.#target.inspectedURL(), sourceURL);
168
+ const resolvedSourceURL = Common.ParsedURL.ParsedURL.completeURL(this.getBaseUrl(), sourceURL);
160
169
  if (!resolvedSourceURL) {
161
170
  return null;
162
171
  }
@@ -31,7 +31,11 @@
31
31
  import * as Platform from '../../core/platform/platform.js';
32
32
  import * as Root from '../../core/root/root.js';
33
33
  import * as Acorn from '../../third_party/acorn/acorn.js';
34
- import type * as CodeMirrorModule from '../../third_party/codemirror/codemirror-legacy.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
34
+
35
+ // This file is required to bring some types into scope, even though it
36
+ // is not used.
37
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
38
+ import type * as CodeMirrorModule from '../../third_party/codemirror/codemirror-legacy.js';
35
39
 
36
40
  import {AcornTokenizer, ECMA_VERSION} from './AcornTokenizer.js';
37
41
  import {CSSFormatter} from './CSSFormatter.js';
@@ -346,3 +346,34 @@ export class RenderingOptionsView extends UI.Widget.VBox {
346
346
  this.registerCSSFiles([renderingOptionsStyles]);
347
347
  }
348
348
  }
349
+
350
+ let reloadActionDelegateInstance: ReloadActionDelegate;
351
+
352
+ export class ReloadActionDelegate implements UI.ActionRegistration.ActionDelegate {
353
+ static instance(opts: {
354
+ forceNew: boolean|null,
355
+ } = {forceNew: null}): ReloadActionDelegate {
356
+ const {forceNew} = opts;
357
+ if (!reloadActionDelegateInstance || forceNew) {
358
+ reloadActionDelegateInstance = new ReloadActionDelegate();
359
+ }
360
+
361
+ return reloadActionDelegateInstance;
362
+ }
363
+
364
+ handleAction(context: UI.Context.Context, actionId: string): boolean {
365
+ const emulatedCSSMediaFeaturePrefersColorSchemeSetting =
366
+ Common.Settings.Settings.instance().moduleSetting('emulatedCSSMediaFeaturePrefersColorScheme');
367
+
368
+ switch (actionId) {
369
+ case 'rendering.toggle-prefers-color-scheme':
370
+ if (emulatedCSSMediaFeaturePrefersColorSchemeSetting.get() === 'light') {
371
+ emulatedCSSMediaFeaturePrefersColorSchemeSetting.set('dark');
372
+ } else {
373
+ emulatedCSSMediaFeaturePrefersColorSchemeSetting.set('light');
374
+ }
375
+ return true;
376
+ }
377
+ return false;
378
+ }
379
+ }
@@ -99,6 +99,11 @@ const UIStrings = {
99
99
  * setting turns off this overlay.
100
100
  */
101
101
  disablePaused: 'Disable paused state overlay',
102
+ /**
103
+ * @description Title of an action that toggle
104
+ * "forces CSS prefers-color-scheme" color
105
+ */
106
+ toggleCssPrefersColorSchemeMedia: 'Toggle forces CSS prefers-color-scheme color',
102
107
  };
103
108
  const str_ = i18n.i18n.registerUIStrings('entrypoints/inspector_main/inspector_main-meta.ts', UIStrings);
104
109
  const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
@@ -191,6 +196,16 @@ UI.ActionRegistration.registerActionExtension({
191
196
  ],
192
197
  });
193
198
 
199
+ UI.ActionRegistration.registerActionExtension({
200
+ actionId: 'rendering.toggle-prefers-color-scheme',
201
+ category: UI.ActionRegistration.ActionCategory.RENDERING,
202
+ title: i18nLazyString(UIStrings.toggleCssPrefersColorSchemeMedia),
203
+ async loadActionDelegate() {
204
+ const InspectorMain = await loadInspectorMainModule();
205
+ return InspectorMain.RenderingOptions.ReloadActionDelegate.instance();
206
+ },
207
+ });
208
+
194
209
  Common.Settings.registerSettingExtension({
195
210
  category: Common.Settings.SettingCategory.NETWORK,
196
211
  title: i18nLazyString(UIStrings.forceAdBlocking),
@@ -118,6 +118,12 @@ async function invokeLH(action: string, args: any): Promise<unknown> {
118
118
  flags.channel = 'devtools';
119
119
  flags.locale = locale;
120
120
 
121
+ // TODO: Remove this filter once pubads is mode restricted
122
+ // https://github.com/googleads/publisher-ads-lighthouse-plugin/pull/339
123
+ if (action === 'startTimespan' || action === 'snapshot') {
124
+ args.categoryIDs = args.categoryIDs.filter((c: string) => c !== 'lighthouse-plugin-publisher-ads');
125
+ }
126
+
121
127
  // @ts-expect-error https://github.com/GoogleChrome/lighthouse/issues/11628
122
128
  const config = self.createConfig(args.categoryIDs, flags.emulatedFormFactor);
123
129
  const url = args.url;
@@ -273,7 +273,6 @@ export function registerCommands(inspectorBackend) {
273
273
  'Audits.GenericIssueErrorType', {CrossOriginPortalPostMessageError: 'CrossOriginPortalPostMessageError'});
274
274
  inspectorBackend.registerEnum('Audits.DeprecationIssueType', {
275
275
  AuthorizationCoveredByWildcard: 'AuthorizationCoveredByWildcard',
276
- BatteryStatusInsecureOrigin: 'BatteryStatusInsecureOrigin',
277
276
  CanRequestURLHTTPContainingNewline: 'CanRequestURLHTTPContainingNewline',
278
277
  ChromeLoadTimesConnectionInfo: 'ChromeLoadTimesConnectionInfo',
279
278
  ChromeLoadTimesFirstPaintAfterLoadTime: 'ChromeLoadTimesFirstPaintAfterLoadTime',
@@ -1020,7 +1020,6 @@ export namespace Audits {
1020
1020
 
1021
1021
  export const enum DeprecationIssueType {
1022
1022
  AuthorizationCoveredByWildcard = 'AuthorizationCoveredByWildcard',
1023
- BatteryStatusInsecureOrigin = 'BatteryStatusInsecureOrigin',
1024
1023
  CanRequestURLHTTPContainingNewline = 'CanRequestURLHTTPContainingNewline',
1025
1024
  ChromeLoadTimesConnectionInfo = 'ChromeLoadTimesConnectionInfo',
1026
1025
  ChromeLoadTimesFirstPaintAfterLoadTime = 'ChromeLoadTimesFirstPaintAfterLoadTime',
@@ -122,8 +122,8 @@ interface DOMError {
122
122
  }
123
123
 
124
124
  interface ShadowRoot {
125
- elementFromPoint(x: number, y: number): Element | null;
126
- getSelection(): Selection | null;
125
+ elementFromPoint(x: number, y: number): Element|null;
126
+ getSelection(): Selection|null;
127
127
  }
128
128
 
129
129
  interface HTMLDialogElement {
@@ -30,7 +30,9 @@
30
30
 
31
31
  import * as Common from '../../core/common/common.js';
32
32
  import * as Platform from '../../core/platform/platform.js';
33
- import type * as FormatterActions from '../../entrypoints/formatter_worker/FormatterActions.js'; // eslint-disable-line rulesdir/es_modules_import
33
+
34
+ // eslint-disable-next-line rulesdir/es_modules_import
35
+ import type * as FormatterActions from '../../entrypoints/formatter_worker/FormatterActions.js';
34
36
 
35
37
  import {formatterWorkerPool} from './FormatterWorkerPool.js';
36
38