chrome-devtools-frontend 1.0.1716465 → 1.0.1717196

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 (109) hide show
  1. package/.agents/skills/devtools-model-management/SKILL.md +4 -4
  2. package/.agents/skills/devtools-setting-migration/SKILL.md +1 -1
  3. package/.agents/skills/devtools-ux-writing-refactor/SKILL.md +5 -6
  4. package/.agents/skills/devtools-verification/SKILL.md +9 -5
  5. package/.agents/skills/fix-tests/SKILL.md +1 -1
  6. package/.agents/skills/foundation-test-migration/SKILL.md +2 -2
  7. package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +4 -5
  8. package/docs/README.md +1 -1
  9. package/docs/contributing/README.md +3 -3
  10. package/docs/cookbook/dependencies.md +1 -1
  11. package/docs/get_the_code.md +35 -26
  12. package/dt +7 -0
  13. package/dt.bat +8 -0
  14. package/front_end/core/common/ParsedURL.ts +1 -1
  15. package/front_end/core/sdk/PageResourceLoader.ts +141 -21
  16. package/front_end/core/sdk/ResourceTreeModel.ts +34 -10
  17. package/front_end/generated/Deprecation.ts +1 -1
  18. package/front_end/generated/InspectorBackendCommands.ts +1 -0
  19. package/front_end/generated/protocol-mapping.d.ts +8 -1
  20. package/front_end/generated/protocol-proxy-api.d.ts +7 -1
  21. package/front_end/generated/protocol.ts +8 -1
  22. package/front_end/models/ai_assistance/README.md +2 -2
  23. package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +2 -2
  24. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
  25. package/front_end/models/ai_assistance/contexts/RequestContext.snapshot.txt +2 -2
  26. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +7 -0
  27. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +9 -6
  28. package/front_end/models/ai_assistance/performance/AIQueries.ts +2 -1
  29. package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +62 -23
  30. package/front_end/models/bindings/ResourceScriptMapping.ts +21 -2
  31. package/front_end/models/stack_trace/StackTrace.ts +10 -0
  32. package/front_end/models/stack_trace/StackTraceImpl.ts +15 -0
  33. package/front_end/models/trace/Processor.ts +7 -9
  34. package/front_end/models/trace/extras/StackTraceForEvent.ts +1 -2
  35. package/front_end/models/trace/extras/TraceTree.ts +7 -2
  36. package/front_end/models/trace/handlers/AnimationFramesHandler.ts +4 -3
  37. package/front_end/models/trace/handlers/AsyncJSCallsHandler.ts +10 -9
  38. package/front_end/models/trace/handlers/ImagePaintingHandler.ts +6 -6
  39. package/front_end/models/trace/handlers/InitiatorsHandler.ts +6 -6
  40. package/front_end/models/trace/handlers/InvalidationsHandler.ts +2 -4
  41. package/front_end/models/trace/handlers/LayerTreeHandler.ts +3 -3
  42. package/front_end/models/trace/handlers/MetaHandler.ts +1 -1
  43. package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +5 -5
  44. package/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +9 -9
  45. package/front_end/models/trace/handlers/ScriptsHandler.ts +2 -2
  46. package/front_end/models/trace/handlers/UserInteractionsHandler.ts +1 -1
  47. package/front_end/models/trace/handlers/WarningsHandler.ts +3 -3
  48. package/front_end/models/trace/handlers/helpers.ts +8 -5
  49. package/front_end/models/trace/helpers/Timing.ts +17 -12
  50. package/front_end/models/trace/helpers/Trace.ts +41 -14
  51. package/front_end/models/trace/insights/DuplicatedJavaScript.ts +12 -2
  52. package/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +15 -1
  53. package/front_end/models/trace/types/TraceEvents.ts +213 -143
  54. package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +46 -0
  55. package/front_end/panels/ai_assistance/components/ChatMessage.ts +1 -1
  56. package/front_end/panels/application/AppManifestView.ts +26 -4
  57. package/front_end/panels/application/serviceWorkersView.css +1 -1
  58. package/front_end/panels/comments/CommentsPane.ts +81 -32
  59. package/front_end/panels/comments/commentsPane.css +42 -1
  60. package/front_end/panels/elements/DOMTreeElementWidget.ts +508 -747
  61. package/front_end/panels/elements/DOMTreeWidget.ts +418 -502
  62. package/front_end/panels/elements/StylePropertiesSection.ts +1 -1
  63. package/front_end/panels/layer_viewer/Layers3DView.ts +6 -6
  64. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +3 -0
  65. package/front_end/panels/recorder/recordingView.css +1 -1
  66. package/front_end/panels/settings/SettingsScreen.ts +6 -1
  67. package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
  68. package/front_end/panels/sources/SourcesPanel.ts +511 -374
  69. package/front_end/panels/sources/sourcesPanel.css +6 -31
  70. package/front_end/panels/timeline/CountersGraph.ts +5 -4
  71. package/front_end/panels/timeline/Initiators.ts +1 -1
  72. package/front_end/panels/timeline/TimelineFlameChartView.ts +17 -19
  73. package/front_end/panels/timeline/TimelineMiniMap.ts +11 -19
  74. package/front_end/panels/timeline/TimelinePanel.ts +90 -43
  75. package/front_end/panels/timeline/TimelineUIUtils.ts +2 -2
  76. package/front_end/panels/timeline/components/BreadcrumbsUI.ts +109 -87
  77. package/front_end/panels/timeline/components/LayoutShiftDetails.ts +3 -3
  78. package/front_end/panels/timeline/components/breadcrumbsUI.css +43 -24
  79. package/front_end/panels/timeline/overlays/components/TimeRangeOverlay.ts +21 -11
  80. package/front_end/panels/timeline/utils/EntryNodes.ts +1 -1
  81. package/front_end/third_party/chromium/README.chromium +1 -1
  82. package/front_end/third_party/source-map-scopes-codec/README.chromium +2 -2
  83. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +2 -0
  84. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +1 -1
  85. package/front_end/third_party/source-map-scopes-codec/package/deno.json +1 -1
  86. package/front_end/third_party/source-map-scopes-codec/package/package.json +1 -1
  87. package/front_end/third_party/source-map-scopes-codec/package/src/codec.js +2 -2
  88. package/front_end/third_party/source-map-scopes-codec/package/src/codec.ts +2 -2
  89. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +19 -1
  90. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +1 -1
  91. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +26 -4
  92. package/front_end/ui/comments/CommentAnchorResolver.ts +2 -0
  93. package/front_end/ui/components/buttons/Button.ts +9 -1
  94. package/front_end/ui/components/buttons/button.css +4 -0
  95. package/front_end/ui/components/helpers/scheduled-render.ts +1 -1
  96. package/front_end/ui/legacy/GlassPane.ts +1 -1
  97. package/front_end/ui/legacy/SplitWidget.ts +1 -1
  98. package/front_end/ui/legacy/Toolbar.ts +1 -107
  99. package/front_end/ui/legacy/UIUtils.ts +133 -11
  100. package/front_end/ui/legacy/Widget.ts +5 -1
  101. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +5 -2
  102. package/front_end/ui/legacy/components/object_ui/objectPopover.css +1 -1
  103. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +47 -15
  104. package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +1 -1
  105. package/front_end/ui/legacy/components/utils/Linkifier.ts +2 -2
  106. package/front_end/ui/legacy/theme_support/ThemeSupport.ts +6 -5
  107. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
  108. package/front_end/ui/visual_logging/LoggingDriver.ts +4 -4
  109. package/package.json +3 -3
