chrome-devtools-frontend 1.0.971727 → 1.0.973342

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.
Files changed (46) hide show
  1. package/config/gni/devtools_grd_files.gni +2 -1
  2. package/front_end/core/i18n/locales/en-US.json +24 -0
  3. package/front_end/core/i18n/locales/en-XL.json +24 -0
  4. package/front_end/core/sdk/NetworkManager.ts +15 -7
  5. package/front_end/core/sdk/NetworkRequest.ts +16 -14
  6. package/front_end/core/sdk/ResourceTreeModel.ts +8 -10
  7. package/front_end/core/sdk/SourceMap.ts +9 -9
  8. package/front_end/entrypoints/lighthouse_worker/{LighthouseService.ts → LighthouseWorkerService.ts} +69 -38
  9. package/front_end/entrypoints/lighthouse_worker/lighthouse_worker.ts +1 -1
  10. package/front_end/models/bindings/CSSWorkspaceBinding.ts +2 -16
  11. package/front_end/models/bindings/SASSSourceMapping.ts +4 -3
  12. package/front_end/models/har/HARFormat.ts +4 -2
  13. package/front_end/models/har/Importer.ts +0 -1
  14. package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +4 -4
  15. package/front_end/models/persistence/IsolatedFileSystem.ts +0 -1
  16. package/front_end/models/text_utils/StaticContentProvider.ts +5 -4
  17. package/front_end/models/workspace_diff/WorkspaceDiff.ts +20 -8
  18. package/front_end/panels/application/ServiceWorkerCacheViews.ts +2 -1
  19. package/front_end/panels/changes/ChangesView.ts +4 -4
  20. package/front_end/panels/elements/StylesSidebarPane.ts +27 -15
  21. package/front_end/panels/elements/components/LayoutPane.ts +1 -1
  22. package/front_end/panels/lighthouse/LighthouseController.ts +13 -2
  23. package/front_end/panels/lighthouse/LighthousePanel.ts +57 -8
  24. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +94 -30
  25. package/front_end/panels/lighthouse/LighthouseStartView.ts +6 -2
  26. package/front_end/panels/lighthouse/LighthouseStartViewFR.ts +61 -0
  27. package/front_end/panels/lighthouse/LighthouseTimespanView.ts +99 -0
  28. package/front_end/panels/sources/NavigatorView.ts +4 -4
  29. package/front_end/third_party/codemirror.next/bundle.ts +1 -1
  30. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  31. package/front_end/third_party/codemirror.next/chunk/json.js +2 -1
  32. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +28 -2
  33. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
  34. package/front_end/third_party/codemirror.next/package.json +10 -10
  35. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1047 -1158
  36. package/front_end/third_party/lighthouse/locales/en-US.json +7 -1
  37. package/front_end/third_party/lighthouse/locales/en-XL.json +7 -1
  38. package/front_end/third_party/lighthouse/report/bundle.d.ts +0 -3
  39. package/front_end/third_party/lighthouse/report/bundle.js +38 -24
  40. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
  41. package/front_end/ui/components/expandable_list/expandableList.css +1 -1
  42. package/front_end/ui/components/text_editor/config.ts +1 -0
  43. package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +7 -4
  44. package/front_end/ui/legacy/tabbedPane.css +1 -0
  45. package/package.json +1 -1
  46. package/scripts/hosted_mode/server.js +13 -0
