chrome-devtools-frontend 1.0.1660788 → 1.0.1661063
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/evaluate-ai-css-completion/SKILL.md +133 -0
- package/.agents/skills/evaluate-ai-css-completion/scripts/evaluate.js +76 -0
- package/eslint.config.mjs +7 -0
- package/extension-api/ExtensionAPI.d.ts +88 -0
- package/front_end/core/host/InspectorFrontendHost.ts +1 -0
- package/front_end/core/host/InspectorFrontendHostStub.ts +2 -0
- package/front_end/core/platform/StringUtilities.ts +20 -4
- package/front_end/core/sdk/CPUThrottlingManager.ts +2 -0
- package/front_end/core/sdk/DOMDebuggerModel.ts +2 -0
- package/front_end/core/sdk/DOMModel.ts +1 -0
- package/front_end/core/sdk/DebuggerModel.ts +4 -4
- package/front_end/core/sdk/EventBreakpointsModel.ts +2 -0
- package/front_end/core/sdk/FrameManager.ts +1 -0
- package/front_end/core/sdk/IsolateManager.ts +1 -0
- package/front_end/core/sdk/NetworkManager.ts +2 -0
- package/front_end/core/sdk/NetworkRequest.ts +1 -0
- package/front_end/core/sdk/PageResourceLoader.ts +2 -0
- package/front_end/core/sdk/SourceMap.ts +5 -5
- package/front_end/core/sdk/SourceMapManager.ts +3 -2
- package/front_end/core/sdk/TargetManager.ts +4 -0
- package/front_end/entrypoints/main/MainImpl.ts +2 -1
- package/front_end/models/bindings/CompilerScriptMapping.ts +5 -6
- package/front_end/models/bindings/ContentProviderBasedProject.ts +4 -4
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +3 -4
- package/front_end/models/bindings/DefaultScriptMapping.ts +3 -3
- package/front_end/models/bindings/NetworkProject.ts +1 -10
- package/front_end/models/bindings/ResourceMapping.ts +3 -4
- package/front_end/models/bindings/ResourceScriptMapping.ts +2 -3
- package/front_end/models/bindings/SASSSourceMapping.ts +3 -4
- package/front_end/models/bindings/StylesSourceMapping.ts +3 -3
- package/front_end/models/bindings/TempFile.ts +8 -3
- package/front_end/models/extensions/ExtensionAPI.ts +110 -46
- package/front_end/models/formatter/ScriptFormatter.ts +8 -11
- package/front_end/models/issues_manager/CookieIssue.ts +21 -9
- package/front_end/models/issues_manager/Issue.ts +3 -4
- package/front_end/models/issues_manager/IssueAggregator.ts +0 -9
- package/front_end/models/issues_manager/IssueResolver.ts +2 -2
- package/front_end/models/issues_manager/IssuesManager.ts +136 -137
- package/front_end/models/issues_manager/issues_manager.ts +0 -2
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +5 -0
- package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +13 -10
- package/front_end/models/workspace/WorkspaceImpl.ts +10 -1
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +10 -4
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +2 -1
- package/front_end/panels/application/FrameDetailsView.ts +1 -1
- package/front_end/panels/application/WebMCPView.ts +38 -43
- package/front_end/panels/application/components/AdsView.ts +201 -30
- package/front_end/panels/application/components/adsView.css +25 -0
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -2
- package/front_end/panels/console/ConsoleView.ts +2 -1
- package/front_end/panels/console/PromptBuilder.ts +2 -1
- package/front_end/panels/emulation/DeviceModeView.ts +52 -70
- package/front_end/panels/issues/IssueView.ts +0 -2
- package/front_end/panels/issues/IssuesPane.ts +1 -8
- package/front_end/panels/js_timeline/js_timeline-meta.ts +3 -2
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +3 -3
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +5 -5
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +4 -4
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +2 -2
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +6 -6
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +3 -3
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +8 -9
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplayUtils.ts +2 -2
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +1 -1
- package/front_end/panels/linear_memory_inspector/linear_memory_inspector-meta.ts +2 -2
- package/front_end/panels/network/RequestPayloadView.ts +15 -13
- package/front_end/panels/network/RequestTimingView.ts +95 -127
- package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
- package/front_end/panels/profiler/WritableProfileHeader.ts +2 -2
- package/front_end/panels/recorder/{components/ControlButton.ts → ControlButton.ts} +9 -10
- package/front_end/panels/recorder/{components/CreateRecordingView.ts → CreateRecordingView.ts} +48 -47
- package/front_end/panels/recorder/{components/ExtensionView.ts → ExtensionView.ts} +8 -8
- package/front_end/panels/recorder/RecorderController.ts +88 -77
- package/front_end/panels/recorder/{components/RecordingListView.ts → RecordingListView.ts} +19 -20
- package/front_end/panels/recorder/{components/RecordingView.ts → RecordingView.ts} +88 -88
- package/front_end/panels/recorder/{components/ReplaySection.ts → ReplaySection.ts} +11 -11
- package/front_end/panels/recorder/{components/SelectorPicker.ts → SelectorPicker.ts} +13 -13
- package/front_end/panels/recorder/{components/StepEditor.ts → StepEditor.ts} +15 -15
- package/front_end/panels/recorder/{components/StepView.ts → StepView.ts} +10 -10
- package/front_end/panels/recorder/{components/TimelineSection.ts → TimelineSection.ts} +2 -2
- package/front_end/panels/recorder/recorder.ts +23 -1
- package/front_end/panels/recorder/util/util.ts +113 -0
- package/front_end/panels/sources/InplaceFormatterEditorAction.ts +2 -2
- package/front_end/panels/sources/SourcesNavigator.ts +2 -3
- package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
- package/front_end/panels/timeline/IsolateSelector.ts +10 -8
- package/front_end/panels/timeline/TimelinePanel.ts +18 -7
- package/front_end/panels/timeline/TimelineUIUtils.ts +144 -129
- package/front_end/panels/timeline/timeline-meta.ts +3 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/legacy/Treeoutline.ts +3 -0
- package/front_end/ui/legacy/Widget.ts +14 -15
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +11 -7
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -1
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +10 -1
- package/package.json +1 -1
- package/front_end/models/issues_manager/AttributionReportingIssue.ts +0 -247
- package/front_end/models/issues_manager/descriptions/arInsecureContext.md +0 -7
- package/front_end/models/issues_manager/descriptions/arInvalidInfoHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsSourceHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsTriggerHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arInvalidRegisterSourceHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arInvalidRegisterTriggerHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNavigationRegistrationUniqueScopeAlreadySet.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNavigationRegistrationWithoutTransientUserActivation.md +0 -6
- package/front_end/models/issues_manager/descriptions/arNoRegisterOsSourceHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNoRegisterOsTriggerHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNoRegisterSourceHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNoRegisterTriggerHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNoWebOrOsSupport.md +0 -4
- package/front_end/models/issues_manager/descriptions/arOsSourceIgnored.md +0 -18
- package/front_end/models/issues_manager/descriptions/arOsTriggerIgnored.md +0 -19
- package/front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md +0 -8
- package/front_end/models/issues_manager/descriptions/arSourceAndTriggerHeaders.md +0 -9
- package/front_end/models/issues_manager/descriptions/arSourceIgnored.md +0 -13
- package/front_end/models/issues_manager/descriptions/arTriggerIgnored.md +0 -12
- package/front_end/models/issues_manager/descriptions/arUntrustworthyReportingOrigin.md +0 -10
- package/front_end/models/issues_manager/descriptions/arWebAndOsHeaders.md +0 -11
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +0 -182
- package/front_end/panels/recorder/components/components.ts +0 -25
- package/front_end/panels/recorder/components/util.ts +0 -116
- /package/front_end/panels/recorder/{components/controlButton.css → controlButton.css} +0 -0
- /package/front_end/panels/recorder/{components/createRecordingView.css → createRecordingView.css} +0 -0
- /package/front_end/panels/recorder/{components/extensionView.css → extensionView.css} +0 -0
- /package/front_end/panels/recorder/{components/recordingListView.css → recordingListView.css} +0 -0
- /package/front_end/panels/recorder/{components/recordingView.css → recordingView.css} +0 -0
- /package/front_end/panels/recorder/{components/replaySection.css → replaySection.css} +0 -0
- /package/front_end/panels/recorder/{components/selectorPicker.css → selectorPicker.css} +0 -0
- /package/front_end/panels/recorder/{components/startView.css → startView.css} +0 -0
- /package/front_end/panels/recorder/{components/stepEditor.css → stepEditor.css} +0 -0
- /package/front_end/panels/recorder/{components/stepView.css → stepView.css} +0 -0
- /package/front_end/panels/recorder/{components/timelineSection.css → timelineSection.css} +0 -0
|
@@ -22,14 +22,34 @@ import * as UI from '../../ui/legacy/legacy.js';
|
|
|
22
22
|
import * as Lit from '../../ui/lit/lit.js';
|
|
23
23
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
24
24
|
|
|
25
|
-
import * as Components from './components/components.js';
|
|
26
|
-
import type {AddBreakpointEvent, RemoveBreakpointEvent} from './components/StepView.js';
|
|
27
25
|
import * as Converters from './converters/converters.js';
|
|
26
|
+
import {CreateRecordingView} from './CreateRecordingView.js';
|
|
28
27
|
import * as Extensions from './extensions/extensions.js';
|
|
29
28
|
import * as Models from './models/models.js';
|
|
30
29
|
import * as Actions from './recorder-actions/recorder-actions.js';
|
|
31
30
|
import recorderControllerStyles from './recorderController.css.js';
|
|
32
31
|
import * as Events from './RecorderEvents.js';
|
|
32
|
+
import {
|
|
33
|
+
DeleteRecordingEvent,
|
|
34
|
+
OpenRecordingEvent,
|
|
35
|
+
PlayRecordingEvent as ListViewPlayRecordingEvent,
|
|
36
|
+
RecordingListView
|
|
37
|
+
} from './RecordingListView.js';
|
|
38
|
+
import {
|
|
39
|
+
type PlayRecordingEvent as ViewPlayRecordingEvent,
|
|
40
|
+
RecordingView,
|
|
41
|
+
type ReplayState,
|
|
42
|
+
TargetPanel
|
|
43
|
+
} from './RecordingView.js';
|
|
44
|
+
import type {RequestSelectorAttributeEvent} from './SelectorPicker.js';
|
|
45
|
+
import {
|
|
46
|
+
type AddBreakpointEvent,
|
|
47
|
+
type AddStep,
|
|
48
|
+
AddStepPosition,
|
|
49
|
+
type RemoveBreakpointEvent,
|
|
50
|
+
type RemoveStep,
|
|
51
|
+
type StepChanged
|
|
52
|
+
} from './StepView.js';
|
|
33
53
|
|
|
34
54
|
const {html, Decorators, Directives: {ref}, LitElement} = Lit;
|
|
35
55
|
const {customElement, state} = Decorators;
|
|
@@ -223,7 +243,7 @@ export class RecorderController extends LitElement {
|
|
|
223
243
|
#replayAllowed = true;
|
|
224
244
|
@state() declare private recordingPlayer?: Models.RecordingPlayer.RecordingPlayer;
|
|
225
245
|
@state() declare private lastReplayResult?: Models.RecordingPlayer.ReplayResult;
|
|
226
|
-
readonly #replayState:
|
|
246
|
+
readonly #replayState: ReplayState = {isPlaying: false, isPausedOnBreakpoint: false};
|
|
227
247
|
|
|
228
248
|
@state() declare private currentPage: Pages;
|
|
229
249
|
@state() declare private previousPage?: Pages;
|
|
@@ -255,8 +275,8 @@ export class RecorderController extends LitElement {
|
|
|
255
275
|
#selfXssWarningDisabledSetting = Common.Settings.Settings.instance().createSetting(
|
|
256
276
|
'disable-self-xss-warning', false, Common.Settings.SettingStorageType.SYNCED);
|
|
257
277
|
|
|
258
|
-
#recordingView?:
|
|
259
|
-
#createRecordingView?:
|
|
278
|
+
#recordingView?: RecordingView;
|
|
279
|
+
#createRecordingView?: CreateRecordingView;
|
|
260
280
|
|
|
261
281
|
constructor() {
|
|
262
282
|
super();
|
|
@@ -316,7 +336,7 @@ export class RecorderController extends LitElement {
|
|
|
316
336
|
this.isRecording = isRecording;
|
|
317
337
|
}
|
|
318
338
|
|
|
319
|
-
setRecordingStateForTesting(state:
|
|
339
|
+
setRecordingStateForTesting(state: ReplayState): void {
|
|
320
340
|
this.#replayState.isPlaying = state.isPlaying;
|
|
321
341
|
this.#replayState.isPausedOnBreakpoint = state.isPausedOnBreakpoint;
|
|
322
342
|
}
|
|
@@ -348,9 +368,8 @@ export class RecorderController extends LitElement {
|
|
|
348
368
|
|
|
349
369
|
async #importFile(file: File): Promise<void> {
|
|
350
370
|
const outputStream = new Common.StringOutputStream.StringOutputStream();
|
|
351
|
-
const reader = new Bindings.FileUtils.ChunkedFileReader(
|
|
352
|
-
|
|
353
|
-
/* chunkSize */ 10000000);
|
|
371
|
+
const reader = new Bindings.FileUtils.ChunkedFileReader(file,
|
|
372
|
+
/* chunkSize */ 10000000);
|
|
354
373
|
const success = await reader.read(outputStream);
|
|
355
374
|
if (!success) {
|
|
356
375
|
throw reader.error() ?? new Error('Unknown');
|
|
@@ -426,9 +445,8 @@ export class RecorderController extends LitElement {
|
|
|
426
445
|
}
|
|
427
446
|
if (!settings.networkConditionsSettings && step.type === 'emulateNetworkConditions') {
|
|
428
447
|
settings.networkConditionsSettings = {...step};
|
|
429
|
-
for (const preset
|
|
430
|
-
|
|
431
|
-
SDK.NetworkManager.Slow4GConditions, SDK.NetworkManager.Fast4GConditions]) {
|
|
448
|
+
for (const preset of [SDK.NetworkManager.OfflineConditions, SDK.NetworkManager.Slow3GConditions,
|
|
449
|
+
SDK.NetworkManager.Slow4GConditions, SDK.NetworkManager.Fast4GConditions]) {
|
|
432
450
|
// Using i18nTitleKey as a title here because we only want to compare the parameters of the network conditions.
|
|
433
451
|
if (SDK.NetworkManager.networkConditionsEqual(
|
|
434
452
|
{...preset, title: preset.i18nTitleKey || ''},
|
|
@@ -530,7 +548,7 @@ export class RecorderController extends LitElement {
|
|
|
530
548
|
Host.userMetrics.recordingReplayStarted(Host.UserMetrics.RecordingReplayStarted.REPLAY_VIA_EXTENSION);
|
|
531
549
|
}
|
|
532
550
|
|
|
533
|
-
async #onPlayRecording(event:
|
|
551
|
+
async #onPlayRecording(event: ViewPlayRecordingEvent): Promise<void> {
|
|
534
552
|
if (!this.currentRecording || !this.#replayAllowed) {
|
|
535
553
|
return;
|
|
536
554
|
}
|
|
@@ -548,7 +566,7 @@ export class RecorderController extends LitElement {
|
|
|
548
566
|
return await this.#onPlayViaExtension(event.extension);
|
|
549
567
|
}
|
|
550
568
|
Host.userMetrics.recordingReplayStarted(
|
|
551
|
-
event.targetPanel !==
|
|
569
|
+
event.targetPanel !== TargetPanel.DEFAULT ?
|
|
552
570
|
Host.UserMetrics.RecordingReplayStarted.REPLAY_WITH_PERFORMANCE_TRACING :
|
|
553
571
|
Host.UserMetrics.RecordingReplayStarted.REPLAY_ONLY);
|
|
554
572
|
this.#replayState.isPlaying = true;
|
|
@@ -563,7 +581,7 @@ export class RecorderController extends LitElement {
|
|
|
563
581
|
this.recordingPlayer = new Models.RecordingPlayer.RecordingPlayer(
|
|
564
582
|
this.currentRecording.flow, {speed: event.speed, breakpointIndexes: this.#stepBreakpointIndexes});
|
|
565
583
|
|
|
566
|
-
const withPerformanceTrace = event.targetPanel ===
|
|
584
|
+
const withPerformanceTrace = event.targetPanel === TargetPanel.PERFORMANCE_PANEL;
|
|
567
585
|
const sectionsWithScreenshot = new Set();
|
|
568
586
|
this.recordingPlayer.addEventListener(Models.RecordingPlayer.Events.STEP, async ({data: {step, resolve}}) => {
|
|
569
587
|
this.currentStep = step;
|
|
@@ -633,7 +651,7 @@ export class RecorderController extends LitElement {
|
|
|
633
651
|
|
|
634
652
|
let performanceTracing = null;
|
|
635
653
|
switch (event.targetPanel) {
|
|
636
|
-
case
|
|
654
|
+
case TargetPanel.PERFORMANCE_PANEL:
|
|
637
655
|
performanceTracing = new Tracing.PerformanceTracing.PerformanceTracing(this.#getMainTarget(), {
|
|
638
656
|
tracingBufferUsage(): void{},
|
|
639
657
|
eventsRetrievalProgress(): void{},
|
|
@@ -658,7 +676,7 @@ export class RecorderController extends LitElement {
|
|
|
658
676
|
this.#replayState.isPlaying = false;
|
|
659
677
|
this.recordingPlayer = undefined;
|
|
660
678
|
await UI.InspectorView.InspectorView.instance().showPanel(event.targetPanel as string);
|
|
661
|
-
if (event.targetPanel ===
|
|
679
|
+
if (event.targetPanel === TargetPanel.PERFORMANCE_PANEL) {
|
|
662
680
|
// Note: this is not passing any metadata to the Performance panel.
|
|
663
681
|
const trace = new SDK.TraceObject.TraceObject(events as Trace.Types.Events.Event[]);
|
|
664
682
|
void Common.Revealer.reveal(trace);
|
|
@@ -698,7 +716,7 @@ export class RecorderController extends LitElement {
|
|
|
698
716
|
return this.currentRecording?.flow;
|
|
699
717
|
}
|
|
700
718
|
|
|
701
|
-
async #handleRecordingChanged(event:
|
|
719
|
+
async #handleRecordingChanged(event: StepChanged): Promise<void> {
|
|
702
720
|
if (!this.currentRecording) {
|
|
703
721
|
throw new Error('Current recording expected to be defined.');
|
|
704
722
|
}
|
|
@@ -709,15 +727,14 @@ export class RecorderController extends LitElement {
|
|
|
709
727
|
steps: this.currentRecording.flow.steps.map(step => step === event.currentStep ? event.newStep : step),
|
|
710
728
|
},
|
|
711
729
|
};
|
|
712
|
-
this.#setCurrentRecording(
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
{keepBreakpoints: true, updateSession: true});
|
|
730
|
+
this.#setCurrentRecording(await this.#storage.upsertRecording(
|
|
731
|
+
recording.flow,
|
|
732
|
+
recording.storageName,
|
|
733
|
+
),
|
|
734
|
+
{keepBreakpoints: true, updateSession: true});
|
|
718
735
|
}
|
|
719
736
|
|
|
720
|
-
async #handleStepAdded(event:
|
|
737
|
+
async #handleStepAdded(event: AddStep): Promise<void> {
|
|
721
738
|
if (!this.currentRecording) {
|
|
722
739
|
throw new Error('Current recording expected to be defined.');
|
|
723
740
|
}
|
|
@@ -730,13 +747,13 @@ export class RecorderController extends LitElement {
|
|
|
730
747
|
if (sectionIdx === undefined || sectionIdx === -1) {
|
|
731
748
|
throw new Error('There is no section to add a step to');
|
|
732
749
|
}
|
|
733
|
-
if (event.position ===
|
|
750
|
+
if (event.position === AddStepPosition.AFTER) {
|
|
734
751
|
if (this.sections?.[sectionIdx].steps.length) {
|
|
735
752
|
step = this.sections?.[sectionIdx].steps[0];
|
|
736
|
-
position =
|
|
753
|
+
position = AddStepPosition.BEFORE;
|
|
737
754
|
} else {
|
|
738
755
|
step = this.sections?.[sectionIdx].causingStep;
|
|
739
|
-
position =
|
|
756
|
+
position = AddStepPosition.AFTER;
|
|
740
757
|
}
|
|
741
758
|
} else {
|
|
742
759
|
if (sectionIdx <= 0) {
|
|
@@ -744,7 +761,7 @@ export class RecorderController extends LitElement {
|
|
|
744
761
|
}
|
|
745
762
|
const prevSection = this.sections?.[sectionIdx - 1];
|
|
746
763
|
step = prevSection?.steps[prevSection.steps.length - 1];
|
|
747
|
-
position =
|
|
764
|
+
position = AddStepPosition.AFTER;
|
|
748
765
|
}
|
|
749
766
|
} else {
|
|
750
767
|
// step
|
|
@@ -755,7 +772,7 @@ export class RecorderController extends LitElement {
|
|
|
755
772
|
}
|
|
756
773
|
const steps = this.currentRecording.flow.steps;
|
|
757
774
|
const currentIndex = steps.indexOf(step);
|
|
758
|
-
const indexToInsertAt = currentIndex + (position ===
|
|
775
|
+
const indexToInsertAt = currentIndex + (position === AddStepPosition.BEFORE ? 0 : 1);
|
|
759
776
|
steps.splice(indexToInsertAt, 0, {type: Models.Schema.StepType.WaitForElement, selectors: ['body']});
|
|
760
777
|
const recording = {...this.currentRecording, flow: {...this.currentRecording.flow, steps}};
|
|
761
778
|
this.#stepBreakpointIndexes = new Set([...this.#stepBreakpointIndexes.values()].map(breakpointIndex => {
|
|
@@ -765,12 +782,11 @@ export class RecorderController extends LitElement {
|
|
|
765
782
|
|
|
766
783
|
return breakpointIndex + 1;
|
|
767
784
|
}));
|
|
768
|
-
this.#setCurrentRecording(
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
{keepBreakpoints: true, updateSession: true});
|
|
785
|
+
this.#setCurrentRecording(await this.#storage.upsertRecording(
|
|
786
|
+
recording.flow,
|
|
787
|
+
recording.storageName,
|
|
788
|
+
),
|
|
789
|
+
{keepBreakpoints: true, updateSession: true});
|
|
774
790
|
}
|
|
775
791
|
|
|
776
792
|
async #handleRecordingTitleChanged(title: string): Promise<void> {
|
|
@@ -785,7 +801,7 @@ export class RecorderController extends LitElement {
|
|
|
785
801
|
));
|
|
786
802
|
}
|
|
787
803
|
|
|
788
|
-
async #handleStepRemoved(event:
|
|
804
|
+
async #handleStepRemoved(event: RemoveStep): Promise<void> {
|
|
789
805
|
if (!this.currentRecording) {
|
|
790
806
|
throw new Error('Current recording expected to be defined.');
|
|
791
807
|
}
|
|
@@ -807,12 +823,11 @@ export class RecorderController extends LitElement {
|
|
|
807
823
|
return breakpointIndex - 1;
|
|
808
824
|
})
|
|
809
825
|
.filter(index => index >= 0));
|
|
810
|
-
this.#setCurrentRecording(
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
{keepBreakpoints: true, updateSession: true});
|
|
826
|
+
this.#setCurrentRecording(await this.#storage.upsertRecording(
|
|
827
|
+
flow,
|
|
828
|
+
this.currentRecording.storageName,
|
|
829
|
+
),
|
|
830
|
+
{keepBreakpoints: true, updateSession: true});
|
|
816
831
|
}
|
|
817
832
|
|
|
818
833
|
async #onNetworkConditionsChanged(data?: SDK.NetworkManager.Conditions): Promise<void> {
|
|
@@ -867,7 +882,7 @@ export class RecorderController extends LitElement {
|
|
|
867
882
|
|
|
868
883
|
async #onDeleteRecording(event: Event): Promise<void> {
|
|
869
884
|
event.stopPropagation();
|
|
870
|
-
if (event instanceof
|
|
885
|
+
if (event instanceof DeleteRecordingEvent) {
|
|
871
886
|
await this.#storage.deleteRecording(event.storageName);
|
|
872
887
|
this.#screenshotStorage.deleteScreenshotsForRecording(event.storageName);
|
|
873
888
|
this.requestUpdate();
|
|
@@ -931,25 +946,25 @@ export class RecorderController extends LitElement {
|
|
|
931
946
|
const screenshot = await screenshotPromise;
|
|
932
947
|
screenshotPromise = undefined;
|
|
933
948
|
currentSection.screenshot = screenshot;
|
|
934
|
-
Models.ScreenshotStorage.ScreenshotStorage.instance().storeScreenshotForSection(
|
|
935
|
-
|
|
949
|
+
Models.ScreenshotStorage.ScreenshotStorage.instance().storeScreenshotForSection(currentRecording.storageName,
|
|
950
|
+
currentSectionIndex, screenshot);
|
|
936
951
|
previousSectionIndex = currentSectionIndex;
|
|
937
952
|
this.#updateScreenshotsForSections();
|
|
938
953
|
};
|
|
939
954
|
|
|
940
|
-
this.currentRecordingSession.addEventListener(
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
955
|
+
this.currentRecordingSession.addEventListener(Models.RecordingSession.Events.RECORDING_UPDATED,
|
|
956
|
+
async ({data}: {data: Models.Schema.UserFlow}) => {
|
|
957
|
+
if (!this.currentRecording) {
|
|
958
|
+
throw new Error('No current recording found');
|
|
959
|
+
}
|
|
960
|
+
this.#setCurrentRecording(await this.#storage.upsertRecording(
|
|
961
|
+
data,
|
|
962
|
+
this.currentRecording.storageName,
|
|
963
|
+
));
|
|
964
|
+
this.#recordingView?.scrollToBottom();
|
|
950
965
|
|
|
951
|
-
|
|
952
|
-
|
|
966
|
+
await takeScreenshot(this.currentRecording);
|
|
967
|
+
});
|
|
953
968
|
|
|
954
969
|
this.currentRecordingSession.addEventListener(
|
|
955
970
|
Models.RecordingSession.Events.RECORDING_STOPPED, async ({data}: {data: Models.Schema.UserFlow}) => {
|
|
@@ -1006,8 +1021,7 @@ export class RecorderController extends LitElement {
|
|
|
1006
1021
|
}
|
|
1007
1022
|
|
|
1008
1023
|
async #onRecordingSelected(event: Event): Promise<void> {
|
|
1009
|
-
const storageName = event instanceof
|
|
1010
|
-
event instanceof Components.RecordingListView.PlayRecordingEvent ?
|
|
1024
|
+
const storageName = event instanceof OpenRecordingEvent || event instanceof ListViewPlayRecordingEvent ?
|
|
1011
1025
|
event.storageName :
|
|
1012
1026
|
((event as InputEvent).target as HTMLSelectElement)?.value;
|
|
1013
1027
|
this.#setCurrentRecording(await this.#storage.getRecording(storageName));
|
|
@@ -1071,12 +1085,11 @@ export class RecorderController extends LitElement {
|
|
|
1071
1085
|
}
|
|
1072
1086
|
const flow = this.currentRecordingSession.cloneUserFlow();
|
|
1073
1087
|
flow.steps.push({type: 'waitForElement' as Models.Schema.StepType.WaitForElement, selectors: [['.cls']]});
|
|
1074
|
-
this.#setCurrentRecording(
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
{keepBreakpoints: true, updateSession: true});
|
|
1088
|
+
this.#setCurrentRecording(await this.#storage.upsertRecording(
|
|
1089
|
+
flow,
|
|
1090
|
+
this.currentRecording.storageName,
|
|
1091
|
+
),
|
|
1092
|
+
{keepBreakpoints: true, updateSession: true});
|
|
1080
1093
|
await this.updateComplete;
|
|
1081
1094
|
// FIXME: call a method on the recording view widget.
|
|
1082
1095
|
await this.#recordingView?.updateComplete;
|
|
@@ -1124,10 +1137,9 @@ export class RecorderController extends LitElement {
|
|
|
1124
1137
|
}
|
|
1125
1138
|
}
|
|
1126
1139
|
|
|
1127
|
-
async #onPlayRecordingByName(event:
|
|
1140
|
+
async #onPlayRecordingByName(event: ListViewPlayRecordingEvent): Promise<void> {
|
|
1128
1141
|
await this.#onRecordingSelected(event);
|
|
1129
|
-
await this.#onPlayRecording(
|
|
1130
|
-
{targetPanel: Components.RecordingView.TargetPanel.DEFAULT, speed: this.#recorderSettings.speed});
|
|
1142
|
+
await this.#onPlayRecording({targetPanel: TargetPanel.DEFAULT, speed: this.#recorderSettings.speed});
|
|
1131
1143
|
}
|
|
1132
1144
|
|
|
1133
1145
|
#onAddBreakpoint = (event: AddBreakpointEvent): void => {
|
|
@@ -1178,8 +1190,7 @@ export class RecorderController extends LitElement {
|
|
|
1178
1190
|
return;
|
|
1179
1191
|
|
|
1180
1192
|
case Actions.RecorderActions.REPLAY_RECORDING:
|
|
1181
|
-
void this.#onPlayRecording(
|
|
1182
|
-
{targetPanel: Components.RecordingView.TargetPanel.DEFAULT, speed: this.#recorderSettings.speed});
|
|
1193
|
+
void this.#onPlayRecording({targetPanel: TargetPanel.DEFAULT, speed: this.#recorderSettings.speed});
|
|
1183
1194
|
return;
|
|
1184
1195
|
|
|
1185
1196
|
case Actions.RecorderActions.TOGGLE_CODE_VIEW: {
|
|
@@ -1253,7 +1264,7 @@ export class RecorderController extends LitElement {
|
|
|
1253
1264
|
// clang-format off
|
|
1254
1265
|
return html`
|
|
1255
1266
|
<devtools-widget
|
|
1256
|
-
${widget(
|
|
1267
|
+
${widget(RecordingListView, {
|
|
1257
1268
|
recordings: recordings.map(recording => ({
|
|
1258
1269
|
storageName: recording.storageName,
|
|
1259
1270
|
name: recording.flow.title,
|
|
@@ -1294,7 +1305,7 @@ export class RecorderController extends LitElement {
|
|
|
1294
1305
|
return html`
|
|
1295
1306
|
<devtools-widget
|
|
1296
1307
|
class="recording-view"
|
|
1297
|
-
${widget(
|
|
1308
|
+
${widget(RecordingView, {
|
|
1298
1309
|
recording: this.currentRecording?.flow ?? {title: '', steps: []},
|
|
1299
1310
|
replayState: this.#replayState,
|
|
1300
1311
|
isRecording: this.isRecording,
|
|
@@ -1320,7 +1331,7 @@ export class RecorderController extends LitElement {
|
|
|
1320
1331
|
titleChanged: this.#handleRecordingTitleChanged.bind(this),
|
|
1321
1332
|
})}
|
|
1322
1333
|
@requestselectorattribute=${(
|
|
1323
|
-
event:
|
|
1334
|
+
event: RequestSelectorAttributeEvent,
|
|
1324
1335
|
) => {
|
|
1325
1336
|
event.send(this.currentRecording?.flow.selectorAttribute);
|
|
1326
1337
|
}}
|
|
@@ -1330,7 +1341,7 @@ export class RecorderController extends LitElement {
|
|
|
1330
1341
|
@addbreakpoint=${this.#onAddBreakpoint.bind(this)}
|
|
1331
1342
|
@removebreakpoint=${this.#onRemoveBreakpoint.bind(this)}
|
|
1332
1343
|
@recorderextensionviewclosed=${this.#onExtensionViewClosed.bind(this)}
|
|
1333
|
-
${UI.Widget.widgetRef(
|
|
1344
|
+
${UI.Widget.widgetRef(RecordingView, widget => {this.#recordingView = widget;})}
|
|
1334
1345
|
></devtools-widget>
|
|
1335
1346
|
`;
|
|
1336
1347
|
// clang-format on
|
|
@@ -1341,13 +1352,13 @@ export class RecorderController extends LitElement {
|
|
|
1341
1352
|
return html`
|
|
1342
1353
|
<devtools-widget
|
|
1343
1354
|
class="recording-view"
|
|
1344
|
-
${widget(
|
|
1355
|
+
${widget(CreateRecordingView, {
|
|
1345
1356
|
recorderSettings: this.#recorderSettings,
|
|
1346
1357
|
onRecordingStarted: this.#onRecordingStarted.bind(this),
|
|
1347
1358
|
onRecordingCancelled: this.onRecordingCancelled.bind(this),
|
|
1348
1359
|
})}
|
|
1349
1360
|
${UI.Widget.widgetRef(
|
|
1350
|
-
|
|
1361
|
+
CreateRecordingView,
|
|
1351
1362
|
widget => {
|
|
1352
1363
|
this.#createRecordingView = widget;
|
|
1353
1364
|
},
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import '
|
|
5
|
+
import '../../ui/kit/kit.js';
|
|
6
6
|
|
|
7
|
-
import * as i18n from '
|
|
8
|
-
import * as Buttons from '
|
|
9
|
-
import * as UI from '
|
|
10
|
-
import * as Lit from '
|
|
11
|
-
import * as VisualLogging from '
|
|
12
|
-
import * as Models from '../models/models.js';
|
|
13
|
-
import * as Actions from '../recorder-actions/recorder-actions.js';
|
|
7
|
+
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
|
+
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
9
|
+
import * as UI from '../../ui/legacy/legacy.js';
|
|
10
|
+
import * as Lit from '../../ui/lit/lit.js';
|
|
11
|
+
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
14
12
|
|
|
13
|
+
import * as Models from './models/models.js';
|
|
14
|
+
import * as Actions from './recorder-actions/recorder-actions.js';
|
|
15
15
|
import recordingListViewStyles from './recordingListView.css.js';
|
|
16
16
|
|
|
17
17
|
const {html} = Lit;
|
|
@@ -39,7 +39,7 @@ const UIStrings = {
|
|
|
39
39
|
openRecording: 'Open recording',
|
|
40
40
|
} as const;
|
|
41
41
|
const str_ = i18n.i18n.registerUIStrings(
|
|
42
|
-
'panels/recorder/
|
|
42
|
+
'panels/recorder/RecordingListView.ts',
|
|
43
43
|
UIStrings,
|
|
44
44
|
);
|
|
45
45
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -238,17 +238,16 @@ export class RecordingListView extends UI.Widget.Widget {
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
override performUpdate(): void {
|
|
241
|
-
this.#view(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
{}, this.contentElement);
|
|
241
|
+
this.#view({
|
|
242
|
+
recordings: this.#recordings,
|
|
243
|
+
replayAllowed: this.#replayAllowed,
|
|
244
|
+
onCreateClick: this.#onCreateClick.bind(this),
|
|
245
|
+
onDeleteClick: this.#onDeleteClick.bind(this),
|
|
246
|
+
onOpenClick: this.#onOpenClick.bind(this),
|
|
247
|
+
onPlayRecordingClick: this.#onPlayRecordingClick.bind(this),
|
|
248
|
+
onKeyDown: this.#onKeyDown.bind(this),
|
|
249
|
+
},
|
|
250
|
+
{}, this.contentElement);
|
|
252
251
|
}
|
|
253
252
|
|
|
254
253
|
override wasShown(): void {
|