chrome-devtools-frontend 1.0.969882 → 1.0.971140
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 +3 -0
- package/config/gni/devtools_image_files.gni +1 -0
- package/front_end/Images/src/ic_changes.svg +5 -0
- package/front_end/core/common/ParsedURL.ts +27 -4
- package/front_end/core/host/UserMetrics.ts +3 -1
- package/front_end/core/i18n/locales/en-US.json +21 -3
- package/front_end/core/i18n/locales/en-XL.json +21 -3
- package/front_end/core/platform/UserVisibleError.ts +28 -0
- package/front_end/core/platform/platform.ts +2 -0
- package/front_end/core/sdk/ChildTargetManager.ts +0 -1
- package/front_end/core/sdk/DebuggerModel.ts +4 -0
- package/front_end/core/sdk/NetworkManager.ts +15 -1
- package/front_end/core/sdk/NetworkRequest.ts +11 -0
- package/front_end/entrypoints/lighthouse_worker/LighthouseService.ts +15 -6
- package/front_end/entrypoints/main/MainImpl.ts +3 -0
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +21 -0
- package/front_end/models/persistence/Automapping.ts +3 -33
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +11 -9
- package/front_end/models/persistence/IsolatedFileSystem.ts +20 -14
- package/front_end/models/persistence/NetworkPersistenceManager.ts +8 -4
- package/front_end/models/persistence/PlatformFileSystem.ts +3 -2
- 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/trustTokensViewDeleteButton.css +0 -1
- package/front_end/panels/browser_debugger/categorizedBreakpointsSidebarPane.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/ElementsPanel.ts +25 -11
- package/front_end/panels/elements/StylesSidebarPane.ts +198 -23
- 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 -3
- 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 +30 -0
- package/front_end/panels/lighthouse/LighthousePanel.ts +7 -1
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +6 -1
- package/front_end/panels/lighthouse/LighthouseStartView.ts +2 -2
- package/front_end/panels/lighthouse/LighthouseStartViewFR.ts +39 -0
- 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/sensors/sensors.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/NavigatorView.ts +9 -5
- package/front_end/panels/sources/TabbedEditorContainer.ts +9 -0
- package/front_end/panels/sources/sources-legacy.ts +0 -13
- package/front_end/panels/sources/sourcesView.css +0 -4
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +0 -1
- package/front_end/panels/webauthn/webauthnPane.css +0 -12
- 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/legacy/TabbedPane.ts +1 -1
- package/front_end/ui/legacy/closeButton.css +0 -1
- package/front_end/ui/legacy/tabbedPane.css +0 -7
- package/front_end/ui/legacy/textButton.css +0 -1
- package/front_end/ui/legacy/toolbar.css +28 -4
- package/package.json +1 -1
- package/scripts/npm_test.js +1 -1
@@ -77,8 +77,8 @@ export class IsolatedFileSystem extends PlatformFileSystem {
|
|
77
77
|
private readonly excludedFoldersSetting: Common.Settings.Setting<{[path: string]: string[]}>;
|
78
78
|
private excludedFoldersInternal: Set<string>;
|
79
79
|
private readonly excludedEmbedderFolders: string[];
|
80
|
-
private readonly initialFilePathsInternal: Set<
|
81
|
-
private readonly initialGitFoldersInternal: Set<
|
80
|
+
private readonly initialFilePathsInternal: Set<Platform.DevToolsPath.EncodedPathString>;
|
81
|
+
private readonly initialGitFoldersInternal: Set<Platform.DevToolsPath.EncodedPathString>;
|
82
82
|
private readonly fileLocks: Map<string, Promise<void>>;
|
83
83
|
|
84
84
|
constructor(
|
@@ -129,7 +129,7 @@ export class IsolatedFileSystem extends PlatformFileSystem {
|
|
129
129
|
const promise = new Promise<Metadata|null>(f => {
|
130
130
|
fulfill = f;
|
131
131
|
});
|
132
|
-
this.domFileSystem.root.getFile(path, undefined, fileEntryLoaded, errorHandler);
|
132
|
+
this.domFileSystem.root.getFile(decodeURIComponent(path), undefined, fileEntryLoaded, errorHandler);
|
133
133
|
return promise;
|
134
134
|
|
135
135
|
function fileEntryLoaded(entry: FileEntry): void {
|
@@ -143,11 +143,11 @@ export class IsolatedFileSystem extends PlatformFileSystem {
|
|
143
143
|
}
|
144
144
|
}
|
145
145
|
|
146
|
-
initialFilePaths():
|
146
|
+
initialFilePaths(): Platform.DevToolsPath.EncodedPathString[] {
|
147
147
|
return [...this.initialFilePathsInternal];
|
148
148
|
}
|
149
149
|
|
150
|
-
initialGitFolders():
|
150
|
+
initialGitFolders(): Platform.DevToolsPath.EncodedPathString[] {
|
151
151
|
return [...this.initialGitFoldersInternal];
|
152
152
|
}
|
153
153
|
|
@@ -168,12 +168,14 @@ export class IsolatedFileSystem extends PlatformFileSystem {
|
|
168
168
|
if (this.isFileExcluded(entry.fullPath)) {
|
169
169
|
continue;
|
170
170
|
}
|
171
|
-
this.initialFilePathsInternal.add(
|
171
|
+
this.initialFilePathsInternal.add(Common.ParsedURL.ParsedURL.rawPathToEncodedPathString(
|
172
|
+
entry.fullPath.substr(1) as Platform.DevToolsPath.RawPathString));
|
172
173
|
} else {
|
173
174
|
if (entry.fullPath.endsWith('/.git')) {
|
174
175
|
const lastSlash = entry.fullPath.lastIndexOf('/');
|
175
176
|
const parentFolder = entry.fullPath.substring(1, lastSlash);
|
176
|
-
this.initialGitFoldersInternal.add(
|
177
|
+
this.initialGitFoldersInternal.add(Common.ParsedURL.ParsedURL.rawPathToEncodedPathString(
|
178
|
+
parentFolder as Platform.DevToolsPath.RawPathString));
|
177
179
|
}
|
178
180
|
if (this.isFileExcluded(entry.fullPath + '/')) {
|
179
181
|
this.excludedEmbedderFolders.push(Common.ParsedURL.ParsedURL.urlToRawPathString(
|
@@ -221,7 +223,7 @@ export class IsolatedFileSystem extends PlatformFileSystem {
|
|
221
223
|
}
|
222
224
|
|
223
225
|
async createFile(path: string, name: string|null): Promise<string|null> {
|
224
|
-
const dirEntry = await this.createFoldersIfNotExist(path);
|
226
|
+
const dirEntry = await this.createFoldersIfNotExist(decodeURIComponent(path));
|
225
227
|
if (!dirEntry) {
|
226
228
|
return null;
|
227
229
|
}
|
@@ -230,7 +232,8 @@ export class IsolatedFileSystem extends PlatformFileSystem {
|
|
230
232
|
if (!fileEntry) {
|
231
233
|
return null;
|
232
234
|
}
|
233
|
-
return
|
235
|
+
return Common.ParsedURL.ParsedURL.rawPathToEncodedPathString(
|
236
|
+
fileEntry.fullPath.substr(1) as Platform.DevToolsPath.RawPathString);
|
234
237
|
|
235
238
|
function createFileCandidate(
|
236
239
|
this: IsolatedFileSystem, name: string, newFileIndex?: number): Promise<FileEntry|null> {
|
@@ -256,7 +259,8 @@ export class IsolatedFileSystem extends PlatformFileSystem {
|
|
256
259
|
const promise = new Promise<boolean>(resolve => {
|
257
260
|
resolveCallback = resolve;
|
258
261
|
});
|
259
|
-
this.domFileSystem.root.getFile(
|
262
|
+
this.domFileSystem.root.getFile(
|
263
|
+
decodeURIComponent(path), undefined, fileEntryLoaded.bind(this), errorHandler.bind(this));
|
260
264
|
return promise;
|
261
265
|
|
262
266
|
function fileEntryLoaded(this: IsolatedFileSystem, fileEntry: FileEntry): void {
|
@@ -279,7 +283,7 @@ export class IsolatedFileSystem extends PlatformFileSystem {
|
|
279
283
|
|
280
284
|
requestFileBlob(path: string): Promise<Blob|null> {
|
281
285
|
return new Promise(resolve => {
|
282
|
-
this.domFileSystem.root.getFile(path, undefined, entry => {
|
286
|
+
this.domFileSystem.root.getFile(decodeURIComponent(path), undefined, entry => {
|
283
287
|
entry.file(resolve, errorHandler.bind(this));
|
284
288
|
}, errorHandler.bind(this));
|
285
289
|
|
@@ -347,7 +351,8 @@ export class IsolatedFileSystem extends PlatformFileSystem {
|
|
347
351
|
// @ts-ignore TODO(crbug.com/1172300) Properly type this after jsdoc to ts migration
|
348
352
|
callback = x;
|
349
353
|
});
|
350
|
-
this.domFileSystem.root.getFile(
|
354
|
+
this.domFileSystem.root.getFile(
|
355
|
+
decodeURIComponent(path), {create: true}, fileEntryLoaded.bind(this), errorHandler.bind(this));
|
351
356
|
return promise;
|
352
357
|
};
|
353
358
|
|
@@ -391,7 +396,8 @@ export class IsolatedFileSystem extends PlatformFileSystem {
|
|
391
396
|
let fileEntry: FileEntry;
|
392
397
|
let dirEntry: DirectoryEntry;
|
393
398
|
|
394
|
-
this.domFileSystem.root.getFile(
|
399
|
+
this.domFileSystem.root.getFile(
|
400
|
+
decodeURIComponent(path), undefined, fileEntryLoaded.bind(this), errorHandler.bind(this));
|
395
401
|
|
396
402
|
function fileEntryLoaded(this: IsolatedFileSystem, entry: FileEntry): void {
|
397
403
|
if (entry.name === newName) {
|
@@ -458,7 +464,7 @@ export class IsolatedFileSystem extends PlatformFileSystem {
|
|
458
464
|
}
|
459
465
|
|
460
466
|
private requestEntries(path: string, callback: (arg0: Array<FileEntry>) => void): void {
|
461
|
-
this.domFileSystem.root.getDirectory(path, undefined, innerCallback.bind(this), errorHandler);
|
467
|
+
this.domFileSystem.root.getDirectory(decodeURIComponent(path), undefined, innerCallback.bind(this), errorHandler);
|
462
468
|
|
463
469
|
function innerCallback(this: IsolatedFileSystem, dirEntry: DirectoryEntry): void {
|
464
470
|
this.readDirectory(dirEntry, callback);
|
@@ -248,6 +248,11 @@ export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrappe
|
|
248
248
|
}
|
249
249
|
}
|
250
250
|
|
251
|
+
private fileUrlFromNetworkUrl(url: Platform.DevToolsPath.UrlString): Platform.DevToolsPath.UrlString {
|
252
|
+
return (this.projectInternal as FileSystem).fileSystemPath() + '/' + this.encodedPathFromUrl(url) as
|
253
|
+
Platform.DevToolsPath.UrlString;
|
254
|
+
}
|
255
|
+
|
251
256
|
private decodeLocalPathToUrlPath(path: string): string {
|
252
257
|
try {
|
253
258
|
return unescape(path);
|
@@ -341,12 +346,11 @@ export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrappe
|
|
341
346
|
!this.canHandleNetworkUISourceCode(uiSourceCode)) {
|
342
347
|
return;
|
343
348
|
}
|
344
|
-
const url = Common.ParsedURL.ParsedURL.urlWithoutHash(uiSourceCode.url());
|
349
|
+
const url = Common.ParsedURL.ParsedURL.urlWithoutHash(uiSourceCode.url()) as Platform.DevToolsPath.UrlString;
|
345
350
|
this.networkUISourceCodeForEncodedPath.set(this.encodedPathFromUrl(url), uiSourceCode);
|
346
351
|
|
347
352
|
const project = this.projectInternal as FileSystem;
|
348
|
-
const fileSystemUISourceCode =
|
349
|
-
project.uiSourceCodeForURL(project.fileSystemPath() + '/' + this.encodedPathFromUrl(url));
|
353
|
+
const fileSystemUISourceCode = project.uiSourceCodeForURL(this.fileUrlFromNetworkUrl(url));
|
350
354
|
if (fileSystemUISourceCode) {
|
351
355
|
await this.bind(uiSourceCode, fileSystemUISourceCode);
|
352
356
|
}
|
@@ -571,7 +575,7 @@ export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrappe
|
|
571
575
|
return;
|
572
576
|
}
|
573
577
|
const proj = this.projectInternal as FileSystem;
|
574
|
-
const path =
|
578
|
+
const path = this.fileUrlFromNetworkUrl(interceptedRequest.request.url as Platform.DevToolsPath.UrlString);
|
575
579
|
const fileSystemUISourceCode = proj.uiSourceCodeForURL(path);
|
576
580
|
let responseHeaders: Protocol.Fetch.HeaderEntry[] = [];
|
577
581
|
if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.HEADER_OVERRIDES)) {
|
@@ -3,6 +3,7 @@
|
|
3
3
|
// found in the LICENSE file.
|
4
4
|
|
5
5
|
import type * as Common from '../../core/common/common.js';
|
6
|
+
import type * as Platform from '../../core/platform/platform.js';
|
6
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
7
8
|
import type * as TextUtils from '../text_utils/text_utils.js';
|
8
9
|
|
@@ -26,11 +27,11 @@ export class PlatformFileSystem {
|
|
26
27
|
return Promise.resolve(null);
|
27
28
|
}
|
28
29
|
|
29
|
-
initialFilePaths():
|
30
|
+
initialFilePaths(): Platform.DevToolsPath.EncodedPathString[] {
|
30
31
|
return [];
|
31
32
|
}
|
32
33
|
|
33
|
-
initialGitFolders():
|
34
|
+
initialGitFolders(): Platform.DevToolsPath.EncodedPathString[] {
|
34
35
|
return [];
|
35
36
|
}
|
36
37
|
|
@@ -36,7 +36,7 @@ import * as Platform from '../../core/platform/platform.js';
|
|
36
36
|
import * as TextUtils from '../text_utils/text_utils.js';
|
37
37
|
|
38
38
|
import type {Project} from './WorkspaceImpl.js';
|
39
|
-
import {Events as WorkspaceImplEvents
|
39
|
+
import {Events as WorkspaceImplEvents} from './WorkspaceImpl.js';
|
40
40
|
|
41
41
|
const UIStrings = {
|
42
42
|
/**
|
@@ -82,9 +82,13 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
82
82
|
if (parsedURL) {
|
83
83
|
this.originInternal = parsedURL.securityOrigin();
|
84
84
|
this.parentURLInternal = this.originInternal + parsedURL.folderPathComponents;
|
85
|
-
this.nameInternal = parsedURL.lastPathComponent;
|
86
85
|
if (parsedURL.queryParams) {
|
87
|
-
|
86
|
+
// in case file name contains query params, it doesn't look like a normal file name anymore
|
87
|
+
// so it can as well remain encoded
|
88
|
+
this.nameInternal = parsedURL.lastPathComponent + '?' + parsedURL.queryParams;
|
89
|
+
} else {
|
90
|
+
// file name looks best decoded
|
91
|
+
this.nameInternal = decodeURIComponent(parsedURL.lastPathComponent);
|
88
92
|
}
|
89
93
|
} else {
|
90
94
|
this.originInternal = '';
|
@@ -138,15 +142,7 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
138
142
|
if (!this.nameInternal) {
|
139
143
|
return i18nString(UIStrings.index);
|
140
144
|
}
|
141
|
-
|
142
|
-
try {
|
143
|
-
if (this.project().type() === projectTypes.FileSystem) {
|
144
|
-
name = unescape(name);
|
145
|
-
} else {
|
146
|
-
name = decodeURI(name);
|
147
|
-
}
|
148
|
-
} catch (error) {
|
149
|
-
}
|
145
|
+
const name = this.nameInternal;
|
150
146
|
return skipTrim ? name : Platform.StringUtilities.trimEndWithMaxLength(name, 100);
|
151
147
|
}
|
152
148
|
|
@@ -178,10 +174,12 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
178
174
|
|
179
175
|
private updateName(name: string, url: string, contentType?: Common.ResourceType.ResourceType): void {
|
180
176
|
const oldURL = this.urlInternal;
|
181
|
-
this.urlInternal = this.urlInternal.substring(0, this.urlInternal.length - this.nameInternal.length) + name;
|
182
177
|
this.nameInternal = name;
|
183
178
|
if (url) {
|
184
179
|
this.urlInternal = url;
|
180
|
+
} else {
|
181
|
+
this.urlInternal = Common.ParsedURL.ParsedURL.relativePathToUrlString(
|
182
|
+
name as Platform.DevToolsPath.RawPathString, oldURL as Platform.DevToolsPath.UrlString);
|
185
183
|
}
|
186
184
|
if (contentType) {
|
187
185
|
this.contentTypeInternal = contentType;
|
@@ -191,7 +189,6 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
191
189
|
WorkspaceImplEvents.UISourceCodeRenamed, {oldURL: oldURL, uiSourceCode: this});
|
192
190
|
}
|
193
191
|
|
194
|
-
// TODO(crbug.com/1253323): Cast to RawPathString will be removed when migration to branded types is complete.
|
195
192
|
contentURL(): string {
|
196
193
|
return this.url();
|
197
194
|
}
|
@@ -29,6 +29,7 @@
|
|
29
29
|
*/
|
30
30
|
|
31
31
|
import * as Common from '../../core/common/common.js';
|
32
|
+
import type * as Platform from '../../core/platform/platform.js';
|
32
33
|
import type * as TextUtils from '../text_utils/text_utils.js';
|
33
34
|
|
34
35
|
import type {UISourceCodeMetadata} from './UISourceCode.js';
|
@@ -175,7 +176,10 @@ export abstract class ProjectStore implements Project {
|
|
175
176
|
|
176
177
|
renameUISourceCode(uiSourceCode: UISourceCode, newName: string): void {
|
177
178
|
const oldPath = uiSourceCode.url();
|
178
|
-
const newPath = uiSourceCode.parentURL() ?
|
179
|
+
const newPath = uiSourceCode.parentURL() ?
|
180
|
+
Common.ParsedURL.ParsedURL.urlFromParentUrlAndName(
|
181
|
+
uiSourceCode.parentURL() as Platform.DevToolsPath.UrlString, newName) :
|
182
|
+
encodeURIComponent(newName);
|
179
183
|
const value = this.uiSourceCodesMap.get(oldPath) as {
|
180
184
|
uiSourceCode: UISourceCode,
|
181
185
|
index: number,
|
@@ -338,7 +338,6 @@ text.animation-timeline-grid-label {
|
|
338
338
|
background: var(--color-background-elevation-2);
|
339
339
|
opacity: 0%;
|
340
340
|
border-right: 1px solid var(--color-details-hairline);
|
341
|
-
cursor: pointer;
|
342
341
|
}
|
343
342
|
|
344
343
|
.animation-buffer-preview:focus-visible {
|
@@ -410,7 +409,6 @@ text.animation-timeline-grid-label {
|
|
410
409
|
background-color: transparent;
|
411
410
|
flex: 1 0 auto;
|
412
411
|
text-align: center;
|
413
|
-
cursor: pointer;
|
414
412
|
}
|
415
413
|
|
416
414
|
.animation-playback-rate-button:first-child {
|
@@ -454,7 +452,6 @@ text.animation-timeline-grid-label {
|
|
454
452
|
box-shadow: 0 1px 4px 0 var(--color-background-highlight);
|
455
453
|
z-index: 100;
|
456
454
|
display: none;
|
457
|
-
cursor: pointer;
|
458
455
|
font-weight: 700;
|
459
456
|
color: var(--color-background);
|
460
457
|
}
|
@@ -71,23 +71,6 @@
|
|
71
71
|
overflow: hidden;
|
72
72
|
}
|
73
73
|
|
74
|
-
.console-delete-pin {
|
75
|
-
position: absolute;
|
76
|
-
top: 8px;
|
77
|
-
left: 8px;
|
78
|
-
opacity: 70%;
|
79
|
-
cursor: pointer;
|
80
|
-
}
|
81
|
-
|
82
|
-
.console-delete-pin:hover,
|
83
|
-
.console-delete-pin:focus-visible {
|
84
|
-
opacity: 100%;
|
85
|
-
}
|
86
|
-
|
87
|
-
:host-context(.-theme-with-dark-background) .console-delete-pin {
|
88
|
-
filter: brightness(2);
|
89
|
-
}
|
90
|
-
|
91
74
|
.console-pin-name:focus-within {
|
92
75
|
background: var(--color-background);
|
93
76
|
box-shadow: var(--legacy-focus-ring-active-shadow) inset;
|
@@ -35,6 +35,7 @@
|
|
35
35
|
import * as Common from '../../core/common/common.js';
|
36
36
|
import * as Host from '../../core/host/host.js';
|
37
37
|
import * as i18n from '../../core/i18n/i18n.js';
|
38
|
+
import * as Platform from '../../core/platform/platform.js';
|
38
39
|
import * as Root from '../../core/root/root.js';
|
39
40
|
import * as SDK from '../../core/sdk/sdk.js';
|
40
41
|
import * as Extensions from '../../models/extensions/extensions.js';
|
@@ -1269,9 +1270,22 @@ export class DOMNodeRevealer implements Common.Revealer.Revealer {
|
|
1269
1270
|
const panel = ElementsPanel.instance();
|
1270
1271
|
panel.pendingNodeReveal = true;
|
1271
1272
|
|
1272
|
-
return new Promise(revealPromise)
|
1273
|
+
return (new Promise<void>(revealPromise)).catch((reason: Error) => {
|
1274
|
+
let message: string;
|
1275
|
+
if (Platform.UserVisibleError.isUserVisibleError(reason)) {
|
1276
|
+
message = reason.message;
|
1277
|
+
} else {
|
1278
|
+
message = i18nString(UIStrings.nodeCannotBeFoundInTheCurrent);
|
1279
|
+
}
|
1273
1280
|
|
1274
|
-
|
1281
|
+
Common.Console.Console.instance().warn(message);
|
1282
|
+
// Blink tests expect an exception to be raised and unhandled here to detect that the node
|
1283
|
+
// was actually not successfully viewed.
|
1284
|
+
throw reason;
|
1285
|
+
});
|
1286
|
+
|
1287
|
+
function revealPromise(
|
1288
|
+
resolve: () => void, reject: (arg0: Platform.UserVisibleError.UserVisibleError) => void): void {
|
1275
1289
|
if (node instanceof SDK.DOMModel.DOMNode) {
|
1276
1290
|
onNodeResolved((node as SDK.DOMModel.DOMNode));
|
1277
1291
|
} else if (node instanceof SDK.DOMModel.DeferredDOMNode) {
|
@@ -1281,10 +1295,12 @@ export class DOMNodeRevealer implements Common.Revealer.Revealer {
|
|
1281
1295
|
if (domModel) {
|
1282
1296
|
void domModel.pushObjectAsNodeToFrontend(node).then(checkRemoteObjectThenReveal);
|
1283
1297
|
} else {
|
1284
|
-
|
1298
|
+
const msg = i18nString(UIStrings.nodeCannotBeFoundInTheCurrent);
|
1299
|
+
reject(new Platform.UserVisibleError.UserVisibleError(msg));
|
1285
1300
|
}
|
1286
1301
|
} else {
|
1287
|
-
|
1302
|
+
const msg = i18nString(UIStrings.theRemoteObjectCouldNotBe);
|
1303
|
+
reject(new Platform.UserVisibleError.UserVisibleError(msg));
|
1288
1304
|
panel.pendingNodeReveal = false;
|
1289
1305
|
}
|
1290
1306
|
|
@@ -1304,8 +1320,7 @@ export class DOMNodeRevealer implements Common.Revealer.Revealer {
|
|
1304
1320
|
const isDocument = node instanceof SDK.DOMModel.DOMDocument;
|
1305
1321
|
if (!isDocument && isDetached) {
|
1306
1322
|
const msg = i18nString(UIStrings.nodeCannotBeFoundInTheCurrent);
|
1307
|
-
|
1308
|
-
reject(new Error(msg));
|
1323
|
+
reject(new Platform.UserVisibleError.UserVisibleError(msg));
|
1309
1324
|
return;
|
1310
1325
|
}
|
1311
1326
|
|
@@ -1313,14 +1328,14 @@ export class DOMNodeRevealer implements Common.Revealer.Revealer {
|
|
1313
1328
|
void panel.revealAndSelectNode(resolvedNode, !omitFocus).then(resolve);
|
1314
1329
|
return;
|
1315
1330
|
}
|
1316
|
-
|
1331
|
+
const msg = i18nString(UIStrings.nodeCannotBeFoundInTheCurrent);
|
1332
|
+
reject(new Platform.UserVisibleError.UserVisibleError(msg));
|
1317
1333
|
}
|
1318
1334
|
|
1319
1335
|
function checkRemoteObjectThenReveal(resolvedNode: SDK.DOMModel.DOMNode|null): void {
|
1320
1336
|
if (!resolvedNode) {
|
1321
1337
|
const msg = i18nString(UIStrings.theRemoteObjectCouldNotBe);
|
1322
|
-
|
1323
|
-
reject(new Error(msg));
|
1338
|
+
reject(new Platform.UserVisibleError.UserVisibleError(msg));
|
1324
1339
|
return;
|
1325
1340
|
}
|
1326
1341
|
onNodeResolved(resolvedNode);
|
@@ -1329,8 +1344,7 @@ export class DOMNodeRevealer implements Common.Revealer.Revealer {
|
|
1329
1344
|
function checkDeferredDOMNodeThenReveal(resolvedNode: SDK.DOMModel.DOMNode|null): void {
|
1330
1345
|
if (!resolvedNode) {
|
1331
1346
|
const msg = i18nString(UIStrings.theDeferredDomNodeCouldNotBe);
|
1332
|
-
|
1333
|
-
reject(new Error(msg));
|
1347
|
+
reject(new Platform.UserVisibleError.UserVisibleError(msg));
|
1334
1348
|
return;
|
1335
1349
|
}
|
1336
1350
|
onNodeResolved(resolvedNode);
|