@@ -9,7 +9,7 @@ This guide outlines the standard procedure for creating a new model or migrating
9
9
 
10
10
  ## 0. Preparation (Before you start)
11
11
  * **Baseline:** Run existing tests for the code you are moving to ensure they pass *before* you touch anything.
12
- * `npm run test -- front_end/<old_location>`
12
+ * `./dt test front_end/<old_location>`
13
13
  * **Impact Analysis:** Search for usages of the class/file to understand the scope of refactoring.
14
14
  * `grep -r "ClassName" front_end/`
15
15
 
@@ -44,10 +44,10 @@ The build system does not auto-detect new modules. You must manually register th
44
44
 
45
45
  ## 5. Verification Checklist
46
46
  1. **Build:** `autoninja -C out/Default` (Ensures BUILD.gn and GRD files are correct).
47
- 2. **Lint:** `npm run lint` (Checks style and formatting).
47
+ 2. **Lint:** `./dt lint` (Checks style and formatting).
48
48
  3. **Test:**
49
- * `npm run test -- front_end/models/<model_name>` (New tests).
50
- * `npm run test -- front_end/<old_location>` (Regression check for previous owner).
49
+ * `./dt test front_end/models/<model_name>` (New tests).
50
+ * `./dt test front_end/<old_location>` (Regression check for previous owner).
51
51
 
