chrome-devtools-frontend 1.0.1575174 → 1.0.1575635
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/.stylelintrc.json +1 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +27 -0
- package/front_end/entrypoints/main/MainImpl.ts +13 -7
- package/front_end/entrypoints/node_app/app/NodeConnectionsPanel.ts +3 -2
- package/front_end/generated/InspectorBackendCommands.ts +37 -0
- package/front_end/generated/protocol-mapping.d.ts +257 -0
- package/front_end/generated/protocol-proxy-api.d.ts +256 -0
- package/front_end/generated/protocol.ts +359 -0
- package/front_end/models/ai_assistance/AiConversation.ts +31 -10
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -0
- package/front_end/models/ai_assistance/agents/AiAgent.ts +29 -5
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +73 -0
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +141 -0
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +5 -0
- package/front_end/models/live-metrics/LiveMetrics.ts +31 -51
- package/front_end/models/stack_trace/StackTrace.ts +2 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +72 -6
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +1 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +6 -4
- package/front_end/panels/ai_assistance/components/ChatView.ts +5 -6
- package/front_end/panels/ai_assistance/components/chatView.css +10 -0
- package/front_end/panels/application/StorageView.ts +3 -3
- package/front_end/panels/application/preloading/components/preloadingDisabledInfobar.css +1 -1
- package/front_end/panels/common/aiCodeCompletionSummaryToolbar.css +1 -1
- package/front_end/panels/console/ConsoleContextSelector.ts +4 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +2 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +63 -0
- package/front_end/panels/elements/StylesSidebarPane.ts +17 -2
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +4 -0
- package/front_end/panels/issues/AffectedMetadataAllowedSitesView.ts +3 -3
- package/front_end/panels/layer_viewer/Layers3DView.ts +2 -1
- package/front_end/panels/lighthouse/LighthouseStartView.ts +7 -6
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +3 -2
- package/front_end/panels/network/RequestConditionsDrawer.ts +2 -3
- package/front_end/panels/network/SignedExchangeInfoView.ts +3 -4
- package/front_end/panels/network/components/HeaderSectionRow.css +1 -1
- package/front_end/panels/recorder/components/RecordingView.ts +2 -2
- package/front_end/panels/recorder/components/recordingView.css +5 -0
- package/front_end/panels/security/SecurityPanelSidebar.ts +10 -9
- package/front_end/panels/settings/AISettingsTab.ts +2 -1
- package/front_end/panels/settings/KeybindsSettingsTab.ts +3 -5
- package/front_end/panels/settings/SettingsScreen.ts +2 -3
- package/front_end/panels/sources/CallStackSidebarPane.ts +10 -0
- package/front_end/panels/sources/DebuggerPlugin.ts +18 -12
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +4 -3
- package/front_end/panels/sources/SourcesNavigator.ts +2 -2
- package/front_end/panels/sources/SourcesPanel.ts +6 -3
- package/front_end/panels/sources/TabbedEditorContainer.ts +2 -2
- package/front_end/panels/sources/sources-meta.ts +2 -1
- package/front_end/panels/timeline/TimelinePanel.ts +2 -1
- package/front_end/panels/timeline/TimelineUIUtils.ts +2 -2
- package/front_end/panels/timeline/components/DetailsView.ts +7 -7
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -2
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +4 -4
- package/front_end/panels/whats_new/releaseNoteView.css +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js +30 -25
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +30 -21
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js +31 -26
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/package.json +3 -3
- package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +45 -44
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/buttons/Button.ts +2 -2
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
- package/front_end/ui/components/panel_feedback/panelFeedback.css +1 -1
- package/front_end/ui/kit/link/Link.ts +31 -0
- package/front_end/ui/legacy/LinkContextMenuProvider.ts +3 -5
- package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +2 -2
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +336 -250
- package/front_end/ui/legacy/inspectorCommon.css +0 -1
- package/front_end/ui/legacy/legacy.ts +0 -4
- package/front_end/ui/visual_logging/KnownContextValues.ts +4 -0
- package/front_end/ui/visual_logging/LoggingDriver.ts +10 -6
- package/package.json +1 -1
- package/front_end/ui/legacy/XElement.ts +0 -41
- package/front_end/ui/legacy/XLink.ts +0 -128
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
import type {Protocol} from 'devtools-protocol';
|
|
8
8
|
|
|
9
9
|
import type {TargetFilterCallback} from '../api/Browser.js';
|
|
10
|
-
import {CDPSession
|
|
10
|
+
import type {CDPSession} from '../api/CDPSession.js';
|
|
11
|
+
import {CDPSessionEvent} from '../api/CDPSession.js';
|
|
11
12
|
import {EventEmitter} from '../common/EventEmitter.js';
|
|
12
13
|
import {debugError} from '../common/util.js';
|
|
13
14
|
import {assert} from '../util/assert.js';
|
|
@@ -196,15 +197,36 @@ export class TargetManager
|
|
|
196
197
|
this.#attachedToTargetListenersBySession.delete(session);
|
|
197
198
|
}
|
|
198
199
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
);
|
|
200
|
+
const detachedListener =
|
|
201
|
+
this.#detachedFromTargetListenersBySession.get(session);
|
|
202
|
+
if (detachedListener) {
|
|
203
|
+
session.off('Target.detachedFromTarget', detachedListener);
|
|
204
204
|
this.#detachedFromTargetListenersBySession.delete(session);
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
+
#silentDetach = async (
|
|
209
|
+
session: CdpCDPSession,
|
|
210
|
+
parentSession: Connection | CDPSession,
|
|
211
|
+
): Promise<void> => {
|
|
212
|
+
await session.send('Runtime.runIfWaitingForDebugger').catch(debugError);
|
|
213
|
+
// We don't use `session.detach()` because that dispatches all commands on
|
|
214
|
+
// the connection instead of the parent session.
|
|
215
|
+
await parentSession
|
|
216
|
+
.send('Target.detachFromTarget', {
|
|
217
|
+
sessionId: session.id(),
|
|
218
|
+
})
|
|
219
|
+
.catch(debugError);
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
#getParentTarget = (
|
|
223
|
+
parentSession: Connection | CDPSession,
|
|
224
|
+
): CdpTarget | null => {
|
|
225
|
+
return parentSession instanceof CdpCDPSession
|
|
226
|
+
? parentSession.target()
|
|
227
|
+
: null;
|
|
228
|
+
};
|
|
229
|
+
|
|
208
230
|
#onSessionDetached = (session: CDPSession) => {
|
|
209
231
|
this.#removeAttachmentListeners(session);
|
|
210
232
|
};
|
|
@@ -234,10 +256,7 @@ export class TargetManager
|
|
|
234
256
|
const targetInfo = this.#discoveredTargetsByTargetId.get(event.targetId);
|
|
235
257
|
this.#discoveredTargetsByTargetId.delete(event.targetId);
|
|
236
258
|
this.#finishInitializationIfReady(event.targetId);
|
|
237
|
-
if (
|
|
238
|
-
targetInfo?.type === 'service_worker' &&
|
|
239
|
-
this.#attachedTargetsByTargetId.has(event.targetId)
|
|
240
|
-
) {
|
|
259
|
+
if (targetInfo?.type === 'service_worker') {
|
|
241
260
|
// Special case for service workers: report TargetGone event when
|
|
242
261
|
// the worker is destroyed.
|
|
243
262
|
const target = this.#attachedTargetsByTargetId.get(event.targetId);
|
|
@@ -256,7 +275,6 @@ export class TargetManager
|
|
|
256
275
|
|
|
257
276
|
if (
|
|
258
277
|
this.#ignoredTargets.has(event.targetInfo.targetId) ||
|
|
259
|
-
!this.#attachedTargetsByTargetId.has(event.targetInfo.targetId) ||
|
|
260
278
|
!event.targetInfo.attached
|
|
261
279
|
) {
|
|
262
280
|
return;
|
|
@@ -273,7 +291,7 @@ export class TargetManager
|
|
|
273
291
|
target._initializedDeferred.value() === InitializationStatus.SUCCESS;
|
|
274
292
|
|
|
275
293
|
if (isPageTargetBecomingPrimary(target, event.targetInfo)) {
|
|
276
|
-
const session = target
|
|
294
|
+
const session = target._session();
|
|
277
295
|
assert(
|
|
278
296
|
session,
|
|
279
297
|
'Target that is being activated is missing a CDPSession.',
|
|
@@ -302,17 +320,6 @@ export class TargetManager
|
|
|
302
320
|
throw new Error(`Session ${event.sessionId} was not created.`);
|
|
303
321
|
}
|
|
304
322
|
|
|
305
|
-
const silentDetach = async () => {
|
|
306
|
-
await session.send('Runtime.runIfWaitingForDebugger').catch(debugError);
|
|
307
|
-
// We don't use `session.detach()` because that dispatches all commands on
|
|
308
|
-
// the connection instead of the parent session.
|
|
309
|
-
await parentSession
|
|
310
|
-
.send('Target.detachFromTarget', {
|
|
311
|
-
sessionId: session.id(),
|
|
312
|
-
})
|
|
313
|
-
.catch(debugError);
|
|
314
|
-
};
|
|
315
|
-
|
|
316
323
|
if (!this.#connection.isAutoAttached(targetInfo.targetId)) {
|
|
317
324
|
return;
|
|
318
325
|
}
|
|
@@ -325,7 +332,7 @@ export class TargetManager
|
|
|
325
332
|
// should determine if a target is auto-attached or not with the help of
|
|
326
333
|
// CDP.
|
|
327
334
|
if (targetInfo.type === 'service_worker') {
|
|
328
|
-
await silentDetach();
|
|
335
|
+
await this.#silentDetach(session, parentSession);
|
|
329
336
|
if (this.#attachedTargetsByTargetId.has(targetInfo.targetId)) {
|
|
330
337
|
return;
|
|
331
338
|
}
|
|
@@ -336,27 +343,25 @@ export class TargetManager
|
|
|
336
343
|
return;
|
|
337
344
|
}
|
|
338
345
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
);
|
|
346
|
+
let target = this.#attachedTargetsByTargetId.get(targetInfo.targetId);
|
|
347
|
+
const isExistingTarget = target !== undefined;
|
|
342
348
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
349
|
+
if (!target) {
|
|
350
|
+
target = this.#targetFactory(
|
|
351
|
+
targetInfo,
|
|
352
|
+
session,
|
|
353
|
+
parentSession instanceof CdpCDPSession ? parentSession : undefined,
|
|
354
|
+
);
|
|
355
|
+
}
|
|
350
356
|
|
|
351
|
-
const parentTarget =
|
|
352
|
-
parentSession instanceof CdpCDPSession ? parentSession.target() : null;
|
|
357
|
+
const parentTarget = this.#getParentTarget(parentSession);
|
|
353
358
|
|
|
354
359
|
if (this.#targetFilterCallback && !this.#targetFilterCallback(target)) {
|
|
355
360
|
this.#ignoredTargets.add(targetInfo.targetId);
|
|
356
361
|
if (parentTarget?.type() === 'tab') {
|
|
357
362
|
this.#finishInitializationIfReady(parentTarget._targetId);
|
|
358
363
|
}
|
|
359
|
-
await silentDetach();
|
|
364
|
+
await this.#silentDetach(session, parentSession);
|
|
360
365
|
return;
|
|
361
366
|
}
|
|
362
367
|
|
|
@@ -372,10 +377,7 @@ export class TargetManager
|
|
|
372
377
|
|
|
373
378
|
if (isExistingTarget) {
|
|
374
379
|
session.setTarget(target);
|
|
375
|
-
this.#attachedTargetsBySessionId.set(
|
|
376
|
-
session.id(),
|
|
377
|
-
this.#attachedTargetsByTargetId.get(targetInfo.targetId)!,
|
|
378
|
-
);
|
|
380
|
+
this.#attachedTargetsBySessionId.set(session.id(), target);
|
|
379
381
|
} else {
|
|
380
382
|
target._initialize();
|
|
381
383
|
this.#attachedTargetsByTargetId.set(targetInfo.targetId, target);
|
|
@@ -425,15 +427,14 @@ export class TargetManager
|
|
|
425
427
|
event: Protocol.Target.DetachedFromTargetEvent,
|
|
426
428
|
) => {
|
|
427
429
|
const target = this.#attachedTargetsBySessionId.get(event.sessionId);
|
|
428
|
-
|
|
429
430
|
this.#attachedTargetsBySessionId.delete(event.sessionId);
|
|
430
431
|
|
|
431
432
|
if (!target) {
|
|
432
433
|
return;
|
|
433
434
|
}
|
|
434
435
|
|
|
435
|
-
if (parentSession instanceof
|
|
436
|
-
|
|
436
|
+
if (parentSession instanceof CdpCDPSession) {
|
|
437
|
+
parentSession.target()._removeChildTarget(target);
|
|
437
438
|
}
|
|
438
439
|
this.#attachedTargetsByTargetId.delete(target._targetId);
|
|
439
440
|
this.emit(TargetManagerEvent.TargetGone, target);
|
|
@@ -117,7 +117,7 @@ export class Button extends HTMLElement {
|
|
|
117
117
|
longClickable: false,
|
|
118
118
|
};
|
|
119
119
|
#internals = this.attachInternals();
|
|
120
|
-
#slotRef = Lit.Directives.createRef();
|
|
120
|
+
#slotRef = Lit.Directives.createRef<HTMLSlotElement>();
|
|
121
121
|
|
|
122
122
|
constructor() {
|
|
123
123
|
super();
|
|
@@ -326,7 +326,7 @@ export class Button extends HTMLElement {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
#render(): void {
|
|
329
|
-
const nodes =
|
|
329
|
+
const nodes = this.#slotRef.value?.assignedNodes();
|
|
330
330
|
const isEmpty = !Boolean(nodes?.length);
|
|
331
331
|
if (!this.#props.variant) {
|
|
332
332
|
throw new Error('Button requires a variant to be defined');
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
/* eslint-disable @devtools/no-lit-render-outside-of-view, @devtools/enforce-custom-element-definitions-location */
|
|
5
5
|
|
|
6
|
-
import '../../../ui/legacy/legacy.js';
|
|
7
6
|
import '../../../ui/kit/kit.js';
|
|
7
|
+
import '../../legacy/legacy.js';
|
|
8
8
|
|
|
9
9
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
10
10
|
import * as Root from '../../../core/root/root.js';
|
|
@@ -133,6 +133,37 @@ export class Link extends HTMLElement {
|
|
|
133
133
|
);
|
|
134
134
|
// clang-format on
|
|
135
135
|
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Should be used only by old code relying on imperative API,
|
|
139
|
+
* which we are activly migrating away from.
|
|
140
|
+
* @deprecated
|
|
141
|
+
*/
|
|
142
|
+
static create(
|
|
143
|
+
url: string,
|
|
144
|
+
linkText?: string,
|
|
145
|
+
className?: string,
|
|
146
|
+
jsLogContext?: string,
|
|
147
|
+
tabindex = 0,
|
|
148
|
+
): Link {
|
|
149
|
+
const link = new Link();
|
|
150
|
+
link.href = url as Platform.DevToolsPath.UrlString;
|
|
151
|
+
linkText = linkText ?? url;
|
|
152
|
+
link.textContent = Platform.StringUtilities.trimMiddle(linkText, 150);
|
|
153
|
+
|
|
154
|
+
const classes = className ? `${className} devtools-link` : 'devtools-link';
|
|
155
|
+
link.setAttribute('class', classes);
|
|
156
|
+
|
|
157
|
+
if (jsLogContext) {
|
|
158
|
+
link.setAttribute('jslogcontext', jsLogContext);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (tabindex !== 0) {
|
|
162
|
+
link.setAttribute('tabindex', String(tabindex));
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return link;
|
|
166
|
+
}
|
|
136
167
|
}
|
|
137
168
|
|
|
138
169
|
customElements.define('devtools-link', Link);
|
|
@@ -11,23 +11,21 @@ import {
|
|
|
11
11
|
copyLinkAddressLabel,
|
|
12
12
|
openLinkExternallyLabel,
|
|
13
13
|
} from './UIUtils.js';
|
|
14
|
-
import {XLink} from './XLink.js';
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* We can move this next to the Link after
|
|
18
|
-
* the
|
|
19
|
-
* is decoupled from the legacy bundle
|
|
17
|
+
* the context menu is decoupled from the legacy bundle
|
|
20
18
|
*/
|
|
21
19
|
export class LinkContextMenuProvider implements Provider<Node> {
|
|
22
20
|
appendApplicableItems(_event: Event, contextMenu: ContextMenu, target: Node): void {
|
|
23
21
|
let targetNode: Node|null = target;
|
|
24
|
-
while (targetNode && !(targetNode instanceof
|
|
22
|
+
while (targetNode && !(targetNode instanceof Link)) {
|
|
25
23
|
targetNode = targetNode.parentNodeOrShadowHost();
|
|
26
24
|
}
|
|
27
25
|
if (!targetNode?.href) {
|
|
28
26
|
return;
|
|
29
27
|
}
|
|
30
|
-
const node:
|
|
28
|
+
const node: Link = targetNode;
|
|
31
29
|
contextMenu.revealSection().appendItem(openLinkExternallyLabel(), () => {
|
|
32
30
|
if (node.href) {
|
|
33
31
|
UIHelpers.openInNewTab(node.href);
|
|
@@ -8,6 +8,7 @@ import * as i18n from '../../../../core/i18n/i18n.js';
|
|
|
8
8
|
import * as Platform from '../../../../core/platform/platform.js';
|
|
9
9
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
10
10
|
import * as Geometry from '../../../../models/geometry/geometry.js';
|
|
11
|
+
import {Link} from '../../../kit/kit.js';
|
|
11
12
|
import {render} from '../../../lit/lit.js';
|
|
12
13
|
import * as UI from '../../legacy.js';
|
|
13
14
|
import * as Components from '../utils/utils.js';
|
|
@@ -109,8 +110,7 @@ export class ObjectPopoverHelper {
|
|
|
109
110
|
descriptionDiv.dataset.stableNameForTest = 'object-popover-content';
|
|
110
111
|
popover.registerRequiredCSS(objectPopoverStyles);
|
|
111
112
|
descriptionDiv.textContent = description;
|
|
112
|
-
const learnMoreLink =
|
|
113
|
-
UI.XLink.XLink.create(link, i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more');
|
|
113
|
+
const learnMoreLink = Link.create(link, i18nString(UIStrings.learnMore), undefined, 'learn-more');
|
|
114
114
|
const footerDiv = document.createElement('div');
|
|
115
115
|
footerDiv.classList.add('object-popover-footer');
|
|
116
116
|
footerDiv.appendChild(learnMoreLink);
|