chrome-devtools-frontend 1.0.964938 → 1.0.966659
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 +5 -5
- package/front_end/core/common/ResolverBase.ts +2 -2
- package/front_end/core/i18n/locales/af.json +55 -22
- package/front_end/core/i18n/locales/am.json +55 -22
- package/front_end/core/i18n/locales/ar.json +55 -22
- package/front_end/core/i18n/locales/as.json +55 -22
- package/front_end/core/i18n/locales/az.json +55 -22
- package/front_end/core/i18n/locales/be.json +55 -22
- package/front_end/core/i18n/locales/bg.json +55 -22
- package/front_end/core/i18n/locales/bn.json +33 -0
- package/front_end/core/i18n/locales/bs.json +53 -20
- package/front_end/core/i18n/locales/ca.json +55 -22
- package/front_end/core/i18n/locales/cs.json +54 -21
- package/front_end/core/i18n/locales/cy.json +55 -22
- package/front_end/core/i18n/locales/da.json +54 -21
- package/front_end/core/i18n/locales/de.json +55 -22
- package/front_end/core/i18n/locales/el.json +55 -22
- package/front_end/core/i18n/locales/en-GB.json +33 -0
- package/front_end/core/i18n/locales/es-419.json +55 -22
- package/front_end/core/i18n/locales/es.json +55 -22
- package/front_end/core/i18n/locales/et.json +55 -22
- package/front_end/core/i18n/locales/eu.json +33 -0
- package/front_end/core/i18n/locales/fa.json +56 -23
- package/front_end/core/i18n/locales/fi.json +55 -22
- package/front_end/core/i18n/locales/fil.json +55 -22
- package/front_end/core/i18n/locales/fr-CA.json +55 -22
- package/front_end/core/i18n/locales/fr.json +55 -22
- package/front_end/core/i18n/locales/gl.json +55 -22
- package/front_end/core/i18n/locales/gu.json +33 -0
- package/front_end/core/i18n/locales/he.json +55 -22
- package/front_end/core/i18n/locales/hi.json +33 -0
- package/front_end/core/i18n/locales/hr.json +33 -0
- package/front_end/core/i18n/locales/hu.json +55 -22
- package/front_end/core/i18n/locales/hy.json +55 -22
- package/front_end/core/i18n/locales/id.json +55 -22
- package/front_end/core/i18n/locales/is.json +55 -22
- package/front_end/core/i18n/locales/it.json +55 -22
- package/front_end/core/i18n/locales/ja.json +63 -30
- package/front_end/core/i18n/locales/ka.json +55 -22
- package/front_end/core/i18n/locales/kk.json +55 -22
- package/front_end/core/i18n/locales/km.json +55 -22
- package/front_end/core/i18n/locales/kn.json +55 -22
- package/front_end/core/i18n/locales/ko.json +55 -22
- package/front_end/core/i18n/locales/ky.json +55 -22
- package/front_end/core/i18n/locales/lo.json +55 -22
- package/front_end/core/i18n/locales/lt.json +55 -22
- package/front_end/core/i18n/locales/lv.json +55 -22
- package/front_end/core/i18n/locales/mk.json +55 -22
- package/front_end/core/i18n/locales/ml.json +33 -0
- package/front_end/core/i18n/locales/mn.json +33 -0
- package/front_end/core/i18n/locales/mr.json +54 -21
- package/front_end/core/i18n/locales/ms.json +55 -22
- package/front_end/core/i18n/locales/my.json +55 -22
- package/front_end/core/i18n/locales/ne.json +54 -21
- package/front_end/core/i18n/locales/nl.json +55 -22
- package/front_end/core/i18n/locales/no.json +55 -22
- package/front_end/core/i18n/locales/or.json +55 -22
- package/front_end/core/i18n/locales/pa.json +55 -22
- package/front_end/core/i18n/locales/pl.json +33 -0
- package/front_end/core/i18n/locales/pt-PT.json +55 -22
- package/front_end/core/i18n/locales/pt.json +55 -22
- package/front_end/core/i18n/locales/ro.json +33 -0
- package/front_end/core/i18n/locales/ru.json +55 -22
- package/front_end/core/i18n/locales/si.json +55 -22
- package/front_end/core/i18n/locales/sk.json +55 -22
- package/front_end/core/i18n/locales/sl.json +55 -22
- package/front_end/core/i18n/locales/sq.json +55 -22
- package/front_end/core/i18n/locales/sr-Latn.json +55 -22
- package/front_end/core/i18n/locales/sr.json +55 -22
- package/front_end/core/i18n/locales/sv.json +55 -22
- package/front_end/core/i18n/locales/sw.json +55 -22
- package/front_end/core/i18n/locales/ta.json +55 -22
- package/front_end/core/i18n/locales/te.json +42 -9
- package/front_end/core/i18n/locales/th.json +33 -0
- package/front_end/core/i18n/locales/tr.json +55 -22
- package/front_end/core/i18n/locales/uk.json +55 -22
- package/front_end/core/i18n/locales/ur.json +55 -22
- package/front_end/core/i18n/locales/uz.json +55 -22
- package/front_end/core/i18n/locales/vi.json +54 -21
- package/front_end/core/i18n/locales/zh-HK.json +55 -22
- package/front_end/core/i18n/locales/zh-TW.json +54 -21
- package/front_end/core/i18n/locales/zh.json +55 -22
- package/front_end/core/i18n/locales/zu.json +55 -22
- package/front_end/core/protocol_client/InspectorBackend.ts +8 -0
- package/front_end/core/sdk/CSSProperty.ts +8 -8
- package/front_end/core/sdk/NetworkManager.ts +58 -70
- package/front_end/core/sdk/RemoteObject.ts +1 -1
- package/front_end/core/sdk/Resource.ts +5 -2
- package/front_end/core/sdk/RuntimeModel.ts +10 -0
- package/front_end/devtools_compatibility.js +19 -0
- package/front_end/entrypoints/formatter_worker/formatter_worker.ts +4 -4
- package/front_end/generated/InspectorBackendCommands.js +27 -2
- package/front_end/generated/protocol.ts +61 -0
- package/front_end/legacy_test_runner/bindings_test_runner/PersistenceTestRunner.js +2 -2
- package/front_end/legacy_test_runner/console_test_runner/console_test_runner.js +9 -3
- package/front_end/legacy_test_runner/heap_profiler_test_runner/heap_profiler_test_runner.js +1 -2
- package/front_end/legacy_test_runner/sources_test_runner/DebuggerTestRunner.js +5 -5
- package/front_end/models/bindings/ContentProviderBasedProject.ts +2 -3
- package/front_end/models/extensions/ExtensionServer.ts +7 -1
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +1 -1
- package/front_end/models/persistence/IsolatedFileSystem.ts +2 -2
- package/front_end/models/persistence/NetworkPersistenceManager.ts +7 -4
- package/front_end/models/workspace/WorkspaceImpl.ts +62 -37
- package/front_end/panels/console/ConsoleViewMessage.ts +33 -6
- package/front_end/panels/console/ErrorStackParser.ts +34 -0
- package/front_end/panels/emulation/DeviceModeView.ts +6 -2
- package/front_end/panels/event_listeners/EventListenersUtils.ts +3 -2
- package/front_end/panels/event_listeners/EventListenersView.ts +3 -3
- package/front_end/panels/lighthouse/lighthouse.ts +1 -1
- package/front_end/panels/sources/DebuggerPausedMessage.ts +2 -2
- package/front_end/panels/sources/SourcesPanel.ts +7 -10
- package/front_end/panels/sources/UISourceCodeFrame.ts +4 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +1 -2
- package/front_end/panels/sources/debuggerPausedMessage.css +5 -1
- package/front_end/third_party/codemirror/README.chromium +5 -0
- package/front_end/third_party/codemirror/codemirror-tsconfig.json +4 -4
- package/front_end/third_party/codemirror/package/addon/runmode/{runmode-standalone.js → runmode-standalone.mjs} +0 -0
- package/front_end/third_party/codemirror/package/addon/runmode/{runmode-standalone.d.ts → runmode-standalone.mjs.d.ts} +0 -0
- package/front_end/third_party/codemirror/package/mode/css/{css.js → css.mjs} +0 -0
- package/front_end/third_party/codemirror/package/mode/css/{css.d.ts → css.mjs.d.ts} +0 -0
- package/front_end/third_party/codemirror/package/mode/javascript/{javascript.js → javascript.mjs} +0 -0
- package/front_end/third_party/codemirror/package/mode/javascript/{javascript.d.ts → javascript.mjs.d.ts} +0 -0
- package/front_end/third_party/codemirror/package/mode/xml/{xml.js → xml.mjs} +0 -0
- package/front_end/third_party/codemirror/package/mode/xml/{xml.d.ts → xml.mjs.d.ts} +0 -0
- package/front_end/third_party/lighthouse/README.chromium +0 -1
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +954 -885
- package/front_end/third_party/lighthouse/lighthouse-tsconfig.json +1 -1
- package/front_end/third_party/lighthouse/locales/ar-XB.json +40 -4
- package/front_end/third_party/lighthouse/locales/ar.json +59 -23
- package/front_end/third_party/lighthouse/locales/bg.json +40 -4
- package/front_end/third_party/lighthouse/locales/ca.json +45 -9
- package/front_end/third_party/lighthouse/locales/cs.json +39 -3
- package/front_end/third_party/lighthouse/locales/da.json +43 -7
- package/front_end/third_party/lighthouse/locales/de.json +42 -6
- package/front_end/third_party/lighthouse/locales/el.json +59 -23
- package/front_end/third_party/lighthouse/locales/en-GB.json +43 -7
- package/front_end/third_party/lighthouse/locales/en-US.json +48 -6
- package/front_end/third_party/lighthouse/locales/en-XA.json +40 -4
- package/front_end/third_party/lighthouse/locales/en-XL.json +48 -6
- package/front_end/third_party/lighthouse/locales/es-419.json +39 -3
- package/front_end/third_party/lighthouse/locales/es.json +46 -10
- package/front_end/third_party/lighthouse/locales/fi.json +57 -21
- package/front_end/third_party/lighthouse/locales/fil.json +40 -4
- package/front_end/third_party/lighthouse/locales/fr.json +45 -9
- package/front_end/third_party/lighthouse/locales/he.json +41 -5
- package/front_end/third_party/lighthouse/locales/hi.json +59 -23
- package/front_end/third_party/lighthouse/locales/hr.json +57 -21
- package/front_end/third_party/lighthouse/locales/hu.json +39 -3
- package/front_end/third_party/lighthouse/locales/id.json +40 -4
- package/front_end/third_party/lighthouse/locales/it.json +40 -4
- package/front_end/third_party/lighthouse/locales/ja.json +39 -3
- package/front_end/third_party/lighthouse/locales/ko.json +40 -4
- package/front_end/third_party/lighthouse/locales/lt.json +40 -4
- package/front_end/third_party/lighthouse/locales/lv.json +56 -20
- package/front_end/third_party/lighthouse/locales/nl.json +40 -4
- package/front_end/third_party/lighthouse/locales/no.json +56 -20
- package/front_end/third_party/lighthouse/locales/pl.json +56 -20
- package/front_end/third_party/lighthouse/locales/pt-PT.json +57 -21
- package/front_end/third_party/lighthouse/locales/pt.json +41 -5
- package/front_end/third_party/lighthouse/locales/ro.json +39 -3
- package/front_end/third_party/lighthouse/locales/ru.json +40 -4
- package/front_end/third_party/lighthouse/locales/sk.json +39 -3
- package/front_end/third_party/lighthouse/locales/sl.json +39 -3
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +40 -4
- package/front_end/third_party/lighthouse/locales/sr.json +40 -4
- package/front_end/third_party/lighthouse/locales/sv.json +39 -3
- package/front_end/third_party/lighthouse/locales/ta.json +47 -11
- package/front_end/third_party/lighthouse/locales/te.json +61 -25
- package/front_end/third_party/lighthouse/locales/th.json +39 -3
- package/front_end/third_party/lighthouse/locales/tr.json +40 -4
- package/front_end/third_party/lighthouse/locales/uk.json +40 -4
- package/front_end/third_party/lighthouse/locales/vi.json +63 -27
- package/front_end/third_party/lighthouse/locales/zh-HK.json +40 -4
- package/front_end/third_party/lighthouse/locales/zh-TW.json +45 -9
- package/front_end/third_party/lighthouse/locales/zh.json +41 -5
- package/front_end/third_party/lighthouse/report/bundle.d.ts +1 -0
- package/front_end/third_party/lighthouse/report/bundle.js +23 -11
- package/front_end/third_party/lighthouse/report-assets/{report-generator.js → report-generator.mjs} +1 -1
- package/front_end/third_party/lighthouse/report-assets/{report-generator.d.ts → report-generator.mjs.d.ts} +0 -0
- package/front_end/third_party/puppeteer/puppeteer.ts +1 -2
- package/front_end/ui/components/docs/tree_outline/custom-renderers.ts +3 -3
- package/front_end/ui/legacy/Icon.ts +2 -2
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +4 -4
- package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +2 -2
- package/front_end/ui/legacy/themeColors.css +1 -1
- package/package.json +1 -1
- package/scripts/build/devtools_plugin.js +11 -0
- package/scripts/build/esbuild.js +62 -0
- package/scripts/build/ninja/bundle.gni +77 -32
- package/scripts/build/ninja/minify-json-files.js +19 -0
- package/scripts/build/ninja/minify_json.gni +28 -0
- package/scripts/javascript_natives/index.js +9 -6
- package/scripts/javascript_natives/package.json +4 -4
@@ -282,6 +282,27 @@ export function registerCommands(inspectorBackend) {
|
|
282
282
|
inspectorBackend.registerEnum(
|
283
283
|
'Audits.ClientHintIssueReason',
|
284
284
|
{MetaTagAllowListInvalidOrigin: 'MetaTagAllowListInvalidOrigin', MetaTagModifiedHTML: 'MetaTagModifiedHTML'});
|
285
|
+
inspectorBackend.registerEnum('Audits.FederatedAuthRequestIssueReason', {
|
286
|
+
ApprovalDeclined: 'ApprovalDeclined',
|
287
|
+
TooManyRequests: 'TooManyRequests',
|
288
|
+
WellKnownHttpNotFound: 'WellKnownHttpNotFound',
|
289
|
+
WellKnownNoResponse: 'WellKnownNoResponse',
|
290
|
+
WellKnownInvalidResponse: 'WellKnownInvalidResponse',
|
291
|
+
ClientIdMetadataHttpNotFound: 'ClientIdMetadataHttpNotFound',
|
292
|
+
ClientIdMetadataNoResponse: 'ClientIdMetadataNoResponse',
|
293
|
+
ClientIdMetadataInvalidResponse: 'ClientIdMetadataInvalidResponse',
|
294
|
+
ErrorFetchingSignin: 'ErrorFetchingSignin',
|
295
|
+
InvalidSigninResponse: 'InvalidSigninResponse',
|
296
|
+
AccountsHttpNotFound: 'AccountsHttpNotFound',
|
297
|
+
AccountsNoResponse: 'AccountsNoResponse',
|
298
|
+
AccountsInvalidResponse: 'AccountsInvalidResponse',
|
299
|
+
IdTokenHttpNotFound: 'IdTokenHttpNotFound',
|
300
|
+
IdTokenNoResponse: 'IdTokenNoResponse',
|
301
|
+
IdTokenInvalidResponse: 'IdTokenInvalidResponse',
|
302
|
+
IdTokenInvalidRequest: 'IdTokenInvalidRequest',
|
303
|
+
ErrorIdToken: 'ErrorIdToken',
|
304
|
+
Canceled: 'Canceled'
|
305
|
+
});
|
285
306
|
inspectorBackend.registerEnum('Audits.InspectorIssueCode', {
|
286
307
|
SameSiteCookieIssue: 'SameSiteCookieIssue',
|
287
308
|
MixedContentIssue: 'MixedContentIssue',
|
@@ -297,7 +318,8 @@ export function registerCommands(inspectorBackend) {
|
|
297
318
|
NavigatorUserAgentIssue: 'NavigatorUserAgentIssue',
|
298
319
|
GenericIssue: 'GenericIssue',
|
299
320
|
DeprecationIssue: 'DeprecationIssue',
|
300
|
-
ClientHintIssue: 'ClientHintIssue'
|
321
|
+
ClientHintIssue: 'ClientHintIssue',
|
322
|
+
FederatedAuthRequestIssue: 'FederatedAuthRequestIssue'
|
301
323
|
});
|
302
324
|
inspectorBackend.registerEvent('Audits.issueAdded', ['issue']);
|
303
325
|
inspectorBackend.registerEnum('Audits.GetEncodedResponseRequestEncoding', {Webp: 'webp', Jpeg: 'jpeg', Png: 'png'});
|
@@ -1647,7 +1669,8 @@ export function registerCommands(inspectorBackend) {
|
|
1647
1669
|
SameOrigin: 'SameOrigin',
|
1648
1670
|
SameOriginAllowPopups: 'SameOriginAllowPopups',
|
1649
1671
|
UnsafeNone: 'UnsafeNone',
|
1650
|
-
SameOriginPlusCoep: 'SameOriginPlusCoep'
|
1672
|
+
SameOriginPlusCoep: 'SameOriginPlusCoep',
|
1673
|
+
SameOriginAllowPopupsPlusCoep: 'SameOriginAllowPopupsPlusCoep'
|
1651
1674
|
});
|
1652
1675
|
inspectorBackend.registerEnum(
|
1653
1676
|
'Network.CrossOriginEmbedderPolicyValue',
|
@@ -2001,10 +2024,12 @@ export function registerCommands(inspectorBackend) {
|
|
2001
2024
|
ChUaPlatform: 'ch-ua-platform',
|
2002
2025
|
ChUaModel: 'ch-ua-model',
|
2003
2026
|
ChUaMobile: 'ch-ua-mobile',
|
2027
|
+
ChUaFull: 'ch-ua-full',
|
2004
2028
|
ChUaFullVersion: 'ch-ua-full-version',
|
2005
2029
|
ChUaFullVersionList: 'ch-ua-full-version-list',
|
2006
2030
|
ChUaPlatformVersion: 'ch-ua-platform-version',
|
2007
2031
|
ChUaReduced: 'ch-ua-reduced',
|
2032
|
+
ChUaWow64: 'ch-ua-wow64',
|
2008
2033
|
ChViewportHeight: 'ch-viewport-height',
|
2009
2034
|
ChViewportWidth: 'ch-viewport-width',
|
2010
2035
|
ChWidth: 'ch-width',
|
@@ -1052,6 +1052,38 @@ export namespace Audits {
|
|
1052
1052
|
MetaTagModifiedHTML = 'MetaTagModifiedHTML',
|
1053
1053
|
}
|
1054
1054
|
|
1055
|
+
export interface FederatedAuthRequestIssueDetails {
|
1056
|
+
federatedAuthRequestIssueReason: FederatedAuthRequestIssueReason;
|
1057
|
+
}
|
1058
|
+
|
1059
|
+
/**
|
1060
|
+
* Represents the failure reason when a federated authentication reason fails.
|
1061
|
+
* Should be updated alongside RequestIdTokenStatus in
|
1062
|
+
* third_party/blink/public/mojom/webid/federated_auth_request.mojom to include
|
1063
|
+
* all cases except for success.
|
1064
|
+
*/
|
1065
|
+
export const enum FederatedAuthRequestIssueReason {
|
1066
|
+
ApprovalDeclined = 'ApprovalDeclined',
|
1067
|
+
TooManyRequests = 'TooManyRequests',
|
1068
|
+
WellKnownHttpNotFound = 'WellKnownHttpNotFound',
|
1069
|
+
WellKnownNoResponse = 'WellKnownNoResponse',
|
1070
|
+
WellKnownInvalidResponse = 'WellKnownInvalidResponse',
|
1071
|
+
ClientIdMetadataHttpNotFound = 'ClientIdMetadataHttpNotFound',
|
1072
|
+
ClientIdMetadataNoResponse = 'ClientIdMetadataNoResponse',
|
1073
|
+
ClientIdMetadataInvalidResponse = 'ClientIdMetadataInvalidResponse',
|
1074
|
+
ErrorFetchingSignin = 'ErrorFetchingSignin',
|
1075
|
+
InvalidSigninResponse = 'InvalidSigninResponse',
|
1076
|
+
AccountsHttpNotFound = 'AccountsHttpNotFound',
|
1077
|
+
AccountsNoResponse = 'AccountsNoResponse',
|
1078
|
+
AccountsInvalidResponse = 'AccountsInvalidResponse',
|
1079
|
+
IdTokenHttpNotFound = 'IdTokenHttpNotFound',
|
1080
|
+
IdTokenNoResponse = 'IdTokenNoResponse',
|
1081
|
+
IdTokenInvalidResponse = 'IdTokenInvalidResponse',
|
1082
|
+
IdTokenInvalidRequest = 'IdTokenInvalidRequest',
|
1083
|
+
ErrorIdToken = 'ErrorIdToken',
|
1084
|
+
Canceled = 'Canceled',
|
1085
|
+
}
|
1086
|
+
|
1055
1087
|
/**
|
1056
1088
|
* This issue tracks client hints related issues. It's used to deprecate old
|
1057
1089
|
* features, encourage the use of new ones, and provide general guidance.
|
@@ -1082,6 +1114,7 @@ export namespace Audits {
|
|
1082
1114
|
GenericIssue = 'GenericIssue',
|
1083
1115
|
DeprecationIssue = 'DeprecationIssue',
|
1084
1116
|
ClientHintIssue = 'ClientHintIssue',
|
1117
|
+
FederatedAuthRequestIssue = 'FederatedAuthRequestIssue',
|
1085
1118
|
}
|
1086
1119
|
|
1087
1120
|
/**
|
@@ -1105,6 +1138,7 @@ export namespace Audits {
|
|
1105
1138
|
genericIssueDetails?: GenericIssueDetails;
|
1106
1139
|
deprecationIssueDetails?: DeprecationIssueDetails;
|
1107
1140
|
clientHintIssueDetails?: ClientHintIssueDetails;
|
1141
|
+
federatedAuthRequestIssueDetails?: FederatedAuthRequestIssueDetails;
|
1108
1142
|
}
|
1109
1143
|
|
1110
1144
|
/**
|
@@ -1885,6 +1919,11 @@ export namespace CSS {
|
|
1885
1919
|
* The array enumerates container queries starting with the innermost one, going outwards.
|
1886
1920
|
*/
|
1887
1921
|
containerQueries?: CSSContainerQuery[];
|
1922
|
+
/**
|
1923
|
+
* @supports CSS at-rule array.
|
1924
|
+
* The array enumerates @supports at-rules starting with the innermost one, going outwards.
|
1925
|
+
*/
|
1926
|
+
supports?: CSSSupports[];
|
1888
1927
|
}
|
1889
1928
|
|
1890
1929
|
/**
|
@@ -2127,6 +2166,25 @@ export namespace CSS {
|
|
2127
2166
|
name?: string;
|
2128
2167
|
}
|
2129
2168
|
|
2169
|
+
/**
|
2170
|
+
* CSS Supports at-rule descriptor.
|
2171
|
+
*/
|
2172
|
+
export interface CSSSupports {
|
2173
|
+
/**
|
2174
|
+
* Supports rule text.
|
2175
|
+
*/
|
2176
|
+
text: string;
|
2177
|
+
/**
|
2178
|
+
* The associated rule header range in the enclosing stylesheet (if
|
2179
|
+
* available).
|
2180
|
+
*/
|
2181
|
+
range?: SourceRange;
|
2182
|
+
/**
|
2183
|
+
* Identifier of the stylesheet containing this object (if exists).
|
2184
|
+
*/
|
2185
|
+
styleSheetId?: StyleSheetId;
|
2186
|
+
}
|
2187
|
+
|
2130
2188
|
/**
|
2131
2189
|
* Information about amount of glyphs that were rendered with given font.
|
2132
2190
|
*/
|
@@ -7958,6 +8016,7 @@ export namespace Network {
|
|
7958
8016
|
SameOriginAllowPopups = 'SameOriginAllowPopups',
|
7959
8017
|
UnsafeNone = 'UnsafeNone',
|
7960
8018
|
SameOriginPlusCoep = 'SameOriginPlusCoep',
|
8019
|
+
SameOriginAllowPopupsPlusCoep = 'SameOriginAllowPopupsPlusCoep',
|
7961
8020
|
}
|
7962
8021
|
|
7963
8022
|
export interface CrossOriginOpenerPolicyStatus {
|
@@ -9984,10 +10043,12 @@ export namespace Page {
|
|
9984
10043
|
ChUaPlatform = 'ch-ua-platform',
|
9985
10044
|
ChUaModel = 'ch-ua-model',
|
9986
10045
|
ChUaMobile = 'ch-ua-mobile',
|
10046
|
+
ChUaFull = 'ch-ua-full',
|
9987
10047
|
ChUaFullVersion = 'ch-ua-full-version',
|
9988
10048
|
ChUaFullVersionList = 'ch-ua-full-version-list',
|
9989
10049
|
ChUaPlatformVersion = 'ch-ua-platform-version',
|
9990
10050
|
ChUaReduced = 'ch-ua-reduced',
|
10051
|
+
ChUaWow64 = 'ch-ua-wow64',
|
9991
10052
|
ChViewportHeight = 'ch-viewport-height',
|
9992
10053
|
ChViewportWidth = 'ch-viewport-width',
|
9993
10054
|
ChWidth = 'ch-width',
|
@@ -23,7 +23,7 @@ Persistence.AutomappingStatus.prototype.toString = function() {
|
|
23
23
|
return lines.join('\n');
|
24
24
|
};
|
25
25
|
|
26
|
-
BindingsTestRunner.waitForBinding = function(fileName) {
|
26
|
+
BindingsTestRunner.waitForBinding = async function(fileName) {
|
27
27
|
const uiSourceCodes = self.Workspace.workspace.uiSourceCodes();
|
28
28
|
|
29
29
|
for (const uiSourceCode of uiSourceCodes) {
|
@@ -34,7 +34,7 @@ BindingsTestRunner.waitForBinding = function(fileName) {
|
|
34
34
|
}
|
35
35
|
|
36
36
|
if (uiSourceCode.name() === fileName) {
|
37
|
-
return
|
37
|
+
return binding;
|
38
38
|
}
|
39
39
|
}
|
40
40
|
|
@@ -50,6 +50,7 @@ ConsoleTestRunner.dumpConsoleMessagesIntoArray = async function(printOriginating
|
|
50
50
|
const element = uiMessage.element();
|
51
51
|
// Retrieving the message element triggered rendering, now wait for
|
52
52
|
// the live location within to be resolved initially.
|
53
|
+
await uiMessage.formatErrorStackPromiseForTest();
|
53
54
|
await TestRunner.waitForPendingLiveLocationUpdates();
|
54
55
|
|
55
56
|
let classNames;
|
@@ -220,9 +221,14 @@ ConsoleTestRunner.evaluateInConsole = function(code, callback, dontForceMainCont
|
|
220
221
|
const element = commandResult.toMessageElement();
|
221
222
|
// Only call the callback once the live location within the
|
222
223
|
// message element is resolved initially.
|
223
|
-
|
224
|
-
|
225
|
-
|
224
|
+
Promise
|
225
|
+
.all([
|
226
|
+
commandResult.formatErrorStackPromiseForTest(),
|
227
|
+
TestRunner.waitForPendingLiveLocationUpdates(),
|
228
|
+
])
|
229
|
+
.then(() => {
|
230
|
+
callback(element.deepTextContent());
|
231
|
+
});
|
226
232
|
});
|
227
233
|
};
|
228
234
|
|
@@ -624,14 +624,13 @@ HeapProfilerTestRunner.takeAndOpenSnapshot = async function(generator, callback)
|
|
624
624
|
const snapshot = generator();
|
625
625
|
const profileType = Profiler.ProfileTypeRegistry.instance.heapSnapshotProfileType;
|
626
626
|
|
627
|
-
function pushGeneratedSnapshot(reportProgress) {
|
627
|
+
async function pushGeneratedSnapshot(reportProgress) {
|
628
628
|
if (reportProgress) {
|
629
629
|
profileType.reportHeapSnapshotProgress({data: {done: 50, total: 100, finished: false}});
|
630
630
|
profileType.reportHeapSnapshotProgress({data: {done: 100, total: 100, finished: true}});
|
631
631
|
}
|
632
632
|
snapshot.snapshot.typeId = 'HEAP';
|
633
633
|
profileType.addHeapSnapshotChunk({data: JSON.stringify(snapshot)});
|
634
|
-
return Promise.resolve();
|
635
634
|
}
|
636
635
|
|
637
636
|
HeapProfilerTestRunner.takeAndOpenSnapshotCallback = callback;
|
@@ -198,31 +198,31 @@ SourcesTestRunner.waitUntilPausedAndDumpStackAndResume = function(callback, opti
|
|
198
198
|
};
|
199
199
|
|
200
200
|
SourcesTestRunner.stepOver = function() {
|
201
|
-
|
201
|
+
queueMicrotask(function() {
|
202
202
|
UI.panels.sources.stepOver();
|
203
203
|
});
|
204
204
|
};
|
205
205
|
|
206
206
|
SourcesTestRunner.stepInto = function() {
|
207
|
-
|
207
|
+
queueMicrotask(function() {
|
208
208
|
UI.panels.sources.stepInto();
|
209
209
|
});
|
210
210
|
};
|
211
211
|
|
212
212
|
SourcesTestRunner.stepIntoAsync = function() {
|
213
|
-
|
213
|
+
queueMicrotask(function() {
|
214
214
|
UI.panels.sources.stepIntoAsync();
|
215
215
|
});
|
216
216
|
};
|
217
217
|
|
218
218
|
SourcesTestRunner.stepOut = function() {
|
219
|
-
|
219
|
+
queueMicrotask(function() {
|
220
220
|
UI.panels.sources.stepOut();
|
221
221
|
});
|
222
222
|
};
|
223
223
|
|
224
224
|
SourcesTestRunner.togglePause = function() {
|
225
|
-
|
225
|
+
queueMicrotask(function() {
|
226
226
|
UI.panels.sources.togglePause();
|
227
227
|
});
|
228
228
|
};
|
@@ -46,8 +46,7 @@ interface UISourceCodeData {
|
|
46
46
|
metadata: Workspace.UISourceCode.UISourceCodeMetadata|null;
|
47
47
|
}
|
48
48
|
|
49
|
-
export class ContentProviderBasedProject extends Workspace.Workspace.ProjectStore
|
50
|
-
Workspace.Workspace.Project {
|
49
|
+
export class ContentProviderBasedProject extends Workspace.Workspace.ProjectStore {
|
51
50
|
readonly #contentProviders: Map<string, TextUtils.ContentProvider.ContentProvider>;
|
52
51
|
readonly #isServiceProjectInternal: boolean;
|
53
52
|
readonly #uiSourceCodeToData: WeakMap<Workspace.UISourceCode.UISourceCode, UISourceCodeData>;
|
@@ -199,7 +198,7 @@ export class ContentProviderBasedProject extends Workspace.Workspace.ProjectStor
|
|
199
198
|
}
|
200
199
|
|
201
200
|
indexContent(progress: Common.Progress.Progress): void {
|
202
|
-
|
201
|
+
queueMicrotask(progress.done.bind(progress));
|
203
202
|
}
|
204
203
|
|
205
204
|
addUISourceCodeWithProvider(
|
@@ -57,7 +57,7 @@ const extensionOrigins: WeakMap<MessagePort, string> = new WeakMap();
|
|
57
57
|
|
58
58
|
declare global {
|
59
59
|
interface Window {
|
60
|
-
DevToolsAPI?: {getInspectedTabId?(): string|undefined};
|
60
|
+
DevToolsAPI?: {getInspectedTabId?(): string|undefined, getOriginsForbiddenForExtensions?(): string[]};
|
61
61
|
}
|
62
62
|
}
|
63
63
|
|
@@ -1102,6 +1102,12 @@ export class ExtensionServer extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
1102
1102
|
parsedURL.pathname.startsWith('/webstore')) {
|
1103
1103
|
return false;
|
1104
1104
|
}
|
1105
|
+
|
1106
|
+
if ((window.DevToolsAPI && window.DevToolsAPI.getOriginsForbiddenForExtensions &&
|
1107
|
+
window.DevToolsAPI.getOriginsForbiddenForExtensions() ||
|
1108
|
+
[]).includes(parsedURL.origin)) {
|
1109
|
+
return false;
|
1110
|
+
}
|
1105
1111
|
return true;
|
1106
1112
|
}
|
1107
1113
|
|
@@ -153,7 +153,7 @@ export class FileSystemWorkspaceBinding {
|
|
153
153
|
}
|
154
154
|
}
|
155
155
|
|
156
|
-
export class FileSystem extends Workspace.Workspace.ProjectStore
|
156
|
+
export class FileSystem extends Workspace.Workspace.ProjectStore {
|
157
157
|
readonly fileSystemInternal: PlatformFileSystem;
|
158
158
|
readonly fileSystemBaseURL: string;
|
159
159
|
private readonly fileSystemParentURL: string;
|
@@ -98,12 +98,12 @@ export class IsolatedFileSystem extends PlatformFileSystem {
|
|
98
98
|
this.fileLocks = new Map();
|
99
99
|
}
|
100
100
|
|
101
|
-
static create(
|
101
|
+
static async create(
|
102
102
|
manager: IsolatedFileSystemManager, path: string, embedderPath: string, type: string, name: string,
|
103
103
|
rootURL: string): Promise<IsolatedFileSystem|null> {
|
104
104
|
const domFileSystem = Host.InspectorFrontendHost.InspectorFrontendHostInstance.isolatedFileSystem(name, rootURL);
|
105
105
|
if (!domFileSystem) {
|
106
|
-
return
|
106
|
+
return null as IsolatedFileSystem | null;
|
107
107
|
}
|
108
108
|
|
109
109
|
const fileSystem = new IsolatedFileSystem(manager, path, embedderPath, domFileSystem, type);
|
@@ -383,8 +383,7 @@ export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrappe
|
|
383
383
|
|
384
384
|
return SDK.NetworkManager.MultitargetNetworkManager.instance().setInterceptionHandlerForPatterns(
|
385
385
|
Array.from(patterns).map(
|
386
|
-
pattern =>
|
387
|
-
({urlPattern: pattern, interceptionStage: Protocol.Network.InterceptionStage.HeadersReceived})),
|
386
|
+
pattern => ({urlPattern: pattern, requestStage: Protocol.Fetch.RequestStage.Response})),
|
388
387
|
this.interceptionHandlerBound);
|
389
388
|
}
|
390
389
|
}
|
@@ -467,8 +466,12 @@ export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrappe
|
|
467
466
|
|
468
467
|
let mimeType = '';
|
469
468
|
if (interceptedRequest.responseHeaders) {
|
470
|
-
const
|
471
|
-
|
469
|
+
for (const header of interceptedRequest.responseHeaders) {
|
470
|
+
if (header.name.toLowerCase() === 'content-type') {
|
471
|
+
mimeType = header.value;
|
472
|
+
break;
|
473
|
+
}
|
474
|
+
}
|
472
475
|
}
|
473
476
|
|
474
477
|
if (!mimeType) {
|
@@ -42,41 +42,36 @@ export interface ProjectSearchConfig {
|
|
42
42
|
filePathMatchesFileQuery(filePath: string): boolean;
|
43
43
|
}
|
44
44
|
|
45
|
-
export
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
45
|
+
export interface Project {
|
46
|
+
workspace(): WorkspaceImpl;
|
47
|
+
id(): string;
|
48
|
+
type(): projectTypes;
|
49
|
+
isServiceProject(): boolean;
|
50
|
+
displayName(): string;
|
51
|
+
requestMetadata(uiSourceCode: UISourceCode): Promise<UISourceCodeMetadata|null>;
|
52
|
+
requestFileContent(uiSourceCode: UISourceCode): Promise<TextUtils.ContentProvider.DeferredContent>;
|
53
|
+
canSetFileContent(): boolean;
|
54
|
+
setFileContent(uiSourceCode: UISourceCode, newContent: string, isBase64: boolean): Promise<void>;
|
55
|
+
fullDisplayName(uiSourceCode: UISourceCode): string;
|
56
|
+
mimeType(uiSourceCode: UISourceCode): string;
|
57
|
+
canRename(): boolean;
|
58
58
|
rename(
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
}
|
69
|
-
remove(): void {
|
70
|
-
}
|
71
|
-
abstract searchInFileContent(uiSourceCode: UISourceCode, query: string, caseSensitive: boolean, isRegex: boolean):
|
59
|
+
uiSourceCode: UISourceCode, newName: string,
|
60
|
+
callback: (arg0: boolean, arg1?: string, arg2?: string, arg3?: Common.ResourceType.ResourceType) => void): void;
|
61
|
+
excludeFolder(path: string): void;
|
62
|
+
canExcludeFolder(path: string): boolean;
|
63
|
+
createFile(path: string, name: string|null, content: string, isBase64?: boolean): Promise<UISourceCode|null>;
|
64
|
+
canCreateFile(): boolean;
|
65
|
+
deleteFile(uiSourceCode: UISourceCode): void;
|
66
|
+
remove(): void;
|
67
|
+
searchInFileContent(uiSourceCode: UISourceCode, query: string, caseSensitive: boolean, isRegex: boolean):
|
72
68
|
Promise<TextUtils.ContentProvider.SearchMatch[]>;
|
73
|
-
|
69
|
+
findFilesMatchingSearchRequest(
|
74
70
|
searchConfig: ProjectSearchConfig, filesMathingFileQuery: string[],
|
75
71
|
progress: Common.Progress.Progress): Promise<string[]>;
|
76
|
-
indexContent(
|
77
|
-
|
78
|
-
|
79
|
-
abstract uiSourceCodes(): UISourceCode[];
|
72
|
+
indexContent(progress: Common.Progress.Progress): void;
|
73
|
+
uiSourceCodeForURL(url: string): UISourceCode|null;
|
74
|
+
uiSourceCodes(): UISourceCode[];
|
80
75
|
}
|
81
76
|
|
82
77
|
// TODO(crbug.com/1167717): Make this a const enum again
|
@@ -90,7 +85,7 @@ export enum projectTypes {
|
|
90
85
|
Service = 'service',
|
91
86
|
}
|
92
87
|
|
93
|
-
export class ProjectStore {
|
88
|
+
export abstract class ProjectStore implements Project {
|
94
89
|
private readonly workspaceInternal: WorkspaceImpl;
|
95
90
|
private readonly idInternal: string;
|
96
91
|
private readonly typeInternal: projectTypes;
|
@@ -100,7 +95,6 @@ export class ProjectStore {
|
|
100
95
|
index: number,
|
101
96
|
}>;
|
102
97
|
private uiSourceCodesList: UISourceCode[];
|
103
|
-
private readonly project: Project;
|
104
98
|
|
105
99
|
constructor(workspace: WorkspaceImpl, id: string, type: projectTypes, displayName: string) {
|
106
100
|
this.workspaceInternal = workspace;
|
@@ -110,14 +104,13 @@ export class ProjectStore {
|
|
110
104
|
|
111
105
|
this.uiSourceCodesMap = new Map();
|
112
106
|
this.uiSourceCodesList = [];
|
113
|
-
this.project = (this as unknown as Project);
|
114
107
|
}
|
115
108
|
|
116
109
|
id(): string {
|
117
110
|
return this.idInternal;
|
118
111
|
}
|
119
112
|
|
120
|
-
type():
|
113
|
+
type(): projectTypes {
|
121
114
|
return this.typeInternal;
|
122
115
|
}
|
123
116
|
|
@@ -130,7 +123,7 @@ export class ProjectStore {
|
|
130
123
|
}
|
131
124
|
|
132
125
|
createUISourceCode(url: string, contentType: Common.ResourceType.ResourceType): UISourceCode {
|
133
|
-
return new UISourceCode(this
|
126
|
+
return new UISourceCode(this, url, contentType);
|
134
127
|
}
|
135
128
|
|
136
129
|
addUISourceCode(uiSourceCode: UISourceCode): boolean {
|
@@ -166,7 +159,7 @@ export class ProjectStore {
|
|
166
159
|
}
|
167
160
|
|
168
161
|
removeProject(): void {
|
169
|
-
this.workspaceInternal.removeProject(this
|
162
|
+
this.workspaceInternal.removeProject(this);
|
170
163
|
this.uiSourceCodesMap = new Map();
|
171
164
|
this.uiSourceCodesList = [];
|
172
165
|
}
|
@@ -190,6 +183,38 @@ export class ProjectStore {
|
|
190
183
|
this.uiSourceCodesMap.set(newPath, value);
|
191
184
|
this.uiSourceCodesMap.delete(oldPath);
|
192
185
|
}
|
186
|
+
|
187
|
+
// No-op implementation for a handfull of interface methods.
|
188
|
+
|
189
|
+
rename(
|
190
|
+
_uiSourceCode: UISourceCode, _newName: string,
|
191
|
+
_callback: (arg0: boolean, arg1?: string, arg2?: string, arg3?: Common.ResourceType.ResourceType) => void): void {
|
192
|
+
}
|
193
|
+
excludeFolder(_path: string): void {
|
194
|
+
}
|
195
|
+
deleteFile(_uiSourceCode: UISourceCode): void {
|
196
|
+
}
|
197
|
+
remove(): void {
|
198
|
+
}
|
199
|
+
indexContent(_progress: Common.Progress.Progress): void {
|
200
|
+
}
|
201
|
+
|
202
|
+
abstract isServiceProject(): boolean;
|
203
|
+
abstract requestMetadata(uiSourceCode: UISourceCode): Promise<UISourceCodeMetadata|null>;
|
204
|
+
abstract requestFileContent(uiSourceCode: UISourceCode): Promise<TextUtils.ContentProvider.DeferredContent>;
|
205
|
+
abstract canSetFileContent(): boolean;
|
206
|
+
abstract setFileContent(uiSourceCode: UISourceCode, newContent: string, isBase64: boolean): Promise<void>;
|
207
|
+
abstract fullDisplayName(uiSourceCode: UISourceCode): string;
|
208
|
+
abstract mimeType(uiSourceCode: UISourceCode): string;
|
209
|
+
abstract canRename(): boolean;
|
210
|
+
abstract canExcludeFolder(path: string): boolean;
|
211
|
+
abstract createFile(path: string, name: string|null, content: string, isBase64?: boolean): Promise<UISourceCode|null>;
|
212
|
+
abstract canCreateFile(): boolean;
|
213
|
+
abstract searchInFileContent(uiSourceCode: UISourceCode, query: string, caseSensitive: boolean, isRegex: boolean):
|
214
|
+
Promise<TextUtils.ContentProvider.SearchMatch[]>;
|
215
|
+
abstract findFilesMatchingSearchRequest(
|
216
|
+
searchConfig: ProjectSearchConfig, filesMathingFileQuery: string[],
|
217
|
+
progress: Common.Progress.Progress): Promise<string[]>;
|
193
218
|
}
|
194
219
|
|
195
220
|
let workspaceInstance: WorkspaceImpl|undefined;
|
@@ -56,7 +56,7 @@ import type {Chrome} from '../../../extension-api/ExtensionAPI.js'; // eslint-di
|
|
56
56
|
import {format} from './ConsoleFormat.js';
|
57
57
|
import type {ConsoleViewportElement} from './ConsoleViewport.js';
|
58
58
|
import consoleViewStyles from './consoleView.css.js';
|
59
|
-
import {parseSourcePositionsFromErrorStack} from './ErrorStackParser.js';
|
59
|
+
import {augmentErrorStackWithScriptIds, parseSourcePositionsFromErrorStack} from './ErrorStackParser.js';
|
60
60
|
|
61
61
|
const UIStrings = {
|
62
62
|
/**
|
@@ -236,6 +236,9 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
236
236
|
private requestResolver: Logs.RequestResolver.RequestResolver;
|
237
237
|
private issueResolver: IssuesManager.IssueResolver.IssueResolver;
|
238
238
|
|
239
|
+
/** Formatting Error#stack is asynchronous. Allow tests to wait for the result */
|
240
|
+
#formatErrorStackPromiseForTest = Promise.resolve();
|
241
|
+
|
239
242
|
constructor(
|
240
243
|
consoleMessage: SDK.ConsoleModel.ConsoleMessage, linkifier: Components.Linkifier.Linkifier,
|
241
244
|
requestResolver: Logs.RequestResolver.RequestResolver, issueResolver: IssuesManager.IssueResolver.IssueResolver,
|
@@ -307,6 +310,10 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
307
310
|
return this.message;
|
308
311
|
}
|
309
312
|
|
313
|
+
formatErrorStackPromiseForTest(): Promise<void> {
|
314
|
+
return this.#formatErrorStackPromiseForTest;
|
315
|
+
}
|
316
|
+
|
310
317
|
protected buildMessage(): HTMLElement {
|
311
318
|
let messageElement;
|
312
319
|
let messageText: Common.UIString.LocalizedString|string = this.message.messageText;
|
@@ -816,11 +823,28 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
816
823
|
|
817
824
|
private formatParameterAsError(output: SDK.RemoteObject.RemoteObject): HTMLElement {
|
818
825
|
const result = document.createElement('span');
|
819
|
-
const
|
820
|
-
|
826
|
+
const errorStack = output.description || '';
|
827
|
+
|
828
|
+
// Combine the ExceptionDetails for this error object with the parsed Error#stack.
|
829
|
+
// The Exceptiondetails include script IDs for stack frames, which allows more accurate
|
830
|
+
// linking.
|
831
|
+
this.#formatErrorStackPromiseForTest = this.retrieveExceptionDetails(output).then(exceptionDetails => {
|
832
|
+
const errorSpan = this.tryFormatAsError(errorStack, exceptionDetails);
|
833
|
+
result.appendChild(errorSpan ?? this.linkifyStringAsFragment(errorStack));
|
834
|
+
});
|
835
|
+
|
821
836
|
return result;
|
822
837
|
}
|
823
838
|
|
839
|
+
private async retrieveExceptionDetails(errorObject: SDK.RemoteObject.RemoteObject):
|
840
|
+
Promise<Protocol.Runtime.ExceptionDetails|undefined> {
|
841
|
+
const runtimeModel = this.message.runtimeModel();
|
842
|
+
if (runtimeModel && errorObject.objectId) {
|
843
|
+
return runtimeModel.getExceptionDetails(errorObject.objectId);
|
844
|
+
}
|
845
|
+
return undefined;
|
846
|
+
}
|
847
|
+
|
824
848
|
private formatAsArrayEntry(output: SDK.RemoteObject.RemoteObject): HTMLElement {
|
825
849
|
return this.previewFormatter.renderPropertyPreview(
|
826
850
|
output.type, output.subtype, output.className, output.description);
|
@@ -1422,7 +1446,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
1422
1446
|
return true;
|
1423
1447
|
}
|
1424
1448
|
|
1425
|
-
private tryFormatAsError(string: string): HTMLElement|null {
|
1449
|
+
private tryFormatAsError(string: string, exceptionDetails?: Protocol.Runtime.ExceptionDetails): HTMLElement|null {
|
1426
1450
|
const runtimeModel = this.message.runtimeModel();
|
1427
1451
|
if (!runtimeModel) {
|
1428
1452
|
return null;
|
@@ -1432,6 +1456,9 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
1432
1456
|
if (!linkInfos?.length) {
|
1433
1457
|
return null;
|
1434
1458
|
}
|
1459
|
+
if (exceptionDetails?.stackTrace) {
|
1460
|
+
augmentErrorStackWithScriptIds(linkInfos, exceptionDetails.stackTrace);
|
1461
|
+
}
|
1435
1462
|
|
1436
1463
|
const debuggerModel = runtimeModel.debuggerModel();
|
1437
1464
|
const formattedResult = document.createElement('span');
|
@@ -1447,8 +1474,8 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
1447
1474
|
const suffix = `${line.substring(link.positionRight)}${newline}`;
|
1448
1475
|
|
1449
1476
|
formattedLine.appendChild(this.linkifyStringAsFragment(prefix));
|
1450
|
-
const scriptLocationLink =
|
1451
|
-
|
1477
|
+
const scriptLocationLink = this.linkifier.linkifyScriptLocation(
|
1478
|
+
debuggerModel.target(), link.scriptId || null, link.url, link.lineNumber, {
|
1452
1479
|
columnNumber: link.columnNumber,
|
1453
1480
|
className: undefined,
|
1454
1481
|
tabStop: undefined,
|
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
6
6
|
import type * as SDK from '../../core/sdk/sdk.js';
|
7
|
+
import type * as Protocol from '../../generated/protocol.js';
|
7
8
|
|
8
9
|
export interface ParsedErrorFrame {
|
9
10
|
line: string;
|
@@ -11,6 +12,7 @@ export interface ParsedErrorFrame {
|
|
11
12
|
url: string,
|
12
13
|
lineNumber?: number,
|
13
14
|
columnNumber?: number, enclosedInBraces: boolean, positionLeft: number, positionRight: number,
|
15
|
+
scriptId?: Protocol.Runtime.ScriptId,
|
14
16
|
};
|
15
17
|
}
|
16
18
|
|
@@ -115,3 +117,35 @@ function parseOrScriptMatch(debuggerModel: SDK.DebuggerModel.DebuggerModel, url:
|
|
115
117
|
}
|
116
118
|
return null;
|
117
119
|
}
|
120
|
+
|
121
|
+
/**
|
122
|
+
* Error#stack output only contains script URLs. In some cases we are able to
|
123
|
+
* retrieve additional exception details from V8 that we can use to augment
|
124
|
+
* the parsed Error#stack with script IDs.
|
125
|
+
* This function sets the `scriptId` field in `ParsedErrorFrame` when it finds
|
126
|
+
* the corresponding info in `Protocol.Runtime.StackTrace`.
|
127
|
+
*/
|
128
|
+
export function augmentErrorStackWithScriptIds(
|
129
|
+
parsedFrames: ParsedErrorFrame[], protocolStackTrace: Protocol.Runtime.StackTrace): void {
|
130
|
+
// Note that the number of frames between the two stack traces can differ. The
|
131
|
+
// parsed Error#stack can contain Builtin frames which are not present in the protocol
|
132
|
+
// stack. This means its easier to always search the whole protocol stack for a matching
|
133
|
+
// frame rather then trying to detect the Builtin frames and skipping them.
|
134
|
+
for (const parsedFrame of parsedFrames) {
|
135
|
+
const protocolFrame = protocolStackTrace.callFrames.find(frame => framesMatch(parsedFrame, frame));
|
136
|
+
if (protocolFrame && parsedFrame.link) {
|
137
|
+
parsedFrame.link.scriptId = protocolFrame.scriptId;
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
|
142
|
+
/** Returns true iff both stack frames have the same url and line/column numbers. The function name is ignored */
|
143
|
+
function framesMatch(parsedFrame: ParsedErrorFrame, protocolFrame: Protocol.Runtime.CallFrame): boolean {
|
144
|
+
if (!parsedFrame.link) {
|
145
|
+
return false;
|
146
|
+
}
|
147
|
+
|
148
|
+
const {url, lineNumber, columnNumber} = parsedFrame.link;
|
149
|
+
return url === protocolFrame.url && lineNumber === protocolFrame.lineNumber &&
|
150
|
+
columnNumber === protocolFrame.columnNumber;
|
151
|
+
}
|