chrome-devtools-frontend 1.0.999279 → 1.0.1000679
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/front_end/.eslintrc.js +4 -4
- package/front_end/core/common/ParsedURL.ts +3 -3
- package/front_end/core/dom_extension/DOMExtension.ts +0 -10
- package/front_end/core/i18n/locales/en-US.json +6 -9
- package/front_end/core/i18n/locales/en-XL.json +6 -9
- package/front_end/models/extensions/ExtensionAPI.ts +4 -4
- package/front_end/models/extensions/ExtensionTraceProvider.ts +2 -1
- package/front_end/models/issues_manager/DeprecationIssue.ts +7 -2
- package/front_end/models/workspace/WorkspaceImpl.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +15 -0
- package/front_end/panels/network/NetworkItemView.ts +1 -1
- package/front_end/panels/sources/AddSourceMapURLDialog.ts +5 -4
- package/front_end/panels/sources/DebuggerPausedMessage.ts +2 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +2 -2
- package/front_end/panels/sources/EditingLocationHistoryManager.ts +2 -4
- package/front_end/panels/sources/NavigatorView.ts +4 -5
- package/front_end/panels/sources/ScriptFormatterEditorAction.ts +2 -1
- package/front_end/panels/sources/TabbedEditorContainer.ts +14 -13
- package/front_end/panels/timeline/ExtensionTracingSession.ts +2 -1
- package/front_end/panels/timeline/TimelineEventOverview.ts +0 -60
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +1 -9
- package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
- package/front_end/panels/timeline/TimelineHistoryManager.ts +0 -2
- package/front_end/panels/timeline/TimelineLoader.ts +2 -1
- package/front_end/panels/timeline/TimelinePanel.ts +3 -5
- package/front_end/panels/timeline/TimelineTreeView.ts +4 -4
- package/front_end/panels/timeline/TimelineUIUtils.ts +3 -9
- package/front_end/panels/timeline/timeline-legacy.ts +0 -3
- package/front_end/panels/timeline/timelinePanel.css +0 -6
- package/front_end/panels/webauthn/WebauthnPane.ts +49 -15
- package/package.json +1 -1
- package/scripts/eslint_rules/lib/enforce_bound_render_for_schedule_render.js +110 -0
- package/scripts/eslint_rules/tests/enforce_bound_render_for_schedule_render_test.js +74 -0
- package/scripts/reformat-clang-js-ts.js +60 -0
package/front_end/.eslintrc.js
CHANGED
@@ -2,6 +2,7 @@
|
|
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
|
+
// clang-format off
|
5
6
|
const path = require('path');
|
6
7
|
const rulesDirPlugin = require('eslint-plugin-rulesdir');
|
7
8
|
rulesDirPlugin.RULES_DIR = path.join(__dirname, '..', 'scripts', 'eslint_rules', 'lib');
|
@@ -28,6 +29,7 @@ module.exports = {
|
|
28
29
|
'rules': {
|
29
30
|
'@typescript-eslint/explicit-function-return-type': 2,
|
30
31
|
'rulesdir/no_importing_images_from_src': 2,
|
32
|
+
'rulesdir/enforce_bound_render_for_schedule_render': 2,
|
31
33
|
'rulesdir/enforce_custom_event_names': 2,
|
32
34
|
'rulesdir/set_data_type_reference': 2,
|
33
35
|
'rulesdir/no_bound_component_methods': 2,
|
@@ -120,10 +122,7 @@ module.exports = {
|
|
120
122
|
},
|
121
123
|
{
|
122
124
|
// Ignore type properties that require quotes
|
123
|
-
'selector': [
|
124
|
-
'typeProperty',
|
125
|
-
'enumMember'
|
126
|
-
],
|
125
|
+
'selector': ['typeProperty', 'enumMember'],
|
127
126
|
'format': null,
|
128
127
|
'modifiers': ['requiresQuotes']
|
129
128
|
}
|
@@ -150,3 +149,4 @@ module.exports = {
|
|
150
149
|
}
|
151
150
|
]
|
152
151
|
};
|
152
|
+
// clang-format on
|
@@ -153,10 +153,10 @@ export class ParsedURL {
|
|
153
153
|
return null;
|
154
154
|
}
|
155
155
|
|
156
|
-
|
156
|
+
static preEncodeSpecialCharactersInPath(path: string): string {
|
157
157
|
// Based on net::FilePathToFileURL. Ideally we would handle
|
158
158
|
// '\\' as well on non-Windows file systems.
|
159
|
-
for (const specialChar of ['%', ';', '#', '?']) {
|
159
|
+
for (const specialChar of ['%', ';', '#', '?', ' ']) {
|
160
160
|
(path as string) = path.replaceAll(specialChar, encodeURIComponent(specialChar));
|
161
161
|
}
|
162
162
|
return path;
|
@@ -185,7 +185,7 @@ export class ParsedURL {
|
|
185
185
|
*/
|
186
186
|
static urlFromParentUrlAndName(parentUrl: Platform.DevToolsPath.UrlString, name: string):
|
187
187
|
Platform.DevToolsPath.UrlString {
|
188
|
-
return ParsedURL.concatenate(parentUrl, '/',
|
188
|
+
return ParsedURL.concatenate(parentUrl, '/', ParsedURL.preEncodeSpecialCharactersInPath(name));
|
189
189
|
}
|
190
190
|
|
191
191
|
static encodedPathToRawPathString(encPath: Platform.DevToolsPath.EncodedPathString):
|
@@ -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);
|
@@ -5822,6 +5822,9 @@
|
|
5822
5822
|
"panels/lighthouse/LighthouseController.ts | isThisPageUsableByPeopleWith": {
|
5823
5823
|
"message": "Is this page usable by people with disabilities or impairments"
|
5824
5824
|
},
|
5825
|
+
"panels/lighthouse/LighthouseController.ts | javaScriptDisabled": {
|
5826
|
+
"message": "JavaScript is disabled. You need to enable JavaScript to audit this page. Open the Command Menu and run the Enable JavaScript command to enable JavaScript."
|
5827
|
+
},
|
5825
5828
|
"panels/lighthouse/LighthouseController.ts | legacyNavigation": {
|
5826
5829
|
"message": "Legacy navigation"
|
5827
5830
|
},
|
@@ -10238,9 +10241,6 @@
|
|
10238
10241
|
"panels/timeline/TimelineEventOverview.ts | cpu": {
|
10239
10242
|
"message": "CPU"
|
10240
10243
|
},
|
10241
|
-
"panels/timeline/TimelineEventOverview.ts | fps": {
|
10242
|
-
"message": "FPS"
|
10243
|
-
},
|
10244
10244
|
"panels/timeline/TimelineEventOverview.ts | heap": {
|
10245
10245
|
"message": "HEAP"
|
10246
10246
|
},
|
@@ -10307,9 +10307,6 @@
|
|
10307
10307
|
"panels/timeline/TimelineFlameChartDataProvider.ts | rasterizerThreadS": {
|
10308
10308
|
"message": "Rasterizer Thread {PH1}"
|
10309
10309
|
},
|
10310
|
-
"panels/timeline/TimelineFlameChartDataProvider.ts | sFfps": {
|
10311
|
-
"message": "{PH1} ~ {PH2} fps"
|
10312
|
-
},
|
10313
10310
|
"panels/timeline/TimelineFlameChartDataProvider.ts | sSelfS": {
|
10314
10311
|
"message": "{PH1} (self {PH2})"
|
10315
10312
|
},
|
@@ -10823,9 +10820,6 @@
|
|
10823
10820
|
"panels/timeline/TimelineUIUtils.ts | forcedReflow": {
|
10824
10821
|
"message": "Forced reflow"
|
10825
10822
|
},
|
10826
|
-
"panels/timeline/TimelineUIUtils.ts | fps": {
|
10827
|
-
"message": "FPS"
|
10828
|
-
},
|
10829
10823
|
"panels/timeline/TimelineUIUtils.ts | frame": {
|
10830
10824
|
"message": "Frame"
|
10831
10825
|
},
|
@@ -11537,6 +11531,9 @@
|
|
11537
11531
|
"panels/webauthn/WebauthnPane.ts | signCount": {
|
11538
11532
|
"message": "Signature Count"
|
11539
11533
|
},
|
11534
|
+
"panels/webauthn/WebauthnPane.ts | supportsLargeBlob": {
|
11535
|
+
"message": "Supports large blob"
|
11536
|
+
},
|
11540
11537
|
"panels/webauthn/WebauthnPane.ts | supportsResidentKeys": {
|
11541
11538
|
"message": "Supports resident keys"
|
11542
11539
|
},
|
@@ -5822,6 +5822,9 @@
|
|
5822
5822
|
"panels/lighthouse/LighthouseController.ts | isThisPageUsableByPeopleWith": {
|
5823
5823
|
"message": "Îś t̂h́îś p̂áĝé ûśâb́l̂é b̂ý p̂éôṕl̂é ŵít̂h́ d̂íŝáb̂íl̂ít̂íêś ôŕ îḿp̂áîŕm̂én̂t́ŝ"
|
5824
5824
|
},
|
5825
|
+
"panels/lighthouse/LighthouseController.ts | javaScriptDisabled": {
|
5826
|
+
"message": "Ĵáv̂áŜćr̂íp̂t́ îś d̂íŝáb̂ĺêd́. Ŷóû ńêéd̂ t́ô én̂áb̂ĺê J́âv́âŚĉŕîṕt̂ t́ô áûd́ît́ t̂h́îś p̂áĝé. Ôṕêń t̂h́ê Ćôḿm̂án̂d́ M̂én̂ú âńd̂ ŕûń t̂h́ê Én̂áb̂ĺê J́âv́âŚĉŕîṕt̂ ćôḿm̂án̂d́ t̂ó êńâb́l̂é Ĵáv̂áŜćr̂íp̂t́."
|
5827
|
+
},
|
5825
5828
|
"panels/lighthouse/LighthouseController.ts | legacyNavigation": {
|
5826
5829
|
"message": "L̂éĝáĉý n̂áv̂íĝát̂íôń"
|
5827
5830
|
},
|
@@ -10238,9 +10241,6 @@
|
|
10238
10241
|
"panels/timeline/TimelineEventOverview.ts | cpu": {
|
10239
10242
|
"message": "ĈṔÛ"
|
10240
10243
|
},
|
10241
|
-
"panels/timeline/TimelineEventOverview.ts | fps": {
|
10242
|
-
"message": "F̂ṔŜ"
|
10243
|
-
},
|
10244
10244
|
"panels/timeline/TimelineEventOverview.ts | heap": {
|
10245
10245
|
"message": "ĤÉÂṔ"
|
10246
10246
|
},
|
@@ -10307,9 +10307,6 @@
|
|
10307
10307
|
"panels/timeline/TimelineFlameChartDataProvider.ts | rasterizerThreadS": {
|
10308
10308
|
"message": "R̂áŝt́êŕîźêŕ T̂h́r̂éâd́ {PH1}"
|
10309
10309
|
},
|
10310
|
-
"panels/timeline/TimelineFlameChartDataProvider.ts | sFfps": {
|
10311
|
-
"message": "{PH1} ~ {PH2} f̂ṕŝ"
|
10312
|
-
},
|
10313
10310
|
"panels/timeline/TimelineFlameChartDataProvider.ts | sSelfS": {
|
10314
10311
|
"message": "{PH1} (ŝél̂f́ {PH2})"
|
10315
10312
|
},
|
@@ -10823,9 +10820,6 @@
|
|
10823
10820
|
"panels/timeline/TimelineUIUtils.ts | forcedReflow": {
|
10824
10821
|
"message": "F̂ór̂ćêd́ r̂éf̂ĺôẃ"
|
10825
10822
|
},
|
10826
|
-
"panels/timeline/TimelineUIUtils.ts | fps": {
|
10827
|
-
"message": "F̂ṔŜ"
|
10828
|
-
},
|
10829
10823
|
"panels/timeline/TimelineUIUtils.ts | frame": {
|
10830
10824
|
"message": "F̂ŕâḿê"
|
10831
10825
|
},
|
@@ -11537,6 +11531,9 @@
|
|
11537
11531
|
"panels/webauthn/WebauthnPane.ts | signCount": {
|
11538
11532
|
"message": "Ŝíĝńât́ûŕê Ćôún̂t́"
|
11539
11533
|
},
|
11534
|
+
"panels/webauthn/WebauthnPane.ts | supportsLargeBlob": {
|
11535
|
+
"message": "Ŝúp̂ṕôŕt̂ś l̂ár̂ǵê b́l̂ób̂"
|
11536
|
+
},
|
11540
11537
|
"panels/webauthn/WebauthnPane.ts | supportsResidentKeys": {
|
11541
11538
|
"message": "Ŝúp̂ṕôŕt̂ś r̂éŝíd̂én̂t́ k̂éŷś"
|
11542
11539
|
},
|
@@ -28,7 +28,7 @@
|
|
28
28
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
29
|
*/
|
30
30
|
|
31
|
-
import
|
31
|
+
import * as Platform from '../../core/platform/platform.js';
|
32
32
|
import type * as PublicAPI from '../../../extension-api/ExtensionAPI'; // eslint-disable-line rulesdir/es_modules_import
|
33
33
|
import type * as HAR from '../har/har.js';
|
34
34
|
|
@@ -141,7 +141,7 @@ export namespace PrivateAPI {
|
|
141
141
|
type UpdateButtonRequest =
|
142
142
|
{command: Commands.UpdateButton, id: string, icon?: string, tooltip?: string, disabled?: boolean};
|
143
143
|
type CompleteTraceSessionRequest =
|
144
|
-
{command: Commands.CompleteTraceSession, id: string, url:
|
144
|
+
{command: Commands.CompleteTraceSession, id: string, url: Platform.DevToolsPath.UrlString, timeOffset: number};
|
145
145
|
type CreateSidebarPaneRequest = {command: Commands.CreateSidebarPane, id: string, panel: string, title: string};
|
146
146
|
type SetSidebarHeightRequest = {command: Commands.SetSidebarHeight, id: string, height: string};
|
147
147
|
type SetSidebarContentRequest = {
|
@@ -930,11 +930,11 @@ self.injectedExtensionAPI = function(
|
|
930
930
|
}
|
931
931
|
|
932
932
|
(TraceSessionImpl.prototype as Pick<APIImpl.TraceSession, 'complete'>) = {
|
933
|
-
complete: function(this: APIImpl.TraceSession, url?:
|
933
|
+
complete: function(this: APIImpl.TraceSession, url?: Platform.DevToolsPath.UrlString, timeOffset?: number): void {
|
934
934
|
extensionServer.sendRequest({
|
935
935
|
command: PrivateAPI.Commands.CompleteTraceSession,
|
936
936
|
id: this._id,
|
937
|
-
url: url ||
|
937
|
+
url: url || Platform.DevToolsPath.EmptyUrlString,
|
938
938
|
timeOffset: timeOffset || 0,
|
939
939
|
});
|
940
940
|
},
|
@@ -3,6 +3,7 @@
|
|
3
3
|
// found in the LICENSE file.
|
4
4
|
|
5
5
|
import {ExtensionServer} from './ExtensionServer.js';
|
6
|
+
import type * as Platform from '../../core/platform/platform.js';
|
6
7
|
|
7
8
|
export class ExtensionTraceProvider {
|
8
9
|
private readonly extensionOrigin: string;
|
@@ -43,5 +44,5 @@ export class ExtensionTraceProvider {
|
|
43
44
|
let _lastSessionId = 0;
|
44
45
|
|
45
46
|
export interface TracingSession {
|
46
|
-
complete(url:
|
47
|
+
complete(url: Platform.DevToolsPath.UrlString, timeOffsetMicroseconds: number): void;
|
47
48
|
}
|
@@ -327,8 +327,13 @@ const
|
|
327
327
|
xmlHttpRequestSynchronousInNonWorkerOutsideBeforeUnload:
|
328
328
|
'Synchronous `XMLHttpRequest` on the main thread is deprecated because of its detrimental effects to the end user\u2019s experience. For more help, check https://xhr.spec.whatwg.org/.',
|
329
329
|
/**
|
330
|
-
|
331
|
-
|
330
|
+
*@description Warning displayed to developers that instead of using
|
331
|
+
* `supportsSession()`, which returns a promise that resolves if
|
332
|
+
* the XR session can be supported and rejects if not, they should
|
333
|
+
* use `isSessionSupported()` which will return a promise which
|
334
|
+
* resolves to a boolean indicating if the XR session can be
|
335
|
+
* supported or not, but may reject to throw an exception.
|
336
|
+
*/
|
332
337
|
xrSupportsSession:
|
333
338
|
'`supportsSession()` is deprecated. Please use `isSessionSupported()` and check the resolved boolean value instead.',
|
334
339
|
};
|
@@ -183,7 +183,7 @@ export abstract class ProjectStore implements Project {
|
|
183
183
|
const oldPath = uiSourceCode.url();
|
184
184
|
const newPath = uiSourceCode.parentURL() ?
|
185
185
|
Common.ParsedURL.ParsedURL.urlFromParentUrlAndName(uiSourceCode.parentURL(), newName) :
|
186
|
-
|
186
|
+
Common.ParsedURL.ParsedURL.preEncodeSpecialCharactersInPath(newName) as Platform.DevToolsPath.UrlString;
|
187
187
|
const value = this.uiSourceCodesMap.get(oldPath) as {
|
188
188
|
uiSourceCode: UISourceCode,
|
189
189
|
index: number,
|
@@ -171,6 +171,11 @@ const UIStrings = {
|
|
171
171
|
*/
|
172
172
|
resetStorageLocalstorage:
|
173
173
|
'Reset storage (`cache`, `service workers`, etc) before auditing. (Good for performance & `PWA` testing)',
|
174
|
+
/**
|
175
|
+
*@description Explanation for user that Ligthhouse can only audit when JavaScript is enabled
|
176
|
+
*/
|
177
|
+
javaScriptDisabled:
|
178
|
+
'JavaScript is disabled. You need to enable JavaScript to audit this page. Open the Command Menu and run the Enable JavaScript command to enable JavaScript.',
|
174
179
|
};
|
175
180
|
const str_ = i18n.i18n.registerUIStrings('panels/lighthouse/LighthouseController.ts', UIStrings);
|
176
181
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
@@ -196,6 +201,9 @@ export class LighthouseController extends Common.ObjectWrapper.ObjectWrapper<Eve
|
|
196
201
|
runtimeSetting.setting.addChangeListener(this.recomputePageAuditability.bind(this));
|
197
202
|
}
|
198
203
|
|
204
|
+
const javaScriptDisabledSetting = Common.Settings.Settings.instance().moduleSetting('javaScriptDisabled');
|
205
|
+
javaScriptDisabledSetting.addChangeListener(this.recomputePageAuditability.bind(this));
|
206
|
+
|
199
207
|
SDK.TargetManager.TargetManager.instance().observeModels(SDK.ServiceWorkerManager.ServiceWorkerManager, this);
|
200
208
|
SDK.TargetManager.TargetManager.instance().addEventListener(
|
201
209
|
SDK.TargetManager.Events.InspectedURLChanged, this.recomputePageAuditability, this);
|
@@ -273,6 +281,10 @@ export class LighthouseController extends Common.ObjectWrapper.ObjectWrapper<Eve
|
|
273
281
|
return null;
|
274
282
|
}
|
275
283
|
|
284
|
+
private javaScriptDisabled(): boolean {
|
285
|
+
return Common.Settings.Settings.instance().moduleSetting('javaScriptDisabled').get();
|
286
|
+
}
|
287
|
+
|
276
288
|
private async hasImportantResourcesNotCleared(): Promise<string> {
|
277
289
|
const clearStorageSetting =
|
278
290
|
RuntimeSettings.find(runtimeSetting => runtimeSetting.setting.name === 'lighthouse.clear_storage');
|
@@ -363,6 +375,7 @@ export class LighthouseController extends Common.ObjectWrapper.ObjectWrapper<Eve
|
|
363
375
|
const hasActiveServiceWorker = this.hasActiveServiceWorker();
|
364
376
|
const hasAtLeastOneCategory = this.hasAtLeastOneCategory();
|
365
377
|
const unauditablePageMessage = this.unauditablePageMessage();
|
378
|
+
const javaScriptDisabled = this.javaScriptDisabled();
|
366
379
|
|
367
380
|
let helpText = '';
|
368
381
|
if (hasActiveServiceWorker) {
|
@@ -371,6 +384,8 @@ export class LighthouseController extends Common.ObjectWrapper.ObjectWrapper<Eve
|
|
371
384
|
helpText = i18nString(UIStrings.atLeastOneCategoryMustBeSelected);
|
372
385
|
} else if (unauditablePageMessage) {
|
373
386
|
helpText = unauditablePageMessage;
|
387
|
+
} else if (javaScriptDisabled) {
|
388
|
+
helpText = i18nString(UIStrings.javaScriptDisabled);
|
374
389
|
}
|
375
390
|
|
376
391
|
this.dispatchEventToListeners(Events.PageAuditabilityChanged, {helpText});
|
@@ -143,7 +143,7 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane {
|
|
143
143
|
this.element.classList.add('network-item-view');
|
144
144
|
|
145
145
|
this.resourceViewTabSetting = Common.Settings.Settings.instance().createSetting(
|
146
|
-
'resourceViewTab', NetworkForward.UIRequestLocation.UIRequestTabs.
|
146
|
+
'resourceViewTab', NetworkForward.UIRequestLocation.UIRequestTabs.Headers);
|
147
147
|
|
148
148
|
this.headersView = new RequestHeadersView(request);
|
149
149
|
this.appendTab(
|
@@ -3,6 +3,7 @@
|
|
3
3
|
// found in the LICENSE file.
|
4
4
|
|
5
5
|
import * as i18n from '../../core/i18n/i18n.js';
|
6
|
+
import type * as Platform from '../../core/platform/platform.js';
|
6
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
7
8
|
|
8
9
|
import dialogStyles from './dialog.css.js';
|
@@ -22,8 +23,8 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
22
23
|
export class AddSourceMapURLDialog extends UI.Widget.HBox {
|
23
24
|
private readonly input: HTMLInputElement;
|
24
25
|
private readonly dialog: UI.Dialog.Dialog;
|
25
|
-
private readonly callback: (arg0:
|
26
|
-
constructor(callback: (arg0:
|
26
|
+
private readonly callback: (arg0: Platform.DevToolsPath.UrlString) => void;
|
27
|
+
constructor(callback: (arg0: Platform.DevToolsPath.UrlString) => void) {
|
27
28
|
super(/* isWebComponent */ true);
|
28
29
|
|
29
30
|
this.contentElement.createChild('label').textContent = i18nString(UIStrings.sourceMapUrl);
|
@@ -51,13 +52,13 @@ export class AddSourceMapURLDialog extends UI.Widget.HBox {
|
|
51
52
|
this.dialog.show();
|
52
53
|
}
|
53
54
|
|
54
|
-
private done(value:
|
55
|
+
private done(value: Platform.DevToolsPath.UrlString): void {
|
55
56
|
this.dialog.hide();
|
56
57
|
this.callback(value);
|
57
58
|
}
|
58
59
|
|
59
60
|
private apply(): void {
|
60
|
-
this.done(this.input.value);
|
61
|
+
this.done(this.input.value as Platform.DevToolsPath.UrlString);
|
61
62
|
}
|
62
63
|
|
63
64
|
private onKeyDown(event: KeyboardEvent): void {
|
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
6
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
7
|
+
import type * as Platform from '../../core/platform/platform.js';
|
7
8
|
import * as SDK from '../../core/sdk/sdk.js';
|
8
9
|
|
9
10
|
import debuggerPausedMessageStyles from './debuggerPausedMessage.css.js';
|
@@ -276,6 +277,6 @@ export const BreakpointTypeNouns = new Map([
|
|
276
277
|
]);
|
277
278
|
interface PausedDetailsAuxData {
|
278
279
|
description?: string;
|
279
|
-
url?:
|
280
|
+
url?: Platform.DevToolsPath.UrlString;
|
280
281
|
value?: string;
|
281
282
|
}
|
@@ -472,11 +472,11 @@ export class DebuggerPlugin extends Plugin {
|
|
472
472
|
}
|
473
473
|
|
474
474
|
function addSourceMapURLDialogCallback(
|
475
|
-
scriptFile: Bindings.ResourceScriptMapping.ResourceScriptFile, url:
|
475
|
+
scriptFile: Bindings.ResourceScriptMapping.ResourceScriptFile, url: Platform.DevToolsPath.UrlString): void {
|
476
476
|
if (!url) {
|
477
477
|
return;
|
478
478
|
}
|
479
|
-
scriptFile.addSourceMapURL(url
|
479
|
+
scriptFile.addSourceMapURL(url);
|
480
480
|
}
|
481
481
|
|
482
482
|
if (this.uiSourceCode.project().type() === Workspace.Workspace.projectTypes.Network &&
|
@@ -93,9 +93,7 @@ export class EditingLocationHistoryManager {
|
|
93
93
|
}
|
94
94
|
|
95
95
|
private reveal(entry: EditingLocationHistoryEntry): void {
|
96
|
-
|
97
|
-
const uiSourceCode = Workspace.Workspace.WorkspaceImpl.instance().uiSourceCode(
|
98
|
-
entry.projectId, entry.url as Platform.DevToolsPath.UrlString);
|
96
|
+
const uiSourceCode = Workspace.Workspace.WorkspaceImpl.instance().uiSourceCode(entry.projectId, entry.url);
|
99
97
|
if (uiSourceCode) {
|
100
98
|
this.revealing = true;
|
101
99
|
this.sourcesView.showSourceLocation(uiSourceCode, entry.position, false, true);
|
@@ -131,7 +129,7 @@ export class EditingLocationHistoryManager {
|
|
131
129
|
|
132
130
|
class EditingLocationHistoryEntry {
|
133
131
|
readonly projectId: string;
|
134
|
-
readonly url:
|
132
|
+
readonly url: Platform.DevToolsPath.UrlString;
|
135
133
|
position: number;
|
136
134
|
|
137
135
|
constructor(uiSourceCode: Workspace.UISourceCode.UISourceCode, position: number) {
|
@@ -290,7 +290,7 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
290
290
|
// Update folder titles.
|
291
291
|
const pathTokens =
|
292
292
|
Persistence.FileSystemWorkspaceBinding.FileSystemWorkspaceBinding.relativePath(binding.fileSystem);
|
293
|
-
let folderPath =
|
293
|
+
let folderPath = Platform.DevToolsPath.EmptyEncodedPathString;
|
294
294
|
for (let i = 0; i < pathTokens.length - 1; ++i) {
|
295
295
|
folderPath = Common.ParsedURL.ParsedURL.concatenate(folderPath, pathTokens[i]);
|
296
296
|
const folderId =
|
@@ -744,7 +744,7 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
744
744
|
const folderId = this.folderNodeId(
|
745
745
|
project, target, frame, uiSourceCode.origin(),
|
746
746
|
currentNode instanceof NavigatorFolderTreeNode && currentNode.folderPath ||
|
747
|
-
|
747
|
+
Platform.DevToolsPath.EmptyEncodedPathString);
|
748
748
|
this.subfolderNodes.delete(folderId);
|
749
749
|
parentNode.removeChild(currentNode);
|
750
750
|
currentNode = (parentNode as NavigatorUISourceCodeTreeNode | null);
|
@@ -822,8 +822,7 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
822
822
|
contextMenu.editSection().appendItem(i18nString(UIStrings.rename), this.handleContextMenuRename.bind(this, node));
|
823
823
|
contextMenu.editSection().appendItem(
|
824
824
|
i18nString(UIStrings.makeACopy),
|
825
|
-
this.handleContextMenuCreate.bind(
|
826
|
-
this, project, '' as Platform.DevToolsPath.EncodedPathString, uiSourceCode));
|
825
|
+
this.handleContextMenuCreate.bind(this, project, Platform.DevToolsPath.EmptyEncodedPathString, uiSourceCode));
|
827
826
|
contextMenu.editSection().appendItem(
|
828
827
|
i18nString(UIStrings.delete), this.handleContextMenuDelete.bind(this, uiSourceCode));
|
829
828
|
}
|
@@ -1472,7 +1471,7 @@ export class NavigatorFolderTreeNode extends NavigatorTreeNode {
|
|
1472
1471
|
folderPath: Platform.DevToolsPath.EncodedPathString, title: string) {
|
1473
1472
|
super(navigatorView, id, type);
|
1474
1473
|
this.project = project;
|
1475
|
-
this.folderPath = folderPath
|
1474
|
+
this.folderPath = folderPath;
|
1476
1475
|
this.title = title;
|
1477
1476
|
}
|
1478
1477
|
|
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
import type * as Common from '../../core/common/common.js';
|
6
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
7
|
+
import type * as Platform from '../../core/platform/platform.js';
|
7
8
|
import * as FormatterModule from '../../models/formatter/formatter.js';
|
8
9
|
import * as Persistence from '../../models/persistence/persistence.js';
|
9
10
|
import * as Workspace from '../../models/workspace/workspace.js';
|
@@ -30,7 +31,7 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
30
31
|
let scriptFormatterEditorActionInstance: ScriptFormatterEditorAction;
|
31
32
|
|
32
33
|
export class ScriptFormatterEditorAction implements EditorAction {
|
33
|
-
private readonly pathsToFormatOnLoad: Set<
|
34
|
+
private readonly pathsToFormatOnLoad: Set<Platform.DevToolsPath.UrlString>;
|
34
35
|
private sourcesView!: SourcesView;
|
35
36
|
private button!: UI.Toolbar.ToolbarButton;
|
36
37
|
private constructor() {
|
@@ -436,10 +436,10 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
436
436
|
private updateHistory(): void {
|
437
437
|
const tabIds = this.tabbedPane.lastOpenedTabIds(maximalPreviouslyViewedFilesCount);
|
438
438
|
|
439
|
-
function tabIdToURI(this: TabbedEditorContainer, tabId: string):
|
439
|
+
function tabIdToURI(this: TabbedEditorContainer, tabId: string): Platform.DevToolsPath.UrlString {
|
440
440
|
const tab = this.files.get(tabId);
|
441
441
|
if (!tab) {
|
442
|
-
return
|
442
|
+
return Platform.DevToolsPath.EmptyUrlString;
|
443
443
|
}
|
444
444
|
return tab.url();
|
445
445
|
}
|
@@ -639,18 +639,19 @@ export let tabId = 0;
|
|
639
639
|
export const maximalPreviouslyViewedFilesCount = 30;
|
640
640
|
|
641
641
|
interface SerializedHistoryItem {
|
642
|
-
url:
|
642
|
+
url: Platform.DevToolsPath.UrlString;
|
643
643
|
selectionRange?: TextUtils.TextRange.SerializedTextRange;
|
644
644
|
scrollLineNumber?: number;
|
645
645
|
}
|
646
646
|
|
647
647
|
export class HistoryItem {
|
648
|
-
url:
|
648
|
+
url: Platform.DevToolsPath.UrlString;
|
649
649
|
private isSerializable: boolean;
|
650
650
|
selectionRange: TextUtils.TextRange.TextRange|undefined;
|
651
651
|
scrollLineNumber: number|undefined;
|
652
652
|
|
653
|
-
constructor(
|
653
|
+
constructor(
|
654
|
+
url: Platform.DevToolsPath.UrlString, selectionRange?: TextUtils.TextRange.TextRange, scrollLineNumber?: number) {
|
654
655
|
this.url = url;
|
655
656
|
this.isSerializable = url.length < HistoryItem.serializableUrlLengthLimit;
|
656
657
|
this.selectionRange = selectionRange;
|
@@ -700,7 +701,7 @@ export class History {
|
|
700
701
|
return new History(items);
|
701
702
|
}
|
702
703
|
|
703
|
-
index(url:
|
704
|
+
index(url: Platform.DevToolsPath.UrlString): number {
|
704
705
|
const index = this.itemsIndex.get(url);
|
705
706
|
if (index !== undefined) {
|
706
707
|
return index;
|
@@ -716,12 +717,12 @@ export class History {
|
|
716
717
|
}
|
717
718
|
}
|
718
719
|
|
719
|
-
selectionRange(url:
|
720
|
+
selectionRange(url: Platform.DevToolsPath.UrlString): TextUtils.TextRange.TextRange|undefined {
|
720
721
|
const index = this.index(url);
|
721
722
|
return index !== -1 ? this.items[index].selectionRange : undefined;
|
722
723
|
}
|
723
724
|
|
724
|
-
updateSelectionRange(url:
|
725
|
+
updateSelectionRange(url: Platform.DevToolsPath.UrlString, selectionRange?: TextUtils.TextRange.TextRange): void {
|
725
726
|
if (!selectionRange) {
|
726
727
|
return;
|
727
728
|
}
|
@@ -732,12 +733,12 @@ export class History {
|
|
732
733
|
this.items[index].selectionRange = selectionRange;
|
733
734
|
}
|
734
735
|
|
735
|
-
scrollLineNumber(url:
|
736
|
+
scrollLineNumber(url: Platform.DevToolsPath.UrlString): number|undefined {
|
736
737
|
const index = this.index(url);
|
737
738
|
return index !== -1 ? this.items[index].scrollLineNumber : undefined;
|
738
739
|
}
|
739
740
|
|
740
|
-
updateScrollLineNumber(url:
|
741
|
+
updateScrollLineNumber(url: Platform.DevToolsPath.UrlString, scrollLineNumber: number): void {
|
741
742
|
const index = this.index(url);
|
742
743
|
if (index === -1) {
|
743
744
|
return;
|
@@ -745,7 +746,7 @@ export class History {
|
|
745
746
|
this.items[index].scrollLineNumber = scrollLineNumber;
|
746
747
|
}
|
747
748
|
|
748
|
-
update(urls:
|
749
|
+
update(urls: Platform.DevToolsPath.UrlString[]): void {
|
749
750
|
for (let i = urls.length - 1; i >= 0; --i) {
|
750
751
|
const index = this.index(urls[i]);
|
751
752
|
let item;
|
@@ -760,7 +761,7 @@ export class History {
|
|
760
761
|
}
|
761
762
|
}
|
762
763
|
|
763
|
-
remove(url:
|
764
|
+
remove(url: Platform.DevToolsPath.UrlString): void {
|
764
765
|
const index = this.index(url);
|
765
766
|
if (index !== -1) {
|
766
767
|
this.items.splice(index, 1);
|
@@ -786,7 +787,7 @@ export class History {
|
|
786
787
|
return serializedHistory;
|
787
788
|
}
|
788
789
|
|
789
|
-
urls():
|
790
|
+
urls(): Platform.DevToolsPath.UrlString[] {
|
790
791
|
const result = [];
|
791
792
|
for (let i = 0; i < this.items.length; ++i) {
|
792
793
|
result.push(this.items[i].url);
|
@@ -2,6 +2,7 @@
|
|
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 type * as Platform from '../../core/platform/platform.js';
|
5
6
|
import type * as SDK from '../../core/sdk/sdk.js';
|
6
7
|
import type * as Extensions from '../../models/extensions/extensions.js';
|
7
8
|
|
@@ -42,7 +43,7 @@ export class ExtensionTracingSession implements Extensions.ExtensionTraceProvide
|
|
42
43
|
this.completionCallback();
|
43
44
|
}
|
44
45
|
|
45
|
-
complete(url:
|
46
|
+
complete(url: Platform.DevToolsPath.UrlString, timeOffsetMicroseconds: number): void {
|
46
47
|
if (!url) {
|
47
48
|
this.completionCallback();
|
48
49
|
return;
|
@@ -53,10 +53,6 @@ const UIStrings = {
|
|
53
53
|
/**
|
54
54
|
*@description Text in Timeline Event Overview of the Performance panel
|
55
55
|
*/
|
56
|
-
fps: 'FPS',
|
57
|
-
/**
|
58
|
-
*@description Text in Timeline Event Overview of the Performance panel
|
59
|
-
*/
|
60
56
|
heap: 'HEAP',
|
61
57
|
/**
|
62
58
|
*@description Heap size label text content in Timeline Event Overview of the Performance panel
|
@@ -485,62 +481,6 @@ export class TimelineFilmStripOverview extends TimelineEventOverview {
|
|
485
481
|
static readonly Padding = 2;
|
486
482
|
}
|
487
483
|
|
488
|
-
export class TimelineEventOverviewFrames extends TimelineEventOverview {
|
489
|
-
constructor() {
|
490
|
-
super('framerate', i18nString(UIStrings.fps));
|
491
|
-
}
|
492
|
-
|
493
|
-
update(): void {
|
494
|
-
super.update();
|
495
|
-
if (!this.model) {
|
496
|
-
return;
|
497
|
-
}
|
498
|
-
const frames = this.model.frames();
|
499
|
-
if (!frames.length) {
|
500
|
-
return;
|
501
|
-
}
|
502
|
-
const height = this.height();
|
503
|
-
const padding = Number(window.devicePixelRatio);
|
504
|
-
const baseFrameDurationMs = 1e3 / 60;
|
505
|
-
const visualHeight = height - 2 * padding;
|
506
|
-
const timeOffset = this.model.timelineModel().minimumRecordTime();
|
507
|
-
const timeSpan = this.model.timelineModel().maximumRecordTime() - timeOffset;
|
508
|
-
const scale = this.width() / timeSpan;
|
509
|
-
const baseY = height - padding;
|
510
|
-
const ctx = this.context();
|
511
|
-
const bottomY = baseY + 10 * window.devicePixelRatio;
|
512
|
-
let x = 0;
|
513
|
-
let y: number = bottomY;
|
514
|
-
|
515
|
-
const lineWidth = window.devicePixelRatio;
|
516
|
-
const offset = lineWidth & 1 ? 0.5 : 0;
|
517
|
-
const tickDepth = 1.5 * window.devicePixelRatio;
|
518
|
-
ctx.beginPath();
|
519
|
-
ctx.moveTo(0, y);
|
520
|
-
for (let i = 0; i < frames.length; ++i) {
|
521
|
-
const frame = frames[i];
|
522
|
-
x = Math.round((frame.startTime - timeOffset) * scale) + offset;
|
523
|
-
ctx.lineTo(x, y);
|
524
|
-
ctx.lineTo(x, y + tickDepth);
|
525
|
-
y = frame.idle ? bottomY :
|
526
|
-
Math.round(baseY - visualHeight * Math.min(baseFrameDurationMs / frame.duration, 1)) - offset;
|
527
|
-
ctx.lineTo(x, y + tickDepth);
|
528
|
-
ctx.lineTo(x, y);
|
529
|
-
}
|
530
|
-
const lastFrame = frames[frames.length - 1];
|
531
|
-
if (lastFrame) {
|
532
|
-
x = Math.round((lastFrame.startTime + lastFrame.duration - timeOffset) * scale) + offset;
|
533
|
-
}
|
534
|
-
ctx.lineTo(x, y);
|
535
|
-
ctx.lineTo(x, bottomY);
|
536
|
-
ctx.fillStyle = 'hsl(110, 50%, 88%)';
|
537
|
-
ctx.strokeStyle = 'hsl(110, 50%, 60%)';
|
538
|
-
ctx.lineWidth = lineWidth;
|
539
|
-
ctx.fill();
|
540
|
-
ctx.stroke();
|
541
|
-
}
|
542
|
-
}
|
543
|
-
|
544
484
|
export class TimelineEventOverviewMemory extends TimelineEventOverview {
|
545
485
|
private heapSizeLabel: HTMLElement;
|
546
486
|
constructor() {
|