chrome-devtools-frontend 1.0.1571007 → 1.0.1572937
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/agents/prompts/README.md +18 -0
- package/agents/prompts/devtools-imports.md +47 -0
- package/agents/prompts/verification.md +27 -0
- package/front_end/Images/geminiInDevTools.png +0 -0
- package/front_end/Images/geminiInDevTools_2x.png +0 -0
- package/front_end/Images/src/database-off.svg +1 -0
- package/front_end/Images/src/lock-person.svg +1 -1
- package/front_end/core/common/Debouncer.ts +10 -1
- package/front_end/core/common/SettingRegistration.ts +1 -1
- package/front_end/core/host/AidaClient.ts +8 -0
- package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -6
- package/front_end/core/host/UserMetrics.ts +1 -31
- package/front_end/core/root/ExperimentNames.ts +30 -0
- package/front_end/core/root/Runtime.ts +47 -48
- package/front_end/core/root/root.ts +2 -0
- package/front_end/core/sdk/CSSModel.ts +36 -13
- package/front_end/core/sdk/CSSProperty.ts +1 -1
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +9 -0
- package/front_end/core/sdk/CookieModel.ts +2 -1
- package/front_end/core/sdk/DOMModel.ts +1 -1
- package/front_end/core/sdk/DebuggerModel.ts +1 -1
- package/front_end/core/sdk/OverlayModel.ts +3 -2
- package/front_end/core/sdk/SourceMap.ts +1 -1
- package/front_end/devtools_compatibility.js +0 -6
- package/front_end/entrypoints/main/MainImpl.ts +44 -24
- package/front_end/entrypoints/main/main-meta.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.js +6 -14
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +0 -180
- package/front_end/models/ai_assistance/ai_assistance.ts +0 -2
- package/front_end/models/breakpoints/BreakpointManager.ts +3 -3
- package/front_end/models/issues_manager/ContrastCheckTrigger.ts +2 -2
- package/front_end/models/javascript_metadata/NativeFunctions.js +8 -0
- package/front_end/models/source_map_scopes/NamesResolver.ts +1 -1
- package/front_end/models/trace/EventsSerializer.ts +5 -1
- package/front_end/models/trace/ModelImpl.ts +0 -4
- package/front_end/models/trace/types/TraceEvents.ts +4 -0
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +1 -1
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +8 -63
- package/front_end/panels/ai_assistance/PatchWidget.ts +10 -15
- package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +5 -4
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +0 -16
- package/front_end/panels/ai_assistance/ai_assistance.ts +0 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +3 -2
- package/front_end/panels/ai_assistance/components/ChatView.ts +123 -108
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +1 -145
- package/front_end/panels/application/DeviceBoundSessionsModel.ts +23 -1
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +23 -0
- package/front_end/panels/application/FrameDetailsView.ts +12 -10
- package/front_end/panels/application/components/BackForwardCacheView.ts +6 -8
- package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +4 -3
- package/front_end/panels/application/components/ProtocolHandlersView.ts +5 -6
- package/front_end/panels/application/components/ReportsGrid.ts +9 -9
- package/front_end/panels/application/components/SharedStorageAccessGrid.ts +5 -4
- package/front_end/panels/application/components/TrustTokensView.ts +4 -6
- package/front_end/panels/application/preloading/PreloadingView.ts +9 -8
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +237 -230
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +3 -2
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +6 -10
- package/front_end/panels/application/resourcesSidebar.css +8 -0
- package/front_end/panels/autofill/AutofillView.ts +4 -3
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +3 -5
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +5 -5
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +35 -4
- package/front_end/panels/common/BadgeNotification.ts +17 -14
- package/front_end/panels/common/GdpSignUpDialog.ts +5 -6
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +192 -0
- package/front_end/panels/common/aiCodeGenerationTeaser.css +16 -1
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/common/geminiRebrandPromoDialog.css +47 -0
- package/front_end/panels/console/ConsoleInsightTeaser.ts +10 -11
- package/front_end/panels/console/ErrorStackParser.ts +11 -16
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewModel.ts +1 -1
- package/front_end/panels/elements/ComputedStyleModel.ts +16 -65
- package/front_end/panels/elements/ComputedStyleWidget.ts +3 -3
- package/front_end/panels/elements/ElementsPanel.ts +35 -5
- package/front_end/panels/elements/ElementsSidebarPane.ts +1 -1
- package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
- package/front_end/panels/elements/PlatformFontsWidget.ts +1 -1
- package/front_end/panels/elements/StylePropertiesSection.ts +16 -8
- package/front_end/panels/elements/StylePropertyTreeElement.ts +67 -32
- package/front_end/panels/elements/StylesSidebarPane.ts +28 -11
- package/front_end/panels/elements/components/CSSHintDetailsView.ts +3 -2
- package/front_end/panels/elements/components/CSSPropertyDocsView.ts +3 -2
- package/front_end/panels/elements/elements-meta.ts +1 -1
- package/front_end/panels/emulation/DeviceModeWrapper.ts +101 -62
- package/front_end/panels/explain/components/ConsoleInsight.ts +27 -23
- package/front_end/panels/explain/components/consoleInsight.css +1 -1
- package/front_end/panels/issues/IssueView.ts +6 -6
- package/front_end/panels/network/RequestConditionsDrawer.ts +4 -3
- package/front_end/panels/network/RequestCookiesView.ts +3 -4
- package/front_end/panels/network/RequestTimingView.ts +6 -10
- package/front_end/panels/network/components/HeaderSectionRow.ts +3 -2
- package/front_end/panels/network/components/RequestHeaderSection.ts +3 -1
- package/front_end/panels/network/components/RequestHeadersView.css +2 -2
- package/front_end/panels/network/components/RequestHeadersView.ts +7 -6
- package/front_end/panels/profiler/HeapProfileView.ts +3 -3
- package/front_end/panels/profiler/HeapSnapshotView.ts +2 -2
- package/front_end/panels/profiler/profiler-meta.ts +3 -3
- package/front_end/panels/protocol_monitor/protocol_monitor-meta.ts +1 -1
- package/front_end/panels/recorder/RecorderController.ts +7 -13
- package/front_end/panels/recorder/components/CreateRecordingView.ts +6 -6
- package/front_end/panels/recorder/components/RecordingView.ts +0 -38
- package/front_end/panels/recorder/components/ReplaySection.ts +0 -14
- package/front_end/panels/recorder/components/StepEditor.ts +2 -40
- package/front_end/panels/recorder/recorderController.css +4 -4
- package/front_end/panels/security/CookieControlsView.ts +2 -2
- package/front_end/panels/security/CookieReportView.ts +21 -21
- package/front_end/panels/security/cookieControlsView.css +1 -1
- package/front_end/panels/security/cookieReportView.css +1 -1
- package/front_end/panels/settings/AISettingsTab.ts +13 -15
- package/front_end/panels/settings/components/SyncSection.ts +4 -3
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +4 -12
- package/front_end/panels/settings/settings-meta.ts +1 -1
- package/front_end/panels/sources/BreakpointEditDialog.ts +4 -3
- package/front_end/panels/sources/CallStackSidebarPane.ts +4 -1
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +1 -1
- package/front_end/panels/sources/NavigatorView.ts +4 -4
- package/front_end/panels/sources/SourcesPanel.ts +7 -4
- package/front_end/panels/sources/components/HeadersView.ts +2 -2
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +3 -2
- package/front_end/panels/timeline/ThreadAppender.ts +2 -1
- package/front_end/panels/timeline/TimelineController.ts +4 -3
- package/front_end/panels/timeline/TimelinePanel.ts +7 -4
- package/front_end/panels/timeline/TimelineUIUtils.ts +2 -2
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +4 -4
- package/front_end/panels/timeline/components/FieldSettingsDialog.ts +13 -6
- package/front_end/panels/timeline/components/LiveMetricsView.ts +13 -9
- package/front_end/panels/timeline/components/exportTraceOptions.css +1 -1
- package/front_end/panels/timeline/components/fieldSettingsDialog.css +1 -1
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -19
- package/front_end/panels/timeline/components/insights/InsightRenderer.ts +3 -4
- package/front_end/panels/timeline/components/insights/baseInsightComponent.css +0 -5
- package/front_end/panels/timeline/components/liveMetricsView.css +1 -1
- package/front_end/panels/whats_new/ReleaseNoteView.ts +4 -3
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/buttons/button.css +4 -0
- package/front_end/ui/components/markdown_view/CodeBlock.ts +3 -6
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +3 -4
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +3 -4
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +10 -7
- package/front_end/ui/components/panel_feedback/panelFeedback.css +2 -2
- package/front_end/ui/components/panel_feedback/previewToggle.css +2 -2
- package/front_end/ui/components/text_editor/AiCodeGenerationParser.ts +27 -8
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +36 -6
- package/front_end/ui/kit/link/Link.ts +1 -14
- package/front_end/ui/legacy/ActionRegistration.ts +1 -1
- package/front_end/ui/legacy/ContextMenu.ts +2 -2
- package/front_end/ui/legacy/EmptyWidget.ts +3 -3
- package/front_end/ui/legacy/LinkContextMenuProvider.ts +42 -0
- package/front_end/ui/legacy/ViewRegistration.ts +1 -1
- package/front_end/ui/legacy/XLink.ts +0 -27
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +1 -1
- package/front_end/ui/legacy/components/color_picker/ContrastOverlay.ts +5 -4
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +2 -2
- package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +2 -1
- package/front_end/ui/legacy/legacy.ts +3 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +4 -1
- package/front_end/ui/visual_logging/LoggingDriver.ts +3 -0
- package/package.json +1 -1
- package/front_end/models/ai_assistance/ArtifactsManager.ts +0 -67
- package/front_end/panels/ai_assistance/components/ArtifactsViewer.ts +0 -183
- package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +0 -89
- package/front_end/panels/ai_assistance/components/PerformanceAgentFlameChart.ts +0 -133
- package/front_end/panels/ai_assistance/components/artifactsViewer.css +0 -15
- package/front_end/panels/ai_assistance/components/collapsibleAssistanceContentWidget.css +0 -32
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
This directory contains a series of prompts that can be added to your root `GEMINI.md` file, which is not committed to version control.
|
|
2
|
+
|
|
3
|
+
More context for Googlers: go/chrome-devtools:ai-agents-use
|
|
4
|
+
|
|
5
|
+
## Getting started
|
|
6
|
+
|
|
7
|
+
1. Create `//GEMINI.md` in the root of the `devtools-frontend` repository.
|
|
8
|
+
2. Include the relevant prompts with `@`:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
@agents/prompts/verification.md
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The `/memory show` command in Gemini CL can be used to verify that the files have been included correctly.
|
|
15
|
+
|
|
16
|
+
## Contributing
|
|
17
|
+
|
|
18
|
+
Contributions to existing prompts or to add new ones are encouraged; CLs are very welcome.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Imports
|
|
2
|
+
|
|
3
|
+
This codebase follows a special convention for importing code that must be followed to avoid build errors.
|
|
4
|
+
|
|
5
|
+
In DevTools each folder of code is considered a *module*:
|
|
6
|
+
|
|
7
|
+
- `front_end/models/trace` is the *trace module*.
|
|
8
|
+
- `front_end/panels/timeline` is the *timeline module*.
|
|
9
|
+
|
|
10
|
+
Within each module there are multiple TypeScript files. *The file that is named the same as the folder name is called the entrypoint*.
|
|
11
|
+
|
|
12
|
+
- `front_end/models/trace/trace.ts` is the *trace module's entrypoint*
|
|
13
|
+
- `front_end/models/trace/ModelImpl.ts` is part of the implementation of the trace module.
|
|
14
|
+
|
|
15
|
+
## Importing from another module
|
|
16
|
+
|
|
17
|
+
When you want to reuse code from other modules, *you must import that module via its entrypoint*. Imagine we are in `front_end/panels/timeline/TimelinePanel.ts`. This import is GOOD:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
import * as Trace from '../models/trace/trace.js'; // import the entrypoint
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This import is BAD because we import a file that is NOT the entrypoint:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
import * as ModelImpl from '../models/trace/ModelImpl.js' // NEVER ALLOWED
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Additionally, you **must import using the `import * as` syntax**.
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
import {ModelImpl, X, Y} from '../models/trace/trace.js'; // BAD
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
import * as Trace from '../models/trace/trace.js'; // GOOD
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Importing from within the same module
|
|
40
|
+
|
|
41
|
+
If you are within the same module, it is OK to import from files directly rather than go via the entrypoint. You can also import specifically what you need.
|
|
42
|
+
|
|
43
|
+
For example, if you are editing `front_end/models/trace/ModelImpl.ts` this would be acceptable:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
import {Foo} from './Foo.js'; // allowed because Foo.ts is in the same directory.
|
|
47
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Instructions on how to verify your changes
|
|
2
|
+
|
|
3
|
+
## Testing
|
|
4
|
+
|
|
5
|
+
- 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.
|
|
6
|
+
- 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`.
|
|
7
|
+
- You can also test an entire directory. For example, `npm run test -- front_end/models/trace` will run all tests in that directory.
|
|
8
|
+
|
|
9
|
+
## Building & compiling
|
|
10
|
+
|
|
11
|
+
- Check for TypeScript or dependency issues in the build system by running `autoninja -C out/Default`.
|
|
12
|
+
|
|
13
|
+
## Fast builds
|
|
14
|
+
|
|
15
|
+
- If the `out/Fast` or `out/fast-build` directory exists, this means that a build that does not execute TypeScript is available to you which greatly decreases build time.
|
|
16
|
+
- To use the fast build for tests, pass the `--target=Fast` (adjust the value based on the name of the directory) argument to `npm run test`.
|
|
17
|
+
|
|
18
|
+
## Linting
|
|
19
|
+
|
|
20
|
+
- `npm run lint` will execute ESLint and StyleLint and report any violations that must be fixed.
|
|
21
|
+
|
|
22
|
+
## Best practices
|
|
23
|
+
|
|
24
|
+
- Run tests often to verify your changes.
|
|
25
|
+
- Prefer using a fast build, if it exists, to keep the feedback loop shorter.
|
|
26
|
+
- Periodically compile with TypeScript to check for type errors.
|
|
27
|
+
- Run linting at the end of your code changes.
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 -960 960 960" width="20px" fill="#e3e3e3"><path d="M449-449Zm97-87Zm-97 87Zm97-87Zm-97 87Zm97-87ZM768-90 90-768l51-51 678 678-51 51Zm-287.52-54Q339-144 241.5-185.85T144-288v-384q0-23 16-44.5t45-38.5l226 226q-65-4-120.5-18T216-583v109q44 32 111.5 49T480-408q17.96 0 35.02-.5 17.06-.5 34.12-2.5L612-348q-31 6-64.07 9-33.07 3-67.93 3-80 0-148.5-14.5T216-391v103q10 26 93.5 49T480-216q62 0 123-12t99-29l53 52q-45.91 28.22-117.59 44.61Q565.74-144 480.48-144ZM807-255l-63-63v-73q-11 6-23.94 11.33Q707.12-374.33 693-369l-57-57q32-8 59-20t49-28v-109q-40 22-94.5 35T532-530l-70-70q23 1 65-2.5t85.5-12q43.5-8.5 81-22.5t50.5-35q-18-28-98.5-50T480-744q-37 0-74 4.5T335-727l-59-59q43-14 94.5-22t109.5-8q139.07 0 237.53 42Q816-732 816-672v384q0 8-2 16.5t-7 16.5Z"/></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 -960 960 960" width="20px" fill="#e3e3e3"><path d="M720-240q25 0 42.5-17.5T780-300q0-25-17.5-42.5T720-360q-25 0-42.5 17.5T660-300q0 25 17.5 42.5T720-240Zm0 120q32 0 59-16t43-42q-23-13-48.5-19.5T720-204q-28 0-53.5 7T618-178q16 26 43 42t59 16ZM360-624h240v-96q0-50-35-85t-85-35q-50 0-85 35t-35 85v96ZM499-96H264q-29.7 0-50.85-21.15Q192-138.3 192-168v-384q0-29.7 21.15-50.85Q234.3-624 264-624h24v-96q0-79.68 56.23-135.84 56.22-56.16 136-56.16Q560-912 616-855.84q56 56.16 56 135.84v96h24q29.7 0 50.85 21.15Q768-581.7 768-552v53q-17.05-3-35.53-4.5Q714-505 696-503v-49H264v384h202q6 20 14 38t19 34Zm220.77 48Q640-48 584-104.23q-56-56.22-56-136Q528-320 584.23-376q56.22-56 136-56Q800-432 856-375.77q56 56.22 56 136Q912-160 855.77-104q-56.22 56-136 56ZM264-552v384-384Z"/></svg>
|
|
@@ -9,7 +9,16 @@ export const debounce = function(func: (...args: any[]) => void, delay: number):
|
|
|
9
9
|
let timer: ReturnType<typeof setTimeout>;
|
|
10
10
|
const debounced = (...args: any[]): void => {
|
|
11
11
|
clearTimeout(timer);
|
|
12
|
-
timer = setTimeout(() => func(...args), delay);
|
|
12
|
+
timer = setTimeout(() => func(...args), testDebounceOverride ? 0 : delay);
|
|
13
13
|
};
|
|
14
14
|
return debounced;
|
|
15
15
|
};
|
|
16
|
+
|
|
17
|
+
let testDebounceOverride = false;
|
|
18
|
+
export function enableTestOverride(): void {
|
|
19
|
+
testDebounceOverride = true;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function disableTestOverride(): void {
|
|
23
|
+
testDebounceOverride = false;
|
|
24
|
+
}
|
|
@@ -277,7 +277,7 @@ export interface SettingRegistration {
|
|
|
277
277
|
* The name of the experiment a setting is associated with. Enabling and disabling the declared
|
|
278
278
|
* experiment will enable and disable the setting respectively.
|
|
279
279
|
*/
|
|
280
|
-
experiment?: Root.
|
|
280
|
+
experiment?: Root.ExperimentNames.ExperimentName;
|
|
281
281
|
/**
|
|
282
282
|
* A condition is a function that will make the setting available if it
|
|
283
283
|
* returns true, and not available, otherwise. Make sure that objects you
|
|
@@ -531,6 +531,14 @@ export class AidaClient {
|
|
|
531
531
|
if (!InspectorFrontendHostInstance.doAidaConversation) {
|
|
532
532
|
throw new Error('doAidaConversation is not available');
|
|
533
533
|
}
|
|
534
|
+
|
|
535
|
+
// Disable logging for now.
|
|
536
|
+
// For context, see b/454563259#comment35.
|
|
537
|
+
// We should be able to remove this ~end of April.
|
|
538
|
+
if (Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled) {
|
|
539
|
+
request.metadata.disable_user_content_logging = true;
|
|
540
|
+
}
|
|
541
|
+
|
|
534
542
|
const stream = (() => {
|
|
535
543
|
let {promise, resolve, reject} = Promise.withResolvers<string|null>();
|
|
536
544
|
options?.signal?.addEventListener('abort', () => {
|
|
@@ -536,13 +536,7 @@ export const enum EnumeratedHistogram {
|
|
|
536
536
|
DeveloperResourceScheme = 'DevTools.DeveloperResourceScheme',
|
|
537
537
|
Language = 'DevTools.Language',
|
|
538
538
|
SyncSetting = 'DevTools.SyncSetting',
|
|
539
|
-
RecordingAssertion = 'DevTools.RecordingAssertion',
|
|
540
|
-
RecordingCodeToggled = 'DevTools.RecordingCodeToggled',
|
|
541
|
-
RecordingCopiedToClipboard = 'DevTools.RecordingCopiedToClipboard',
|
|
542
|
-
RecordingEdited = 'DevTools.RecordingEdited',
|
|
543
|
-
RecordingExported = 'DevTools.RecordingExported',
|
|
544
539
|
RecordingReplayFinished = 'DevTools.RecordingReplayFinished',
|
|
545
|
-
RecordingReplaySpeed = 'DevTools.RecordingReplaySpeed',
|
|
546
540
|
RecordingReplayStarted = 'DevTools.RecordingReplayStarted',
|
|
547
541
|
RecordingToggled = 'DevTools.RecordingToggled',
|
|
548
542
|
SourcesPanelFileDebugged = 'DevTools.SourcesPanelFileDebugged',
|
|
@@ -209,11 +209,6 @@ export class UserMetrics {
|
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
recordingAssertion(value: RecordingAssertion): void {
|
|
213
|
-
InspectorFrontendHostInstance.recordEnumeratedHistogram(
|
|
214
|
-
EnumeratedHistogram.RecordingAssertion, value, RecordingAssertion.MAX_VALUE);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
212
|
recordingToggled(value: RecordingToggled): void {
|
|
218
213
|
InspectorFrontendHostInstance.recordEnumeratedHistogram(
|
|
219
214
|
EnumeratedHistogram.RecordingToggled, value, RecordingToggled.MAX_VALUE);
|
|
@@ -224,36 +219,11 @@ export class UserMetrics {
|
|
|
224
219
|
EnumeratedHistogram.RecordingReplayFinished, value, RecordingReplayFinished.MAX_VALUE);
|
|
225
220
|
}
|
|
226
221
|
|
|
227
|
-
recordingReplaySpeed(value: RecordingReplaySpeed): void {
|
|
228
|
-
InspectorFrontendHostInstance.recordEnumeratedHistogram(
|
|
229
|
-
EnumeratedHistogram.RecordingReplaySpeed, value, RecordingReplaySpeed.MAX_VALUE);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
222
|
recordingReplayStarted(value: RecordingReplayStarted): void {
|
|
233
223
|
InspectorFrontendHostInstance.recordEnumeratedHistogram(
|
|
234
224
|
EnumeratedHistogram.RecordingReplayStarted, value, RecordingReplayStarted.MAX_VALUE);
|
|
235
225
|
}
|
|
236
226
|
|
|
237
|
-
recordingEdited(value: RecordingEdited): void {
|
|
238
|
-
InspectorFrontendHostInstance.recordEnumeratedHistogram(
|
|
239
|
-
EnumeratedHistogram.RecordingEdited, value, RecordingEdited.MAX_VALUE);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
recordingExported(value: RecordingExported): void {
|
|
243
|
-
InspectorFrontendHostInstance.recordEnumeratedHistogram(
|
|
244
|
-
EnumeratedHistogram.RecordingExported, value, RecordingExported.MAX_VALUE);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
recordingCodeToggled(value: RecordingCodeToggled): void {
|
|
248
|
-
InspectorFrontendHostInstance.recordEnumeratedHistogram(
|
|
249
|
-
EnumeratedHistogram.RecordingCodeToggled, value, RecordingCodeToggled.MAX_VALUE);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
recordingCopiedToClipboard(value: RecordingCopiedToClipboard): void {
|
|
253
|
-
InspectorFrontendHostInstance.recordEnumeratedHistogram(
|
|
254
|
-
EnumeratedHistogram.RecordingCopiedToClipboard, value, RecordingCopiedToClipboard.MAX_VALUE);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
227
|
lighthouseModeRun(type: LighthouseModeRun): void {
|
|
258
228
|
InspectorFrontendHostInstance.recordEnumeratedHistogram(
|
|
259
229
|
EnumeratedHistogram.LighthouseModeRun, type, LighthouseModeRun.MAX_VALUE);
|
|
@@ -825,7 +795,7 @@ export enum DevtoolsExperiments {
|
|
|
825
795
|
'live-heap-profile' = 11,
|
|
826
796
|
'protocol-monitor' = 13,
|
|
827
797
|
'sampling-heap-profiler-timeline' = 17,
|
|
828
|
-
'show-option-
|
|
798
|
+
'show-option-to-expose-internals-in-heap-snapshot' = 18,
|
|
829
799
|
'timeline-invalidation-tracking' = 26,
|
|
830
800
|
'timeline-show-all-events' = 27,
|
|
831
801
|
'timeline-v8-runtime-call-stats' = 28,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright 2026 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
export enum ExperimentName {
|
|
6
|
+
ALL = '*',
|
|
7
|
+
CAPTURE_NODE_CREATION_STACKS = 'capture-node-creation-stacks',
|
|
8
|
+
LIVE_HEAP_PROFILE = 'live-heap-profile',
|
|
9
|
+
PROTOCOL_MONITOR = 'protocol-monitor',
|
|
10
|
+
SAMPLING_HEAP_PROFILER_TIMELINE = 'sampling-heap-profiler-timeline',
|
|
11
|
+
SHOW_OPTION_TO_EXPOSE_INTERNALS_IN_HEAP_SNAPSHOT = 'show-option-to-expose-internals-in-heap-snapshot',
|
|
12
|
+
TIMELINE_INVALIDATION_TRACKING = 'timeline-invalidation-tracking',
|
|
13
|
+
TIMELINE_SHOW_ALL_EVENTS = 'timeline-show-all-events',
|
|
14
|
+
TIMELINE_V8_RUNTIME_CALL_STATS = 'timeline-v8-runtime-call-stats',
|
|
15
|
+
APCA = 'apca',
|
|
16
|
+
FONT_EDITOR = 'font-editor',
|
|
17
|
+
FULL_ACCESSIBILITY_TREE = 'full-accessibility-tree',
|
|
18
|
+
CONTRAST_ISSUES = 'contrast-issues',
|
|
19
|
+
EXPERIMENTAL_COOKIE_FEATURES = 'experimental-cookie-features',
|
|
20
|
+
INSTRUMENTATION_BREAKPOINTS = 'instrumentation-breakpoints',
|
|
21
|
+
AUTHORED_DEPLOYED_GROUPING = 'authored-deployed-grouping',
|
|
22
|
+
JUST_MY_CODE = 'just-my-code',
|
|
23
|
+
USE_SOURCE_MAP_SCOPES = 'use-source-map-scopes',
|
|
24
|
+
TIMELINE_SHOW_POST_MESSAGE_EVENTS = 'timeline-show-postmessage-events',
|
|
25
|
+
TIMELINE_DEBUG_MODE = 'timeline-debug-mode',
|
|
26
|
+
// Adding or removing an entry from this enum?
|
|
27
|
+
// You will need to update:
|
|
28
|
+
// 1. DevToolsExperiments enum in host/UserMetrics.ts
|
|
29
|
+
// 2. Maybe REGISTERED_EXPERIMENTS in EnvironmentHelpers.ts (to create this experiment in the test env)
|
|
30
|
+
}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Platform from '../platform/platform.js';
|
|
6
6
|
|
|
7
|
+
import type {ExperimentName} from './ExperimentNames.js';
|
|
8
|
+
|
|
7
9
|
let runtimePlatform = '';
|
|
8
10
|
|
|
9
11
|
let runtimeInstance: Runtime|undefined;
|
|
@@ -119,11 +121,17 @@ export class Runtime {
|
|
|
119
121
|
if (experiment === '*') {
|
|
120
122
|
return true;
|
|
121
123
|
}
|
|
122
|
-
if (experiment
|
|
123
|
-
|
|
124
|
+
if (experiment?.startsWith('!')) {
|
|
125
|
+
const experimentName = experiment.substring(1) as ExperimentName;
|
|
126
|
+
if (experiments.isEnabled(experimentName)) {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
124
129
|
}
|
|
125
|
-
if (experiment && !experiment.startsWith('!')
|
|
126
|
-
|
|
130
|
+
if (experiment && !experiment.startsWith('!')) {
|
|
131
|
+
const experimentName = experiment as ExperimentName;
|
|
132
|
+
if (!experiments.isEnabled(experimentName)) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
127
135
|
}
|
|
128
136
|
const {condition} = descriptor;
|
|
129
137
|
return condition ? condition(hostConfig) : true;
|
|
@@ -151,10 +159,10 @@ export interface Option {
|
|
|
151
159
|
|
|
152
160
|
export class ExperimentsSupport {
|
|
153
161
|
#experiments: Experiment[] = [];
|
|
154
|
-
readonly #experimentNames = new Set<
|
|
155
|
-
readonly #enabledTransiently = new Set<
|
|
156
|
-
readonly #enabledByDefault = new Set<
|
|
157
|
-
readonly #serverEnabled = new Set<
|
|
162
|
+
readonly #experimentNames = new Set<ExperimentName>();
|
|
163
|
+
readonly #enabledTransiently = new Set<ExperimentName>();
|
|
164
|
+
readonly #enabledByDefault = new Set<ExperimentName>();
|
|
165
|
+
readonly #serverEnabled = new Set<ExperimentName>();
|
|
158
166
|
readonly #storage = new ExperimentStorage();
|
|
159
167
|
|
|
160
168
|
allConfigurableExperiments(): Experiment[] {
|
|
@@ -167,7 +175,7 @@ export class ExperimentsSupport {
|
|
|
167
175
|
return result;
|
|
168
176
|
}
|
|
169
177
|
|
|
170
|
-
register(experimentName:
|
|
178
|
+
register(experimentName: ExperimentName, experimentTitle: string, docLink?: string, feedbackLink?: string): void {
|
|
171
179
|
if (this.#experimentNames.has(experimentName)) {
|
|
172
180
|
throw new Error(`Duplicate registration of experiment '${experimentName}'`);
|
|
173
181
|
}
|
|
@@ -178,7 +186,7 @@ export class ExperimentsSupport {
|
|
|
178
186
|
feedbackLink as Platform.DevToolsPath.UrlString ?? Platform.DevToolsPath.EmptyUrlString));
|
|
179
187
|
}
|
|
180
188
|
|
|
181
|
-
isEnabled(experimentName:
|
|
189
|
+
isEnabled(experimentName: ExperimentName): boolean {
|
|
182
190
|
this.checkExperiment(experimentName);
|
|
183
191
|
// Check for explicitly disabled #experiments first - the code could call setEnable(false) on the experiment enabled
|
|
184
192
|
// by default and we should respect that.
|
|
@@ -195,38 +203,39 @@ export class ExperimentsSupport {
|
|
|
195
203
|
return Boolean(this.#storage.get(experimentName));
|
|
196
204
|
}
|
|
197
205
|
|
|
198
|
-
setEnabled(experimentName:
|
|
206
|
+
setEnabled(experimentName: ExperimentName, enabled: boolean): void {
|
|
199
207
|
this.checkExperiment(experimentName);
|
|
200
208
|
this.#storage.set(experimentName, enabled);
|
|
201
209
|
}
|
|
202
210
|
|
|
203
|
-
enableExperimentsTransiently(experimentNames:
|
|
211
|
+
enableExperimentsTransiently(experimentNames: ExperimentName[]): void {
|
|
204
212
|
for (const experimentName of experimentNames) {
|
|
205
213
|
this.checkExperiment(experimentName);
|
|
206
214
|
this.#enabledTransiently.add(experimentName);
|
|
207
215
|
}
|
|
208
216
|
}
|
|
209
217
|
|
|
210
|
-
enableExperimentsByDefault(experimentNames:
|
|
218
|
+
enableExperimentsByDefault(experimentNames: ExperimentName[]): void {
|
|
211
219
|
for (const experimentName of experimentNames) {
|
|
212
220
|
this.checkExperiment(experimentName);
|
|
213
221
|
this.#enabledByDefault.add(experimentName);
|
|
214
222
|
}
|
|
215
223
|
}
|
|
216
224
|
|
|
217
|
-
setServerEnabledExperiments(
|
|
218
|
-
for (const experiment of
|
|
219
|
-
|
|
220
|
-
this
|
|
225
|
+
setServerEnabledExperiments(experiments: string[]): void {
|
|
226
|
+
for (const experiment of experiments) {
|
|
227
|
+
const experimentName = experiment as ExperimentName;
|
|
228
|
+
this.checkExperiment(experimentName);
|
|
229
|
+
this.#serverEnabled.add(experimentName);
|
|
221
230
|
}
|
|
222
231
|
}
|
|
223
232
|
|
|
224
|
-
enableForTest(experimentName:
|
|
233
|
+
enableForTest(experimentName: ExperimentName): void {
|
|
225
234
|
this.checkExperiment(experimentName);
|
|
226
235
|
this.#enabledTransiently.add(experimentName);
|
|
227
236
|
}
|
|
228
237
|
|
|
229
|
-
disableForTest(experimentName:
|
|
238
|
+
disableForTest(experimentName: ExperimentName): void {
|
|
230
239
|
this.checkExperiment(experimentName);
|
|
231
240
|
this.#enabledTransiently.delete(experimentName);
|
|
232
241
|
}
|
|
@@ -243,7 +252,7 @@ export class ExperimentsSupport {
|
|
|
243
252
|
this.#storage.cleanUpStaleExperiments(this.#experimentNames);
|
|
244
253
|
}
|
|
245
254
|
|
|
246
|
-
private checkExperiment(experimentName:
|
|
255
|
+
private checkExperiment(experimentName: ExperimentName): void {
|
|
247
256
|
if (!this.#experimentNames.has(experimentName)) {
|
|
248
257
|
throw new Error(`Unknown experiment '${experimentName}'`);
|
|
249
258
|
}
|
|
@@ -271,11 +280,11 @@ class ExperimentStorage {
|
|
|
271
280
|
* - false: Explicitly disabled.
|
|
272
281
|
* - undefined: Disabled.
|
|
273
282
|
*/
|
|
274
|
-
get(experimentName:
|
|
283
|
+
get(experimentName: ExperimentName): boolean|undefined {
|
|
275
284
|
return this.#experiments[experimentName];
|
|
276
285
|
}
|
|
277
286
|
|
|
278
|
-
set(experimentName:
|
|
287
|
+
set(experimentName: ExperimentName, enabled: boolean): void {
|
|
279
288
|
this.#experiments[experimentName] = enabled;
|
|
280
289
|
this.#syncToLocalStorage();
|
|
281
290
|
}
|
|
@@ -294,14 +303,18 @@ class ExperimentStorage {
|
|
|
294
303
|
}
|
|
295
304
|
}
|
|
296
305
|
|
|
306
|
+
/**
|
|
307
|
+
* @deprecated Experiments should not be used anymore, instead use base::Feature.
|
|
308
|
+
* See docs/contributing/settings-experiments-features.md
|
|
309
|
+
*/
|
|
297
310
|
export class Experiment {
|
|
298
|
-
name:
|
|
311
|
+
name: ExperimentName;
|
|
299
312
|
title: string;
|
|
300
313
|
docLink?: Platform.DevToolsPath.UrlString;
|
|
301
314
|
readonly feedbackLink?: Platform.DevToolsPath.UrlString;
|
|
302
315
|
readonly #experiments: ExperimentsSupport;
|
|
303
316
|
constructor(
|
|
304
|
-
experiments: ExperimentsSupport, name:
|
|
317
|
+
experiments: ExperimentsSupport, name: ExperimentName, title: string, docLink: Platform.DevToolsPath.UrlString,
|
|
305
318
|
feedbackLink: Platform.DevToolsPath.UrlString) {
|
|
306
319
|
this.name = name;
|
|
307
320
|
this.title = title;
|
|
@@ -322,30 +335,6 @@ export class Experiment {
|
|
|
322
335
|
/** This must be constructed after the query parameters have been parsed. **/
|
|
323
336
|
export const experiments = new ExperimentsSupport();
|
|
324
337
|
|
|
325
|
-
/**
|
|
326
|
-
* @deprecated Experiments should not be used anymore, instead use base::Feature.
|
|
327
|
-
* See docs/contributing/settings-experiments-features.md
|
|
328
|
-
*/
|
|
329
|
-
export const enum ExperimentName {
|
|
330
|
-
CAPTURE_NODE_CREATION_STACKS = 'capture-node-creation-stacks',
|
|
331
|
-
CSS_OVERVIEW = 'css-overview',
|
|
332
|
-
LIVE_HEAP_PROFILE = 'live-heap-profile',
|
|
333
|
-
ALL = '*',
|
|
334
|
-
PROTOCOL_MONITOR = 'protocol-monitor',
|
|
335
|
-
FULL_ACCESSIBILITY_TREE = 'full-accessibility-tree',
|
|
336
|
-
HEADER_OVERRIDES = 'header-overrides',
|
|
337
|
-
INSTRUMENTATION_BREAKPOINTS = 'instrumentation-breakpoints',
|
|
338
|
-
AUTHORED_DEPLOYED_GROUPING = 'authored-deployed-grouping',
|
|
339
|
-
JUST_MY_CODE = 'just-my-code',
|
|
340
|
-
USE_SOURCE_MAP_SCOPES = 'use-source-map-scopes',
|
|
341
|
-
TIMELINE_SHOW_POST_MESSAGE_EVENTS = 'timeline-show-postmessage-events',
|
|
342
|
-
TIMELINE_DEBUG_MODE = 'timeline-debug-mode',
|
|
343
|
-
// Adding or removing an entry from this enum?
|
|
344
|
-
// You will need to update:
|
|
345
|
-
// 1. REGISTERED_EXPERIMENTS in EnvironmentHelpers.ts (to create this experiment in the test env)
|
|
346
|
-
// 2. DevToolsExperiments enum in host/UserMetrics.ts
|
|
347
|
-
}
|
|
348
|
-
|
|
349
338
|
export enum GenAiEnterprisePolicyValue {
|
|
350
339
|
ALLOW = 0,
|
|
351
340
|
ALLOW_WITHOUT_LOGGING = 1,
|
|
@@ -430,6 +419,10 @@ export interface HostConfigGreenDevUi {
|
|
|
430
419
|
enabled: boolean;
|
|
431
420
|
}
|
|
432
421
|
|
|
422
|
+
export interface HostConfigGeminiRebranding {
|
|
423
|
+
enabled: boolean;
|
|
424
|
+
}
|
|
425
|
+
|
|
433
426
|
export interface HostConfigVeLogging {
|
|
434
427
|
enabled: boolean;
|
|
435
428
|
testing: boolean;
|
|
@@ -462,6 +455,10 @@ export interface HostConfigThirdPartyCookieControls {
|
|
|
462
455
|
managedBlockThirdPartyCookies: string|boolean;
|
|
463
456
|
}
|
|
464
457
|
|
|
458
|
+
export interface HostConfigAiAssistanceV2 {
|
|
459
|
+
enabled: boolean;
|
|
460
|
+
}
|
|
461
|
+
|
|
465
462
|
interface AiGeneratedTimelineLabels {
|
|
466
463
|
enabled: boolean;
|
|
467
464
|
}
|
|
@@ -550,6 +547,7 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
|
|
|
550
547
|
devToolsAiAssistanceNetworkAgent: HostConfigAiAssistanceNetworkAgent,
|
|
551
548
|
devToolsAiAssistanceFileAgent: HostConfigAiAssistanceFileAgent,
|
|
552
549
|
devToolsAiAssistancePerformanceAgent: HostConfigAiAssistancePerformanceAgent,
|
|
550
|
+
devToolsAiAssistanceV2: HostConfigAiAssistanceV2,
|
|
553
551
|
devToolsAiCodeCompletion: HostConfigAiCodeCompletion,
|
|
554
552
|
devToolsAiCodeGeneration: HostConfigAiCodeGeneration,
|
|
555
553
|
devToolsVeLogging: HostConfigVeLogging,
|
|
@@ -576,6 +574,7 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
|
|
|
576
574
|
devToolsEnableDurableMessages: DevToolsEnableDurableMessages,
|
|
577
575
|
devToolsAiAssistanceContextSelectionAgent: HostConfigAiAssistanceContextSelectionAgent,
|
|
578
576
|
devToolsConsoleInsightsTeasers: ConsoleInsightsTeasers,
|
|
577
|
+
devToolsGeminiRebranding: HostConfigGeminiRebranding,
|
|
579
578
|
}>;
|
|
580
579
|
|
|
581
580
|
/**
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as DevToolsContext from './DevToolsContext.js';
|
|
6
|
+
import * as ExperimentNames from './ExperimentNames.js';
|
|
6
7
|
import * as Runtime from './Runtime.js';
|
|
7
8
|
|
|
8
9
|
export {
|
|
9
10
|
DevToolsContext,
|
|
11
|
+
ExperimentNames,
|
|
10
12
|
Runtime,
|
|
11
13
|
};
|
|
@@ -379,6 +379,13 @@ export class CSSModel extends SDKModel<EventTypes> {
|
|
|
379
379
|
return await this.#styleLoader.computedStylePromise(nodeId);
|
|
380
380
|
}
|
|
381
381
|
|
|
382
|
+
async getComputedStyleExtraFields(nodeId: Protocol.DOM.NodeId): Promise<Protocol.CSS.ComputedStyleExtraFields> {
|
|
383
|
+
if (!this.isEnabled()) {
|
|
384
|
+
await this.enable();
|
|
385
|
+
}
|
|
386
|
+
return await this.#styleLoader.extraFieldsPromise(nodeId);
|
|
387
|
+
}
|
|
388
|
+
|
|
382
389
|
async getLayoutPropertiesFromComputedStyle(nodeId: Protocol.DOM.NodeId): Promise<LayoutProperties|null> {
|
|
383
390
|
const styles = await this.getComputedStyle(nodeId);
|
|
384
391
|
if (!styles) {
|
|
@@ -1051,32 +1058,48 @@ class CSSDispatcher implements ProtocolProxyApi.CSSDispatcher {
|
|
|
1051
1058
|
}
|
|
1052
1059
|
}
|
|
1053
1060
|
|
|
1061
|
+
interface ComputedStyleWithExtraFields {
|
|
1062
|
+
style: Map<string, string>|null;
|
|
1063
|
+
extraFields: Protocol.CSS.ComputedStyleExtraFields;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1054
1066
|
class ComputedStyleLoader {
|
|
1055
1067
|
#cssModel: CSSModel;
|
|
1056
|
-
#nodeIdToPromise = new Map<number, Promise<
|
|
1068
|
+
#nodeIdToPromise = new Map<number, Promise<ComputedStyleWithExtraFields>>();
|
|
1057
1069
|
constructor(cssModel: CSSModel) {
|
|
1058
1070
|
this.#cssModel = cssModel;
|
|
1059
1071
|
}
|
|
1060
1072
|
|
|
1061
|
-
|
|
1073
|
+
#getResponsePromise(nodeId: Protocol.DOM.NodeId): Promise<ComputedStyleWithExtraFields> {
|
|
1062
1074
|
let promise = this.#nodeIdToPromise.get(nodeId);
|
|
1063
1075
|
if (promise) {
|
|
1064
1076
|
return promise;
|
|
1065
1077
|
}
|
|
1066
|
-
promise =
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1078
|
+
promise =
|
|
1079
|
+
this.#cssModel.getAgent().invoke_getComputedStyleForNode({nodeId}).then(({computedStyle, extraFields}) => {
|
|
1080
|
+
this.#nodeIdToPromise.delete(nodeId);
|
|
1081
|
+
if (!computedStyle?.length) {
|
|
1082
|
+
return {style: null, extraFields};
|
|
1083
|
+
}
|
|
1084
|
+
const result = new Map<string, string>();
|
|
1085
|
+
for (const property of computedStyle) {
|
|
1086
|
+
result.set(property.name, property.value);
|
|
1087
|
+
}
|
|
1088
|
+
return {style: result, extraFields};
|
|
1089
|
+
});
|
|
1077
1090
|
this.#nodeIdToPromise.set(nodeId, promise);
|
|
1078
1091
|
return promise;
|
|
1079
1092
|
}
|
|
1093
|
+
|
|
1094
|
+
async computedStylePromise(nodeId: Protocol.DOM.NodeId): Promise<Map<string, string>|null> {
|
|
1095
|
+
const computedStyleWithExtraFields = await this.#getResponsePromise(nodeId);
|
|
1096
|
+
return computedStyleWithExtraFields.style;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
async extraFieldsPromise(nodeId: Protocol.DOM.NodeId): Promise<Protocol.CSS.ComputedStyleExtraFields> {
|
|
1100
|
+
const computedStyleWithExtraFields = await this.#getResponsePromise(nodeId);
|
|
1101
|
+
return computedStyleWithExtraFields.extraFields;
|
|
1102
|
+
}
|
|
1080
1103
|
}
|
|
1081
1104
|
|
|
1082
1105
|
export class InlineStyleResult {
|
|
@@ -115,7 +115,7 @@ export class CSSProperty extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
115
115
|
const matchers = matchedStyles.propertyMatchers(this.ownerStyle, computedStyles);
|
|
116
116
|
|
|
117
117
|
matchers.push(new CSSWideKeywordMatcher(this, matchedStyles));
|
|
118
|
-
if (Root.Runtime.experiments.isEnabled(
|
|
118
|
+
if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.FONT_EDITOR)) {
|
|
119
119
|
matchers.push(new FontMatcher());
|
|
120
120
|
}
|
|
121
121
|
return matchers;
|
|
@@ -983,6 +983,9 @@ export const enum ArithmeticFunction {
|
|
|
983
983
|
CALC = 'calc',
|
|
984
984
|
SIBLING_COUNT = 'sibling-count',
|
|
985
985
|
SIBLING_INDEX = 'sibling-index',
|
|
986
|
+
ROUND = 'round',
|
|
987
|
+
MOD = 'mod',
|
|
988
|
+
REM = 'rem',
|
|
986
989
|
}
|
|
987
990
|
type MathFunction = SelectFunction|ArithmeticFunction;
|
|
988
991
|
|
|
@@ -1000,6 +1003,9 @@ export class MathFunctionMatch extends BaseFunctionMatch<MathFunction> {
|
|
|
1000
1003
|
case ArithmeticFunction.CALC:
|
|
1001
1004
|
case ArithmeticFunction.SIBLING_COUNT:
|
|
1002
1005
|
case ArithmeticFunction.SIBLING_INDEX:
|
|
1006
|
+
case ArithmeticFunction.ROUND:
|
|
1007
|
+
case ArithmeticFunction.MOD:
|
|
1008
|
+
case ArithmeticFunction.REM:
|
|
1003
1009
|
return true;
|
|
1004
1010
|
}
|
|
1005
1011
|
// This assignment catches missed values in the switch above.
|
|
@@ -1021,6 +1027,9 @@ export class MathFunctionMatcher extends matcherBase(MathFunctionMatch) {
|
|
|
1021
1027
|
case ArithmeticFunction.CALC:
|
|
1022
1028
|
case ArithmeticFunction.SIBLING_COUNT:
|
|
1023
1029
|
case ArithmeticFunction.SIBLING_INDEX:
|
|
1030
|
+
case ArithmeticFunction.ROUND:
|
|
1031
|
+
case ArithmeticFunction.MOD:
|
|
1032
|
+
case ArithmeticFunction.REM:
|
|
1024
1033
|
return maybeFunc;
|
|
1025
1034
|
}
|
|
1026
1035
|
// This assignment catches missed values in the switch above.
|
|
@@ -99,7 +99,8 @@ export class CookieModel extends SDKModel<EventTypes> {
|
|
|
99
99
|
if (cookie.expires()) {
|
|
100
100
|
expires = Math.floor(Date.parse(`${cookie.expires()}`) / 1000);
|
|
101
101
|
}
|
|
102
|
-
const enabled =
|
|
102
|
+
const enabled =
|
|
103
|
+
Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.EXPERIMENTAL_COOKIE_FEATURES);
|
|
103
104
|
const preserveUnset = (scheme: Protocol.Network.CookieSourceScheme): Protocol.Network.CookieSourceScheme.Unset|
|
|
104
105
|
undefined => scheme === Protocol.Network.CookieSourceScheme.Unset ? scheme : undefined;
|
|
105
106
|
const protocolCookie = {
|
|
@@ -1319,7 +1319,7 @@ export class DOMModel extends SDKModel<EventTypes> {
|
|
|
1319
1319
|
void this.agent.invoke_enable({});
|
|
1320
1320
|
}
|
|
1321
1321
|
|
|
1322
|
-
if (Root.Runtime.experiments.isEnabled(
|
|
1322
|
+
if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.CAPTURE_NODE_CREATION_STACKS)) {
|
|
1323
1323
|
void this.agent.invoke_setNodeStackTracesEnabled({enable: true});
|
|
1324
1324
|
}
|
|
1325
1325
|
}
|
|
@@ -267,7 +267,7 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
|
|
267
267
|
const maxScriptsCacheSize = isRemoteFrontend ? 10e6 : 100e6;
|
|
268
268
|
const enablePromise = this.agent.invoke_enable({maxScriptsCacheSize});
|
|
269
269
|
let instrumentationPromise: Promise<Protocol.Debugger.SetInstrumentationBreakpointResponse>|undefined;
|
|
270
|
-
if (Root.Runtime.experiments.isEnabled(Root.
|
|
270
|
+
if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.INSTRUMENTATION_BREAKPOINTS)) {
|
|
271
271
|
instrumentationPromise = this.agent.invoke_setInstrumentationBreakpoint({
|
|
272
272
|
instrumentation: Protocol.Debugger.SetInstrumentationBreakpointRequestInstrumentation.BeforeScriptExecution,
|
|
273
273
|
});
|