@@ -17,7 +17,7 @@ div {
17
17
 
18
18
  .arrow-icon {
19
19
  display: inline-block;
20
- -webkit-mask-image: url("Images/treeoutlineTriangles.svg");
20
+ -webkit-mask-image: var(--image-file-treeoutlineTriangles);
21
21
  -webkit-mask-size: 32px 24px;
22
22
  -webkit-mask-position: 0 0;
23
23
  background-color: var(--color-text-primary);
@@ -224,6 +224,7 @@ export function baseConfiguration(text: string): CM.Extension {
224
224
  return [
225
225
  theme(),
226
226
  CM.highlightSpecialChars(),
227
+ CM.highlightSelectionMatches(),
227
228
  CM.history(),
228
229
  CM.drawSelection(),
229
230
  CM.EditorState.allowMultipleSelections.of(true),
@@ -3,10 +3,13 @@
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 TextUtils from '../../../../models/text_utils/text_utils.js';
7
8
 
8
9
  import {ResourceSourceFrame} from './ResourceSourceFrame.js';
9
10
 
11
+ // TODO(crbug.com/1253323): Casts to UrlString will be removed from this file when migration to branded types is complete.
12
+
10
13
  export class BinaryResourceViewFactory {
11
14
  private base64content: string;
12
15
  private readonly contentUrl: string;
@@ -67,8 +70,8 @@ export class BinaryResourceViewFactory {
67
70
  }
68
71
 
69
72
  createHexView(): ResourceSourceFrame {
70
- const hexViewerContentProvider =
71
- new TextUtils.StaticContentProvider.StaticContentProvider(this.contentUrl, this.resourceType, async () => {
73
+ const hexViewerContentProvider = new TextUtils.StaticContentProvider.StaticContentProvider(
74
+ this.contentUrl as Platform.DevToolsPath.UrlString, this.resourceType, async () => {
72
75
  const contentAsArray = await this.fetchContentAsArray();
73
76
  const content = BinaryResourceViewFactory.uint8ArrayToHexViewer(contentAsArray);
74
77
  return {content, isEncoded: false};
@@ -79,8 +82,8 @@ export class BinaryResourceViewFactory {
79
82
 
80
83
  createUtf8View(): ResourceSourceFrame {
81
84
  const utf8fn = this.utf8.bind(this);
82
- const utf8ContentProvider =
83
- new TextUtils.StaticContentProvider.StaticContentProvider(this.contentUrl, this.resourceType, utf8fn);
85
+ const utf8ContentProvider = new TextUtils.StaticContentProvider.StaticContentProvider(
86
+ this.contentUrl as Platform.DevToolsPath.UrlString, this.resourceType, utf8fn);
84
87
  return new ResourceSourceFrame(
85
88
  utf8ContentProvider, this.resourceType.canonicalMimeType(), {lineNumbers: true, lineWrapping: true});
86
89
  }
@@ -117,6 +117,7 @@
117
117
  height: 26px;
118
118
  line-height: 16px;
119
119
  white-space: nowrap;
120
+ cursor: default;
120
121
  display: flex;
121
122
  align-items: center;
122
123
  color: var(--color-text-secondary);
package/package.json CHANGED
@@ -54,5 +54,5 @@
54
54
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
55
55
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
56
56
  },
57
- "version": "1.0.971727"
57
+ "version": "1.0.973342"
58
58
  }
@@ -177,6 +177,19 @@ async function requestHandler(request, response) {
177
177
  // This is fine to do given that test invocations run against fresh Chrome profiles.
178
178
  headers.set('Cache-Control', 'max-age=3600');
179
179
  }
180
+ if (!headers.get('Access-Control-Allow-Origin')) {
181
+ // The DevTools frontend in hosted-mode uses regular fetch to get source maps etc.
182
+ // Disable CORS only for the DevTools frontend, not for resource/target pages.
183
+ // Since Chrome will cache resources, we have to indicate that CORS can still vary
184
+ // based on the origin that made the request. E.g. the target page loads a script first
185
+ // but then DevTools also wants to load it. In the former, we disallow cross-origin requests by default,
186
+ // while for the latter we allow it.
187
+ const requestedByDevTools = request.headers.origin?.includes('devtools-frontend.test');
188
+ if (requestedByDevTools) {
189
+ headers.set('Access-Control-Allow-Origin', request.headers.origin);
190
+ }
191
+ headers.set('Vary', 'Origin');
192
+ }
180
193
  headers.forEach((value, header) => {
181
194
  response.setHeader(header, value);
182
195
  });