52
52
  ## Common Pitfalls
53
53
  * **Circular Dependencies:** Occur when internal files import from the directory's own barrel file.
@@ -144,7 +144,7 @@ const setting = Common.Settings.Settings.instance().resolve(preserveConsoleLogSe
144
144
 
145
145
  ### Step 6: Verify Changes
146
146
  1. Run `autoninja -C out/Default` to check GN build.
147
- 2. Run `npm run lint` to check style and formatting rules.
147
+ 2. Run `./dt lint` to check style and formatting rules.
148
148
  3. Run relevant unit tests for the modified module.
149
149
 
150
150
  ---
@@ -10,10 +10,9 @@ Use this skill when addressing a single UX writing refactoring task (one module
10
10
 
11
11
  ## 0. Environment setup (avoid PATH errors)
12
12
 
13
- In DevTools Linux workspaces, `depot_tools` and `node`/`npm` may not be in `PATH` in non-interactive agent shells. Before you run Git, `gclient`, `npm`, or `git cl` commands, ensure that your environment is set up:
13
+ In DevTools Linux workspaces, `depot_tools` may not be in `PATH` in non-interactive agent shells. Before you run Git, `gclient`, `./dt`, or `git cl` commands, ensure that your environment is set up:
14
14
  ```bash
15
15
  export PATH=$HOME/depot_tools:$PATH
16
- source ~/.nvm/nvm.sh # Or export PATH=$(pwd)/third_party/node/linux/node-linux-x64/bin:$PATH
17
16
  ```
18
17
 
19
18
  ## 1. Pre-flight issue check and target scope
@@ -103,14 +102,14 @@ Don’t finish an edit without running the linter and test suite. In DevTools, i
103
102
  Unit test files (`*.test.ts`) alongside the implementation often assert exact UIString values (such as error messages or warnings). When you refactor a string, check sibling `*.test.ts` files for assertions that match the old string value, and update them to prevent test failures.
104
103
  2. **Run the linter and auto-fix errors**
105
104
  ```bash
106
- npm run lint -- <folder_path>
105
+ ./dt lint <folder_path>
107
106
  ```
108
107
  3. **Run unit tests**
109
- You MUST run the full test suite using `npm run test` to verify that no cross-module regressions, e2e test failures, or snapshot regressions occurred. Do not only run a subset of tests:
108
+ You MUST run the full test suite using `./dt test` to verify that no cross-module regressions, e2e test failures, or snapshot regressions occurred. Do not only run a subset of tests:
110
109
  ```bash
111
- npm run test
110
+ ./dt test
112
111
  ```
113
- *(Optionally, you may run `npm run test -- <folder_path>` first for rapid initial feedback during iterative development, but running `npm run test` for full test suite coverage is required before completing the task.)*
112
+ *(Optionally, you may run `./dt test <folder_path>` first for rapid initial feedback during iterative development, but running `./dt test` for full test suite coverage is required before completing the task.)*
114
113
  4. **Run presubmit checks**
115
114
  Ensure that you commit or stage all changes before you run presubmit checks:
116
115
  ```bash
@@ -1,15 +1,19 @@
1
1
  ---
2
2
  name: devtools-verification
3
- description: "MANDATORY: Activate this skill ANY TIME you need to build the project, run tests, or verify code health in DevTools. You MUST use this skill before executing commands like npm test, npm run build, autoninja, or linters, as it contains critical, repository-specific instructions on how to correctly format these commands, filter test runs, and interpret failures."
3
+ description: "MANDATORY: Activate this skill ANY TIME you need to build the project, run tests, or verify code health in DevTools. You MUST use this skill before executing commands like ./dt test, ./dt build, autoninja, or linters (never run these through npm or npx), as it contains critical, repository-specific instructions on how to correctly format these commands, filter test runs, and interpret failures."
4
4
  ---
5
5
 
6
6
  # Instructions on how to verify your changes
7
7
 
8
+ ## Running scripts
9
+
10
+ Run the scripts from the root `package.json` (`test`, `lint`, `build`, `start`, and so on) with `./dt <script> [args]` from the repository root (on Windows: `.\dt <script> [args]`). Don't use `npm run`, `npm test`, or `npx` for them. Run `./dt` without arguments to list the available scripts. Arguments after the script name are passed to the script as is, so don't add a `--` separator.
11
+
8
12
  ## Testing
9
13
 
10
- - To test a file, you can run `npm run test -- <FILEPATH>` where `FILEPATH` is a path to a `*.test.ts` file, relative to the working directory.
14
+ - To test a file, you can run `./dt test <FILEPATH>` where `FILEPATH` is a path to a `*.test.ts` file, relative to the working directory.
11
15
  - Test files are usually defined alongside their implementation. So if you are working on `front_end/panels/timeline/TimelinePanel.ts`, you would expect the test file to be defined in `front_end/panels/timeline/TimelinePanel.test.ts`.
12
- - You can also test an entire directory. For example, `npm run test -- front_end/models/trace` will run all tests in that directory.
16
+ - You can also test an entire directory. For example, `./dt test front_end/models/trace` will run all tests in that directory.
13
17
 
14
18
  ## Building & compiling
15
19
 
@@ -17,8 +21,8 @@ description: "MANDATORY: Activate this skill ANY TIME you need to build the proj
17
21
 
18
22
  ## Linting
19
23
 
20
- - `npm run lint` will execute ESLint and StyleLint. It will report any violations and automatically fix them where possible.
21
- - To run the linter on a specific file or directory, you can run `npm run lint -- <PATH>` where `PATH` is a path to a file or directory. This will also automatically fix violations where possible.
24
+ - `./dt lint` will execute ESLint and StyleLint. It will report any violations and automatically fix them where possible.
25
+ - To run the linter on a specific file or directory, you can run `./dt lint <PATH>` where `PATH` is a path to a file or directory. This will also automatically fix violations where possible.
22
26
 
23
27
  ## Fetching Tryjob Results, Failure Logs, & Screenshot Goldens
24
28
 
@@ -22,7 +22,7 @@ First, create and start two sub-agents simultaneously. One called 'local-repro'
22
22
 
23
23
  ### Local reproduction (local-repro)
24
24
 
25
- - Use command: `npm run test -- --repeat=<count> path/to/foo.test.ts:exact_test_id` to locally run the tests repeatedly. Both E2E and unit tests support this. Use the exact test ID printed in the test runner output (usually the suite and test names with spaces replaced by underscores). Do not use `--grep` or a `bash` script with a `for` loop.
25
+ - Use command: `./dt test --repeat=<count> path/to/foo.test.ts:exact_test_id` to locally run the tests repeatedly. Both E2E and unit tests support this. Use the exact test ID printed in the test runner output (usually the suite and test names with spaces replaced by underscores). Do not use `--grep` or a `bash` script with a `for` loop.
26
26
  - First run the test three times to note how long the test runs (on average).
27
27
  - Then run the test continuously for 4 minutes, while noting any failures and failure rates. If the failure rate is still 0% after that, assume the problem does not reproduce locally.
28
28
  - After the local test run completes, then show the results in a table. For example:
@@ -162,10 +162,10 @@ Foundation tests must pass in both Node.js and Browser runtimes.
162
162
 
163
163
  ### Run in Node.js
164
164
  ```bash
165
- npm test -- front_end/core/sdk/NetworkManager.test.ts --node-unit-tests
165
+ ./dt test front_end/core/sdk/NetworkManager.test.ts --node-unit-tests
166
166
  ```
167
167
 
168
168
  ### Run in Browser
169
169
  ```bash
170
- npm test -- front_end/core/sdk/NetworkManager.test.ts
170
+ ./dt test front_end/core/sdk/NetworkManager.test.ts
171
171
  ```
@@ -69,11 +69,11 @@ Always detect the execution environment first to run tests successfully:
69
69
 
70
70
  * **Detection**: Triggered if the workspace path starts with `/google/cog/` or
71
71
  `/google/src/`.
72
- * **Why it is required**: Raw commands like `npm run test` or `autoninja` fail
72
+ * **Why it is required**: Raw commands like `./dt test` or `autoninja` fail
73
73
  because they lack Google cloudtop/virtualization wrapper configurations.
74
74
  * **Resolution Steps**:
75
75
 
76
- 1. Do not run `npm run test` or standard `autoninja` directly.
76
+ 1. Do not run `./dt test` or standard `autoninja` directly.
77
77
  2. Leverage the Google-specific Cider testing script to compile and run
78
78
  tests in the cloud workspace:
79
79
 
@@ -107,7 +107,7 @@ Always detect the execution environment first to run tests successfully:
107
107
  3. Execute the tests:
108
108
 
109
109
  ```bash
110
- npm run test -- front_end/panels/application/IndexedDBViews.test.ts
110
+ ./dt test front_end/panels/application/IndexedDBViews.test.ts
111
111
  ```
112
112
 
113
113
  ### Scenario C: ESLint TS Module Resolution Failure (ERR_UNKNOWN_FILE_EXTENSION)
@@ -121,7 +121,7 @@ Always detect the execution environment first to run tests successfully:
121
121
  parse the rules:
122
122
 
123
123
  ```bash
124
- npm run build
124
+ ./dt build
125
125
  ```
126
126
 
127
127
  ### Scenario D: Screenshot Test Fails (Visual Diffs > 0%)
@@ -141,4 +141,3 @@ Always detect the execution environment first to run tests successfully:
141
141
  1. ❓ **Coverage**: Did I cover all classes in the file, or only the main one?
142
142
  2. ❓ **Stability**: Can the tests run repeatedly without flakiness?
143
143
  3. ❓ **Integrations**: Did I verify that the component mounts correctly?
144
-
package/docs/README.md CHANGED
@@ -71,7 +71,7 @@ below.**
71
71
 
72
72
  Formats all code using clang-format.
73
73
 
74
- `npm test`
74
+ `./dt test`
75
75
 
76
76
  Runs all tests on DevTools code.
77
77
 
@@ -157,9 +157,9 @@ be accepted.
157
157
  If your patch is finished, we have a few helpful tools to make sure your patch looks good.
158
158
 
159
159
  As part of the presubmit check, we will automatically run these. You can also run specific
160
- presubmit checks by using our `npm` commands:
160
+ presubmit checks by using our `./dt` commands:
161
161
 
162
- * `npm run lint` to perform [ESLint](http://eslint.org) and [Stylelint](http://stylelint.io)
162
+ * `./dt lint` to perform [ESLint](http://eslint.org) and [Stylelint](http://stylelint.io)
163
163
  checks.
164
164
 
165
165
  To run these presubmit checks without uploading, you can run `git cl presubmit --upload`.
@@ -252,7 +252,7 @@ If reviewers will ask you to change something in your code, follow these steps:
252
252
  2. Run `gsync client`.
253
253
  3. Optionally, pull latest changes and rebase them with: `git pull --rebase origin main`.
254
254
  4. Commit locally to your branch.
255
- 5. Run the linters on your code (e.g. style, coding conventions) via `npm run lint`.
255
+ 5. Run the linters on your code (e.g. style, coding conventions) via `./dt lint`.
256
256
  6. Finally, upload everything to the server again with `git cl upload`.
257
257
  7. Once complete, add a comment similar to "comments addressed, please take a look".
258
258
  Without a comment, reviewers will not know about your new patchset.
@@ -59,7 +59,7 @@ Chromium licensing to be used, on the basis that it enforces all packages have a
59
59
  license that is compatible with a set of pre-defined licensees.
60
60
 
61
61
  If you want to use a new package as tooling process in engineer workflows, you
62
- can add the package to the `package.json` and run `npm run install-deps` to
62
+ can add the package to the `package.json` and run `./dt install-deps` to
63
63
  check in the new contents.
64
64
 
65
65
  Only add new license types to `LICENSES` after you received approval from
@@ -27,9 +27,18 @@ To build, follow these steps:
27
27
  ```bash
28
28
  cd devtools-frontend
29
29
  gclient sync
30
- npm run build
30
+ ./dt build
31
31
  ```
32
32
 
33
+ Scripts from `package.json` are run with `./dt <script> [args]` (on Windows:
34
+ `.\dt <script> [args]`), a launcher for `scripts/tools/dt.py`. Run it without arguments
35
+ to list the available scripts. Arguments after the script name are passed to the script
36
+ as is, so no `--` is needed.
37
+
38
+ `npm run <script> -- [args]` works too if you have npm installed, e.g.
39
+ `npm run test -- foo` is the same as `./dt test foo`. AI agents should use `./dt`, not
40
+ `npm run`.
41
+
33
42
  The resulting build artifacts can be found in `out/Default/gen/front_end`.
34
43
 
35
44
  The build tools generally assume `Default` as the target (and `out/Default` as the
@@ -37,7 +46,7 @@ build directory). You can pass `-t <name>` (or `--target=<name>`) to use a diffe
37
46
  target. For example
38
47
 
39
48
  ```bash
40
- npm run build -- -t Debug
49
+ ./dt build -t Debug
41
50
  ```
42
51
 
43
52
  will build in `out/Debug` instead of `out/Default`. If the directory doesn't exist,
@@ -51,14 +60,14 @@ to `false`:
51
60
  gn gen out/Fast --args="devtools_bundle=false"
52
61
  ```
53
62
 
54
- and use `npm run build -- -t Fast` to build this target.
63
+ and use `./dt build -t Fast` to build this target.
55
64
 
56
65
  ### Rebuilding automatically
57
66
 
58
67
  You can use
59
68
 
60
69
  ```bash
61
- npm run build -- --watch
70
+ ./dt build --watch
62
71
  ```
63
72
 
64
73
  to have the build script watch for changes in source files and automatically trigger
@@ -96,7 +105,7 @@ if you encounter any errors.
96
105
 
97
106
  ### Using a `.env` file for default script options
98
107
 
99
- Many scripts, like `npm run build` and `npm start`, accept command-line flags to configure their behavior (e.g., `-t <target>`, `--browser=<name>`).
108
+ Many scripts, like `build` and `start`, accept command-line flags to configure their behavior (e.g., `-t <target>`, `--browser=<name>`).
100
109
 
101
110
  To avoid typing these flags every time, you can set your preferred defaults in a .env file at the root of the devtools-frontend directory.
102
111
 
@@ -106,13 +115,13 @@ The `.env.template` file lists all supported variables. Copy it to `.env` to get
106
115
  cp .env.template .env
107
116
  ```
108
117
 
109
- As mentioned earlier, you might create a fast build target. Instead of always typing `npm run build -- -t Fast`, to remove the flag repetition you simple run `npm run build` you can set the following variable in your `.env` file:
118
+ As mentioned earlier, you might create a fast build target. Instead of always typing `./dt build -t Fast`, to remove the flag repetition you simple run `./dt build` you can set the following variable in your `.env` file:
110
119
 
111
120
  ```shell
112
121
  DEVTOOLS_TARGET=Fast
113
122
  ```
114
123
 
115
- Another example - by default running `npm start` auto-opens DevTools for new Tabs.
124
+ Another example - by default running `./dt start` auto-opens DevTools for new Tabs.
116
125
  You may want to disable this so fewer pop-up happen while debugging, usually done via `--no-open` flag. Or with `.env` set the following value:
117
126
 
118
127
  ```shell
@@ -154,43 +163,43 @@ You can run a [build](#Build) of DevTools frontend in a pre-built Chrome or Chro
154
163
  - Use the downloaded Chrome for Testing binary in `third_party/chrome`.
155
164
  - Use the latest Chrome Canary. This includes any DevTools features that are only available in regular Chrome builds (`is_official_build` + `is_chrome_branded`), such as GenAI-related features.
156
165
 
157
- #### Using `npm start` script (recommended)
166
+ #### Using the `start` script (recommended)
158
167
 
159
168
  With Chromium 136, we added (back) a `start` script that can be used to easily launch DevTools with pre-built [Chrome
160
169
  for Testing](https://developer.chrome.com/blog/chrome-for-testing) or [Chrome Canary](https://www.google.com/chrome/canary/).
161
170
  It'll also take care of automatically enabling/disabling experimental features that are actively being worked on. Use
162
171
 
163
172
  ```bash
164
- npm start
173
+ ./dt start
165
174
  ```
166
175
 
167
176
  to build DevTools front-end in `out/Default` (you can change this to `out/foo` by passing `--target=foo` if needed),
168
177
  and open Chrome for Testing (in `third_party/chrome`) with the custom DevTools front-end. This will also monitor the
169
178
  source files for changes while Chrome is running and automatically trigger a rebuild whenever source files change.
170
179
 
171
- By default, `npm start` will automatically open DevTools for every new tab, you can use
180
+ By default, `./dt start` will automatically open DevTools for every new tab, you can use
172
181
 
173
182
  ```bash
174
- npm start -- --no-open
183
+ ./dt start --no-open
175
184
  ```
176
185
 
177
186
  to disable this behavior. You can also use
178
187
 
179
188
  ```bash
180
- npm start -- --browser=canary
189
+ ./dt start --browser=canary
181
190
  ```
182
191
 
183
192
  to run in Chrome Canary instead of Chrome for Testing; this requires you to install Chrome Canary manually first
184
193
  (Googlers can install `google-chrome-canary` on gLinux). And finally use
185
194
 
186
195
  ```bash
187
- npm start -- http://www.example.com
196
+ ./dt start http://www.example.com
188
197
  ```
189
198
 
190
199
  to automatically open `http://www.example.com` in the newly spawned Chrome tab. Use
191
200
 
192
201
  ```bash
193
- npm start -- --verbose
202
+ ./dt start --verbose
194
203
  ```
195
204
 
196
205
  to enable verbose logging, which among other things, also prints all output from Chrome to the terminal, which is
@@ -198,38 +207,38 @@ otherwise suppressed.
198
207
 
199
208
  ##### Controlling the feature set
200
209
 
201
- By default `npm start` will enable a bunch of experimental features (related to DevTools) that are considered ready for teamfood.
210
+ By default `./dt start` will enable a bunch of experimental features (related to DevTools) that are considered ready for teamfood.
202
211
  To also enable experimental features that aren't yet considered sufficiently stable to enable them by default for the team, run:
203
212
 
204
213
  ```bash
205
214
  # Long version
206
- npm start -- --unstable-features
215
+ ./dt start --unstable-features
207
216
 
208
217
  # Short version
209
- npm start -- -u
218
+ ./dt start -u
210
219
  ```
211
220
 
212
221
  Just like with Chrome itself, you can also control the set of enabled and disabled features using
213
222
 
214
223
  ```bash
215
- npm start -- --enable-features=DevToolsWellKnown
216
- npm start -- --disable-features=DevToolsWellKnown --enable-features=DevToolsFreestyler:multimodal/true
224
+ ./dt start --enable-features=DevToolsWellKnown
225
+ ./dt start --disable-features=DevToolsWellKnown --enable-features=DevToolsFreestyler:multimodal/true
217
226
  ```
218
227
 
219
228
  which you can use to override the default feature set.
220
229
 
221
230
  ##### Remote debugging
222
231
 
223
- The `npm start` command also supports launching Chrome for remote debugging via
232
+ The `./dt start` command also supports launching Chrome for remote debugging via
224
233
 
225
234
  ```bash
226
- npm start -- --remote-debugging-port=9222
235
+ ./dt start --remote-debugging-port=9222
227
236
  ```
228
237
 
229
238
  or
230
239
 
231
240
  ```bash
232
- npm start -- --browser=canary --remote-debugging-port=9222 --user-data-dir=\`mktemp -d`
241
+ ./dt start --browser=canary --remote-debugging-port=9222 --user-data-dir=\`mktemp -d`
233
242
  ```
234
243
 
235
244
  Note that you have to also pass the `--user-data-dir` and point it to a non-standard profile directory (a freshly created
@@ -362,22 +371,22 @@ out/Default/chrome --custom-devtools-frontend=file://$(realpath out/Default/gen/
362
371
  afterwards, which can be quite a bit faster than building and linking the full
363
372
  Chromium binary.
364
373
 
365
- Alternatively you can use `npm start` from the DevTools sub folder (`third_party/devtools-frontend/src/`) with the browser set to `chromium`.
374
+ Alternatively you can use `./dt start` from the DevTools sub folder (`third_party/devtools-frontend/src/`) with the browser set to `chromium`.
366
375
  This will tell the command that you are in a Chromium checkout and try to find the correct browser executable path to resolve.
367
376
  Or alternately you can use a `.env` file, see [set up here](#using-a-env-file-for-default-script-options).
368
377
 
369
378
  ```bash
370
379
  cd third_party/devtools-frontend/src/
371
- npm start -- --browser=chromium
380
+ ./dt start --browser=chromium
372
381
  ```
373
382
 
374
383
  ### Testing
375
384
 
376
- To run the test suite, use `npm test` from within the DevTools front-end folder:
385
+ To run the test suite, use `./dt test` from within the DevTools front-end folder:
377
386
 
378
387
  ```bash
379
388
  cd third_party/devtools-frontend/src
380
- npm test
389
+ ./dt test
381
390
  ```
382
391
 
383
392
  ### Juggling the git submodules
package/dt ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/sh
2
+ # Copyright 2026 The Chromium Authors
3
+ # Use of this source code is governed by a BSD-style license that can be
4
+ # found in the LICENSE file.
5
+ #
6
+ # Launcher for scripts/tools/dt.py, so it can be run as `./dt <script> [args]`.
7
+ exec vpython3 "$(dirname "$0")/scripts/tools/dt.py" "$@"
package/dt.bat ADDED
@@ -0,0 +1,8 @@
1
+ @echo off
2
+ rem Copyright 2026 The Chromium Authors
3
+ rem Use of this source code is governed by a BSD-style license that can be
4
+ rem found in the LICENSE file.
5
+ rem
6
+ rem Launcher for scripts\tools\dt.py, so it can be run as `dt <script> [args]`.
7
+ call vpython3 "%~dp0scripts\tools\dt.py" %*
8
+ exit /b %ERRORLEVEL%
@@ -334,7 +334,7 @@ export class ParsedURL {
334
334
  // 8 - ?fragment
335
335
  const schemeRegex = /([A-Za-z][A-Za-z0-9+.-]*):\/\//;
336
336
  const userRegex = /(?:([A-Za-z0-9\-._~%!$&'()*+,;=:]*)@)?/;
337
- const hostRegex = /((?:\[::\d?\])|(?:[^\s\/:]*))/;
337
+ const hostRegex = /((?:\[[0-9a-fA-F:.]*:[0-9a-fA-F:.]*\])|(?:[^\s\/:]*))/;
338
338
  const portRegex = /(?::([\d]+))?/;
339
339
  const pathRegex = /(\/[^#?]*)?/;
340
340
  const queryRegex = /(?:\?([^#]*))?/;