chrome-devtools-frontend 1.0.969345 → 1.0.970539
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/config/gni/devtools_grd_files.gni +64 -0
- package/front_end/core/common/ParsedURL.ts +25 -2
- package/front_end/core/i18n/locales/en-US.json +18 -3
- package/front_end/core/i18n/locales/en-XL.json +18 -3
- package/front_end/core/sdk/ChildTargetManager.ts +2 -2
- package/front_end/core/sdk/Connections.ts +6 -1
- package/front_end/core/sdk/DebuggerModel.ts +4 -0
- package/front_end/core/sdk/NetworkManager.ts +4 -3
- package/front_end/entrypoints/lighthouse_worker/LighthouseService.ts +84 -13
- package/front_end/models/persistence/Automapping.ts +2 -32
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +9 -7
- package/front_end/models/persistence/IsolatedFileSystem.ts +20 -14
- package/front_end/models/persistence/NetworkPersistenceManager.ts +213 -45
- package/front_end/models/persistence/PlatformFileSystem.ts +3 -2
- package/front_end/models/timeline_model/TimelineFrameModel.ts +21 -7
- package/front_end/models/workspace/UISourceCode.ts +11 -14
- package/front_end/models/workspace/WorkspaceImpl.ts +5 -1
- package/front_end/panels/animation/animationTimeline.css +0 -3
- package/front_end/panels/application/components/ReportsGrid.ts +19 -4
- package/front_end/panels/application/components/trustTokensViewDeleteButton.css +0 -1
- package/front_end/panels/console/consolePinPane.css +0 -17
- package/front_end/panels/css_overview/cssOverviewCompletedView.css +0 -1
- package/front_end/panels/elements/components/adornerSettingsPane.css +0 -1
- package/front_end/panels/elements/components/computedStyleTrace.css +1 -1
- package/front_end/panels/elements/components/elementsBreadcrumbs.css +0 -1
- package/front_end/panels/elements/computedStyleWidgetTree.css +2 -2
- package/front_end/panels/elements/elementsTreeOutline.css +0 -2
- package/front_end/panels/emulation/deviceModeView.css +0 -1
- package/front_end/panels/event_listeners/eventListenersView.css +0 -1
- package/front_end/panels/issues/components/hideIssuesMenu.css +0 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +25 -1
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +37 -5
- package/front_end/panels/lighthouse/LighthouseStartView.ts +1 -0
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +5 -5
- package/front_end/panels/media/playerListView.css +0 -1
- package/front_end/panels/network/networkLogView.css +0 -4
- package/front_end/panels/network/requestPayloadTree.css +0 -2
- package/front_end/panels/network/signedExchangeInfoTree.css +0 -1
- package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +0 -4
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +0 -1
- package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +4 -4
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +1 -1
- package/front_end/panels/sources/TabbedEditorContainer.ts +9 -0
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +0 -1
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +75 -3
- package/front_end/panels/webauthn/webauthnPane.css +0 -12
- package/front_end/services/puppeteer/PuppeteerConnection.ts +107 -0
- package/front_end/services/puppeteer/puppeteer.ts +9 -0
- package/front_end/third_party/codemirror/package/addon/fold/foldgutter.css +1 -5
- package/front_end/ui/components/adorners/adorner.css +0 -4
- package/front_end/ui/components/buttons/button.css +0 -4
- package/front_end/ui/components/data_grid/dataGrid.css +0 -4
- package/front_end/ui/components/icon_button/iconButton.css +0 -1
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +2 -2
- package/front_end/ui/legacy/TabbedPane.ts +1 -1
- package/front_end/ui/legacy/tabbedPane.css +0 -4
- package/front_end/ui/legacy/textButton.css +0 -1
- package/front_end/ui/legacy/toolbar.css +0 -1
- package/package.json +2 -2
- package/scripts/hosted_mode/server.js +5 -0
@@ -0,0 +1,107 @@
|
|
1
|
+
// Copyright (c) 2022 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 * as puppeteer from '../../third_party/puppeteer/puppeteer.js';
|
6
|
+
import type * as Protocol from '../../generated/protocol.js';
|
7
|
+
import type * as SDK from '../../core/sdk/sdk.js';
|
8
|
+
|
9
|
+
export class Transport implements puppeteer.ConnectionTransport {
|
10
|
+
#connection: SDK.Connections.ParallelConnectionInterface;
|
11
|
+
#knownIds = new Set<number>();
|
12
|
+
|
13
|
+
constructor(connection: SDK.Connections.ParallelConnectionInterface) {
|
14
|
+
this.#connection = connection;
|
15
|
+
}
|
16
|
+
|
17
|
+
send(message: string): void {
|
18
|
+
const data = JSON.parse(message);
|
19
|
+
this.#knownIds.add(data.id);
|
20
|
+
this.#connection.sendRawMessage(JSON.stringify(data));
|
21
|
+
}
|
22
|
+
|
23
|
+
close(): void {
|
24
|
+
void this.#connection.disconnect();
|
25
|
+
}
|
26
|
+
|
27
|
+
set onmessage(cb: (message: string) => void) {
|
28
|
+
this.#connection.setOnMessage((message: Object) => {
|
29
|
+
if (!cb) {
|
30
|
+
return;
|
31
|
+
}
|
32
|
+
const data = (message) as {id: number, method: string, params: unknown, sessionId?: string};
|
33
|
+
if (data.id && !this.#knownIds.has(data.id)) {
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
this.#knownIds.delete(data.id);
|
37
|
+
if (!data.sessionId) {
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
return cb(JSON.stringify({
|
41
|
+
...data,
|
42
|
+
// Puppeteer is expecting to use the default session, but we give it a non-default session in #connection.
|
43
|
+
// Replace that sessionId with undefined so Puppeteer treats it as default.
|
44
|
+
sessionId: data.sessionId === this.#connection.getSessionId() ? undefined : data.sessionId,
|
45
|
+
}));
|
46
|
+
});
|
47
|
+
}
|
48
|
+
|
49
|
+
set onclose(cb: () => void) {
|
50
|
+
const prev = this.#connection.getOnDisconnect();
|
51
|
+
this.#connection.setOnDisconnect(reason => {
|
52
|
+
if (prev) {
|
53
|
+
prev(reason);
|
54
|
+
}
|
55
|
+
if (cb) {
|
56
|
+
cb();
|
57
|
+
}
|
58
|
+
});
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
export class PuppeteerConnection extends puppeteer.Connection {
|
63
|
+
// Overriding Puppeteer's API here.
|
64
|
+
// eslint-disable-next-line rulesdir/no_underscored_properties
|
65
|
+
async _onMessage(message: string): Promise<void> {
|
66
|
+
const msgObj = JSON.parse(message) as {id: number, method: string, params: unknown, sessionId?: string};
|
67
|
+
if (msgObj.sessionId && !this._sessions.has(msgObj.sessionId)) {
|
68
|
+
return;
|
69
|
+
}
|
70
|
+
void super._onMessage(message);
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
export async function getPuppeteerConnection(
|
75
|
+
rawConnection: SDK.Connections.ParallelConnectionInterface,
|
76
|
+
mainFrameId: string,
|
77
|
+
mainTargetId: string,
|
78
|
+
): Promise<{page: puppeteer.Page | null, browser: puppeteer.Browser}> {
|
79
|
+
const transport = new Transport(rawConnection);
|
80
|
+
|
81
|
+
// url is an empty string in this case parallel to:
|
82
|
+
// https://github.com/puppeteer/puppeteer/blob/f63a123ecef86693e6457b07437a96f108f3e3c5/src/common/BrowserConnector.ts#L72
|
83
|
+
const connection = new PuppeteerConnection('', transport);
|
84
|
+
|
85
|
+
const targetFilterCallback = (targetInfo: Protocol.Target.TargetInfo): boolean => {
|
86
|
+
if (targetInfo.type !== 'page' && targetInfo.type !== 'iframe') {
|
87
|
+
return false;
|
88
|
+
}
|
89
|
+
// TODO only connect to iframes that are related to the main target. This requires refactoring in Puppeteer: https://github.com/puppeteer/puppeteer/issues/3667.
|
90
|
+
return targetInfo.targetId === mainTargetId || targetInfo.openerId === mainTargetId || targetInfo.type === 'iframe';
|
91
|
+
};
|
92
|
+
|
93
|
+
const browser = await puppeteer.Browser.create(
|
94
|
+
connection,
|
95
|
+
[] /* contextIds */,
|
96
|
+
false /* ignoreHTTPSErrors */,
|
97
|
+
undefined /* defaultViewport */,
|
98
|
+
undefined /* process */,
|
99
|
+
undefined /* closeCallback */,
|
100
|
+
targetFilterCallback,
|
101
|
+
);
|
102
|
+
|
103
|
+
const pages = await browser.pages();
|
104
|
+
const page = pages.find(p => p.mainFrame()._id === mainFrameId) || null;
|
105
|
+
|
106
|
+
return {page, browser};
|
107
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// Copyright (c) 2022 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 * as PuppeteerConnection from './PuppeteerConnection.js';
|
6
|
+
|
7
|
+
export {
|
8
|
+
PuppeteerConnection,
|
9
|
+
};
|
@@ -3,15 +3,11 @@
|
|
3
3
|
text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;
|
4
4
|
font-family: arial;
|
5
5
|
line-height: .3;
|
6
|
-
cursor: pointer;
|
7
6
|
}
|
8
7
|
.CodeMirror-foldgutter {
|
9
8
|
width: .7em;
|
10
9
|
}
|
11
|
-
|
12
|
-
.CodeMirror-foldgutter-folded {
|
13
|
-
cursor: pointer;
|
14
|
-
}
|
10
|
+
|
15
11
|
.CodeMirror-foldgutter-open:after {
|
16
12
|
content: "\25BE";
|
17
13
|
}
|
@@ -37,8 +37,8 @@ export const markdownLinks = new Map<string, string>([
|
|
37
37
|
],
|
38
38
|
['https://developer.chrome.com/docs/extensions/mv3/', 'https://developer.chrome.com/docs/extensions/mv3/'],
|
39
39
|
[
|
40
|
-
'https://developer.chrome.com/blog/immutable-document-domain',
|
41
|
-
'https://developer.chrome.com/blog/immutable-document-domain',
|
40
|
+
'https://developer.chrome.com/blog/immutable-document-domain/',
|
41
|
+
'https://developer.chrome.com/blog/immutable-document-domain/',
|
42
42
|
],
|
43
43
|
]);
|
44
44
|
|
@@ -1144,7 +1144,7 @@ export class TabbedPaneTab {
|
|
1144
1144
|
if (this.tabbedPane.allowTabReorder) {
|
1145
1145
|
installDragHandle(
|
1146
1146
|
tabElement, this.startTabDragging.bind(this), this.tabDragging.bind(this), this.endTabDragging.bind(this),
|
1147
|
-
|
1147
|
+
null, null, 200);
|
1148
1148
|
}
|
1149
1149
|
}
|
1150
1150
|
|
@@ -269,10 +269,6 @@
|
|
269
269
|
align-items: center;
|
270
270
|
}
|
271
271
|
|
272
|
-
.tabbed-pane-shadow.vertical-tab-layout .tabbed-pane-header-tab:not(.selected) {
|
273
|
-
cursor: pointer !important; /* stylelint-disable-line declaration-no-important */
|
274
|
-
}
|
275
|
-
|
276
272
|
/* stylelint-disable no-descending-specificity */
|
277
273
|
.tabbed-pane-shadow.vertical-tab-layout .tabbed-pane-header-tab.selected {
|
278
274
|
--override-vertical-tab-selected-border-color: #666;
|
package/package.json
CHANGED
@@ -23,7 +23,7 @@
|
|
23
23
|
"auto-debug-interactionstest": "autoninja -C out/Default && npm run debug-interactionstest --",
|
24
24
|
"auto-debug-unittest": "DEBUG_TEST=1 npm run auto-unittest --",
|
25
25
|
"auto-e2etest": "autoninja -C out/Default && npm run e2etest --",
|
26
|
-
"auto-interactionstest": "autoninja -C out/Default && npm run interactionstest",
|
26
|
+
"auto-interactionstest": "autoninja -C out/Default && npm run interactionstest --",
|
27
27
|
"auto-unittest": "scripts/test/run_auto_unittests.py --no-text-coverage",
|
28
28
|
"build": "autoninja -C out/Default",
|
29
29
|
"build-release": "autoninja -C out/Release",
|
@@ -54,5 +54,5 @@
|
|
54
54
|
"unittest": "scripts/test/run_unittests.py --no-text-coverage",
|
55
55
|
"watch": "third_party/node/node.py --output scripts/watch_build.js"
|
56
56
|
},
|
57
|
-
"version": "1.0.
|
57
|
+
"version": "1.0.970539"
|
58
58
|
}
|
@@ -172,6 +172,11 @@ async function requestHandler(request, response) {
|
|
172
172
|
headers.set('Content-Type', inferredContentType);
|
173
173
|
}
|
174
174
|
}
|
175
|
+
if (!headers.get('Cache-Control')) {
|
176
|
+
// Lets reduce Disk I/O by allowing clients to cache resources.
|
177
|
+
// This is fine to do given that test invocations run against fresh Chrome profiles.
|
178
|
+
headers.set('Cache-Control', 'max-age=3600');
|
179
|
+
}
|
175
180
|
headers.forEach((value, header) => {
|
176
181
|
response.setHeader(header, value);
|
177
182
|
});
|