chrome-devtools-frontend 1.0.1681498 → 1.0.1683520
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/eslint.config.mjs +8 -3
- package/front_end/core/sdk/ConsoleModel.ts +1 -1
- package/front_end/core/sdk/PreloadingModel.ts +44 -22
- package/front_end/core/sdk/RemoteObject.ts +4 -1
- package/front_end/core/sdk/RuntimeModel.ts +5 -5
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +1 -1
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +5 -2
- package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +2 -10
- package/front_end/entrypoints/main/MainImpl.ts +13 -13
- package/front_end/entrypoints/main/main-meta.ts +4 -20
- package/front_end/entrypoints/shell/shell.ts +0 -2
- package/front_end/entrypoints/trace_app/trace_app.ts +0 -2
- package/front_end/generated/InspectorBackendCommands.ts +3 -1
- package/front_end/generated/protocol-mapping.d.ts +16 -0
- package/front_end/generated/protocol-proxy-api.d.ts +12 -0
- package/front_end/generated/protocol.ts +25 -1
- package/front_end/models/ai_assistance/ExtensionScope.ts +11 -12
- package/front_end/models/ai_assistance/agents/AiAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +2 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +2 -1
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +2 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +8 -8
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +8 -8
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +1 -0
- package/front_end/models/formatter/ScriptFormatter.ts +1 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +9 -1
- package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +4 -4
- package/front_end/models/logs/NetworkLog.ts +8 -1
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +4 -2
- package/front_end/models/stack_trace/StackTraceImpl.ts +1 -0
- package/front_end/models/trace/Name.ts +5 -5
- package/front_end/models/trace/Processor.ts +1 -0
- package/front_end/models/trace/Styles.ts +115 -115
- package/front_end/models/trace/extras/TraceTree.ts +2 -1
- package/front_end/models/trace/helpers/Network.ts +4 -1
- package/front_end/models/trace/insights/CLSCulprits.ts +4 -2
- package/front_end/models/trace/insights/CharacterSet.ts +3 -3
- package/front_end/models/trace/insights/DOMSize.ts +1 -1
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +6 -2
- package/front_end/models/trace/insights/FontDisplay.ts +9 -3
- package/front_end/models/trace/insights/ForcedReflow.ts +4 -4
- package/front_end/models/trace/insights/INPBreakdown.ts +3 -4
- package/front_end/models/trace/insights/ImageDelivery.ts +2 -2
- package/front_end/models/trace/insights/LCPBreakdown.ts +1 -1
- package/front_end/models/trace/insights/LCPDiscovery.ts +5 -5
- package/front_end/models/trace/insights/LegacyJavaScript.ts +7 -3
- package/front_end/models/trace/insights/ModernHTTP.ts +3 -3
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +13 -9
- package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
- package/front_end/models/trace/insights/SlowCSSSelector.ts +29 -25
- package/front_end/models/trace/insights/ThirdParties.ts +13 -5
- package/front_end/models/trace/insights/Viewport.ts +4 -2
- package/front_end/models/workspace/IgnoreListManager.ts +53 -17
- package/front_end/panels/accessibility/ARIAAttributesView.ts +11 -2
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +67 -53
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -2
- package/front_end/panels/ai_assistance/components/StylingAgentMarkdownRenderer.ts +2 -2
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +5 -5
- package/front_end/panels/animation/AnimationTimeline.ts +2 -0
- package/front_end/panels/application/preloading/PreloadingView.ts +9 -3
- package/front_end/panels/application/preloading/components/components.ts +2 -0
- package/front_end/panels/browser_debugger/ObjectEventListenersSidebarPane.ts +10 -11
- package/front_end/panels/changes/CombinedDiffView.ts +1 -1
- package/front_end/panels/common/ExtensionServer.ts +9 -10
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +9 -4
- package/front_end/panels/elements/ElementStatePaneWidget.ts +3 -0
- package/front_end/panels/elements/ElementsPanel.ts +4 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +7 -1
- package/front_end/panels/elements/EventListenersWidget.ts +10 -11
- package/front_end/panels/issues/IssueView.ts +5 -6
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryViewer.ts +1 -1
- package/front_end/panels/media/PlayerPropertiesView.ts +309 -416
- package/front_end/panels/media/playerPropertiesView.css +1 -1
- package/front_end/panels/network/NetworkPanel.ts +2 -1
- package/front_end/panels/network/RequestPayloadView.ts +5 -2
- package/front_end/panels/network/components/ResponseHeaderSection.ts +1 -2
- package/front_end/panels/network/network-meta.ts +6 -0
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -1
- package/front_end/panels/recorder/RecordingView.ts +89 -73
- package/front_end/panels/recorder/ReplaySection.ts +59 -40
- package/front_end/panels/recorder/injected/injected.ts +4 -0
- package/front_end/panels/security/SecurityPanel.ts +5 -6
- package/front_end/panels/security/SecurityPanelSidebar.ts +244 -204
- package/front_end/panels/security/security.ts +0 -4
- package/front_end/panels/settings/EditFileSystemView.ts +8 -7
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +20 -14
- package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +10 -11
- package/front_end/panels/sources/SourcesPanel.ts +6 -3
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +3 -3
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +5 -5
- package/front_end/panels/timeline/components/CWVMetrics.ts +1 -2
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +5 -5
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +2 -3
- package/front_end/panels/timeline/components/LiveMetricsView.ts +2 -2
- package/front_end/panels/timeline/components/Sidebar.ts +3 -3
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -2
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +3 -1
- package/front_end/panels/timeline/components/insights/CLSCulprits.ts +1 -2
- package/front_end/panels/timeline/components/insights/Cache.ts +1 -2
- package/front_end/panels/timeline/components/insights/CharacterSet.ts +1 -2
- package/front_end/panels/timeline/components/insights/DOMSize.ts +1 -2
- package/front_end/panels/timeline/components/insights/DocumentLatency.ts +2 -2
- package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +2 -2
- package/front_end/panels/timeline/components/insights/FontDisplay.ts +1 -2
- package/front_end/panels/timeline/components/insights/ForcedReflow.ts +1 -2
- package/front_end/panels/timeline/components/insights/INPBreakdown.ts +1 -2
- package/front_end/panels/timeline/components/insights/ImageDelivery.ts +1 -2
- package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +13 -13
- package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +1 -2
- package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +4 -4
- package/front_end/panels/timeline/components/insights/ModernHTTP.ts +1 -2
- package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +10 -8
- package/front_end/panels/timeline/components/insights/RenderBlocking.ts +2 -2
- package/front_end/panels/timeline/components/insights/SidebarInsight.ts +3 -1
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
- package/front_end/panels/timeline/components/insights/ThirdParties.ts +1 -2
- package/front_end/panels/timeline/components/insights/Viewport.ts +1 -2
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -2
- package/front_end/panels/timeline/timeline.ts +0 -2
- package/front_end/panels/web_audio/WebAudioView.ts +7 -7
- package/front_end/panels/webauthn/WebauthnPane.ts +9 -9
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/diff_view/DiffView.ts +2 -1
- package/front_end/ui/components/report_view/ReportView.docs.ts +2 -2
- package/front_end/ui/components/text_editor/config.ts +2 -1
- package/front_end/ui/components/text_editor/javascript.ts +12 -13
- package/front_end/ui/legacy/GlassPane.ts +38 -14
- package/front_end/ui/legacy/Treeoutline.ts +14 -3
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +21 -30
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +3 -8
- package/front_end/ui/legacy/components/utils/ImagePreview.ts +15 -16
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +4 -4
- package/front_end/ui/legacy/components/utils/Linkifier.ts +8 -10
- package/front_end/ui/legacy/theme_support/ThemeSupport.ts +5 -2
- package/front_end/ui/settings/InspectorMainSettings.ts +19 -0
- package/front_end/ui/settings/MainSettings.ts +33 -0
- package/front_end/ui/settings/settings.ts +4 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +29 -0
- package/mcp/mcp.ts +0 -6
- package/package.json +1 -1
- package/front_end/models/logs/logs-meta.ts +0 -24
- package/front_end/models/workspace/workspace-meta.ts +0 -40
- package/front_end/panels/security/OriginTreeElement.ts +0 -60
- package/front_end/panels/security/SecurityPanelSidebarTreeElement.ts +0 -30
package/eslint.config.mjs
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import stylisticPlugin from '@stylistic/eslint-plugin';
|
|
6
|
-
import {
|
|
6
|
+
import {defineConfig, globalIgnores} from 'eslint/config';
|
|
7
7
|
import eslintPlugin from 'eslint-plugin-eslint-plugin';
|
|
8
8
|
import importPlugin from 'eslint-plugin-import';
|
|
9
9
|
import jsdocPlugin from 'eslint-plugin-jsdoc';
|
|
10
10
|
import litPlugin from 'eslint-plugin-lit';
|
|
11
11
|
import mochaPlugin from 'eslint-plugin-mocha';
|
|
12
12
|
import globals from 'globals';
|
|
13
|
-
import {
|
|
13
|
+
import {join} from 'node:path';
|
|
14
14
|
import typescriptEslint from 'typescript-eslint';
|
|
15
15
|
|
|
16
16
|
import devToolsPlugin from './scripts/eslint_rules/plugin.mjs';
|
|
@@ -731,8 +731,10 @@ export default defineConfig([
|
|
|
731
731
|
name: 'TypeScript test files',
|
|
732
732
|
files: [
|
|
733
733
|
'*.test.ts',
|
|
734
|
+
'*.docs.ts',
|
|
734
735
|
// This makes the specificity greater than the front-end ts files
|
|
735
736
|
'front_end/**/*.test.ts',
|
|
737
|
+
'front_end/**/*.docs.ts',
|
|
736
738
|
'test/**/*.ts',
|
|
737
739
|
'**/testing/*.ts',
|
|
738
740
|
'scripts/eslint_rules/test/**/*',
|
|
@@ -870,7 +872,10 @@ export default defineConfig([
|
|
|
870
872
|
{
|
|
871
873
|
name: 'Keep models/trace isolated',
|
|
872
874
|
files: ['front_end/models/trace/**/*.ts'],
|
|
873
|
-
ignores: [
|
|
875
|
+
ignores: [
|
|
876
|
+
'front_end/models/trace/**/*.test.ts',
|
|
877
|
+
'front_end/models/trace/**/*.docs.ts',
|
|
878
|
+
],
|
|
874
879
|
rules: {
|
|
875
880
|
'@devtools/no-imports-in-directory': [
|
|
876
881
|
'error',
|
|
@@ -145,7 +145,7 @@ export class ConsoleModel extends SDKModel<EventTypes> {
|
|
|
145
145
|
async evaluateCommandInConsole(
|
|
146
146
|
executionContext: ExecutionContext, originatingMessage: ConsoleMessage, expression: string,
|
|
147
147
|
useCommandLineAPI: boolean): Promise<void> {
|
|
148
|
-
const result = await executionContext.
|
|
148
|
+
const result = await executionContext.evaluateWithSelectedFrameFallback(
|
|
149
149
|
{
|
|
150
150
|
expression,
|
|
151
151
|
objectGroup: 'console',
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
|
|
6
6
|
import * as Protocol from '../../generated/protocol.js';
|
|
7
|
-
import
|
|
8
|
-
import {MapWithDefault} from '../common/MapWithDefault.js';
|
|
7
|
+
import * as Common from '../common/common.js';
|
|
9
8
|
import {assertNotNullOrUndefined} from '../platform/platform.js';
|
|
10
9
|
|
|
11
10
|
import {
|
|
@@ -652,12 +651,15 @@ class PreloadingAttemptRegistry {
|
|
|
652
651
|
private map: Map<PreloadingAttemptId, PreloadingAttemptInternal> =
|
|
653
652
|
new Map<PreloadingAttemptId, PreloadingAttemptInternal>();
|
|
654
653
|
private pipelines:
|
|
655
|
-
MapWithDefault<Protocol.Preload.PreloadPipelineId,
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
654
|
+
Common.MapWithDefault.MapWithDefault<Protocol.Preload.PreloadPipelineId,
|
|
655
|
+
Map<Protocol.Preload.SpeculationAction, PreloadingAttemptId>> =
|
|
656
|
+
new Common.MapWithDefault.MapWithDefault<Protocol.Preload.PreloadPipelineId,
|
|
657
|
+
Map<Protocol.Preload.SpeculationAction, PreloadingAttemptId>>();
|
|
658
|
+
|
|
659
|
+
private enrich(
|
|
660
|
+
attempt: PreloadingAttemptInternal,
|
|
661
|
+
source: Protocol.Preload.PreloadingAttemptSource|null,
|
|
662
|
+
): PreloadingAttempt {
|
|
661
663
|
let ruleSetIds: Protocol.Preload.RuleSetId[] = [];
|
|
662
664
|
let nodeIds: Protocol.DOM.BackendNodeId[] = [];
|
|
663
665
|
if (source !== null) {
|
|
@@ -706,12 +708,17 @@ class PreloadingAttemptRegistry {
|
|
|
706
708
|
if (pipeline.size === 0) {
|
|
707
709
|
throw new Error('unreachable');
|
|
708
710
|
}
|
|
709
|
-
return [...pipeline.keys()].every(
|
|
711
|
+
return [...pipeline.keys()].every(
|
|
712
|
+
action => getSortKey(action) <= getSortKey(attempt.action),
|
|
713
|
+
);
|
|
710
714
|
}
|
|
711
715
|
|
|
712
716
|
// Returns reference. Don't save returned values.
|
|
713
717
|
// Returned values may or may not be updated as the time grows.
|
|
714
|
-
getById(
|
|
718
|
+
getById(
|
|
719
|
+
id: PreloadingAttemptId,
|
|
720
|
+
sources: SourceRegistry,
|
|
721
|
+
): PreloadingAttempt|null {
|
|
715
722
|
const attempt = this.map.get(id) || null;
|
|
716
723
|
if (attempt === null) {
|
|
717
724
|
return null;
|
|
@@ -725,16 +732,23 @@ class PreloadingAttemptRegistry {
|
|
|
725
732
|
//
|
|
726
733
|
// Returns reference. Don't save returned values.
|
|
727
734
|
// Returned values may or may not be updated as the time grows.
|
|
728
|
-
getAllRepresentative(
|
|
729
|
-
|
|
735
|
+
getAllRepresentative(
|
|
736
|
+
ruleSetId: Protocol.Preload.RuleSetId|null,
|
|
737
|
+
sources: SourceRegistry,
|
|
738
|
+
): Array<WithId<PreloadingAttemptId, PreloadingAttempt>> {
|
|
730
739
|
return [...this.map.entries()]
|
|
731
|
-
.map(([id, value]) => ({
|
|
740
|
+
.map(([id, value]) => ({
|
|
741
|
+
id,
|
|
742
|
+
value: this.enrich(value, sources.getById(id)),
|
|
743
|
+
}))
|
|
732
744
|
.filter(({value}) => !ruleSetId || value.ruleSetIds.includes(ruleSetId))
|
|
733
745
|
.filter(({value}) => this.isAttemptRepresentative(value));
|
|
734
746
|
}
|
|
735
747
|
|
|
736
|
-
getPipeline(
|
|
737
|
-
|
|
748
|
+
getPipeline(
|
|
749
|
+
pipelineId: Protocol.Preload.PreloadPipelineId,
|
|
750
|
+
sources: SourceRegistry,
|
|
751
|
+
): Map<Protocol.Preload.SpeculationAction, PreloadingAttempt>|null {
|
|
738
752
|
const pipeline = this.pipelines.get(pipelineId);
|
|
739
753
|
|
|
740
754
|
if (pipeline === undefined || pipeline.size === 0) {
|
|
@@ -745,11 +759,13 @@ class PreloadingAttemptRegistry {
|
|
|
745
759
|
for (const [id, attempt] of this.map.entries()) {
|
|
746
760
|
map[id] = attempt;
|
|
747
761
|
}
|
|
748
|
-
return new Map(
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
762
|
+
return new Map(
|
|
763
|
+
pipeline.entries().map(([action, id]) => {
|
|
764
|
+
const attempt = this.getById(id, sources);
|
|
765
|
+
assertNotNullOrUndefined(attempt);
|
|
766
|
+
return [action, attempt];
|
|
767
|
+
}),
|
|
768
|
+
);
|
|
753
769
|
}
|
|
754
770
|
|
|
755
771
|
upsert(attempt: PreloadingAttemptInternal): void {
|
|
@@ -770,7 +786,10 @@ class PreloadingAttemptRegistry {
|
|
|
770
786
|
continue;
|
|
771
787
|
}
|
|
772
788
|
|
|
773
|
-
const pipeline = this.pipelines.getOrInsertComputed(
|
|
789
|
+
const pipeline = this.pipelines.getOrInsertComputed(
|
|
790
|
+
attempt.pipelineId,
|
|
791
|
+
() => new Map(),
|
|
792
|
+
);
|
|
774
793
|
pipeline.set(attempt.action, id);
|
|
775
794
|
}
|
|
776
795
|
}
|
|
@@ -830,7 +849,10 @@ class PreloadingAttemptRegistry {
|
|
|
830
849
|
// Removes keys in `this.map` that are not in `sources`. This is used to
|
|
831
850
|
// remove attempts that no longer have a matching speculation rule.
|
|
832
851
|
cleanUpRemovedAttempts(sources: SourceRegistry): void {
|
|
833
|
-
const keysToRemove = Array.from(this.map.keys())
|
|
852
|
+
const keysToRemove = Array.from(this.map.keys())
|
|
853
|
+
.filter(
|
|
854
|
+
key => !sources.getById(key),
|
|
855
|
+
);
|
|
834
856
|
for (const key of keysToRemove) {
|
|
835
857
|
this.map.delete(key);
|
|
836
858
|
}
|
|
@@ -4,11 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
|
|
6
6
|
import * as Protocol from '../../generated/protocol.js';
|
|
7
|
-
import type
|
|
7
|
+
import type * as Common from '../common/common.js';
|
|
8
8
|
|
|
9
9
|
import type {DebuggerModel, FunctionDetails} from './DebuggerModel.js';
|
|
10
10
|
import type {RuntimeModel} from './RuntimeModel.js';
|
|
11
11
|
|
|
12
|
+
type DOMPinnedWebIDLProp = Common.JavaScriptMetaData.DOMPinnedWebIDLProp;
|
|
13
|
+
type DOMPinnedWebIDLType = Common.JavaScriptMetaData.DOMPinnedWebIDLType;
|
|
14
|
+
|
|
12
15
|
/** This cannot be an interface due to "instanceof RemoteObject" checks in the code. **/
|
|
13
16
|
export abstract class RemoteObject {
|
|
14
17
|
static fromLocalObject(value: unknown): RemoteObject {
|
|
@@ -589,12 +589,13 @@ export class ExecutionContext {
|
|
|
589
589
|
return a.name.localeCompare(b.name);
|
|
590
590
|
}
|
|
591
591
|
|
|
592
|
-
async
|
|
592
|
+
async evaluateWithSelectedFrameFallback(options: EvaluationOptions, userGesture: boolean,
|
|
593
|
+
awaitPromise: boolean): Promise<EvaluationResult> {
|
|
593
594
|
// FIXME: It will be moved to separate ExecutionContext.
|
|
594
595
|
if (this.debuggerModel.selectedCallFrame()) {
|
|
595
596
|
return await this.debuggerModel.evaluateOnSelectedCallFrame(options);
|
|
596
597
|
}
|
|
597
|
-
return await this.
|
|
598
|
+
return await this.evaluate(options, userGesture, awaitPromise);
|
|
598
599
|
}
|
|
599
600
|
|
|
600
601
|
globalObject(objectGroup: string, generatePreview: boolean): Promise<EvaluationResult> {
|
|
@@ -606,7 +607,7 @@ export class ExecutionContext {
|
|
|
606
607
|
returnByValue: false,
|
|
607
608
|
generatePreview,
|
|
608
609
|
};
|
|
609
|
-
return this.
|
|
610
|
+
return this.evaluate((evaluationOptions as EvaluationOptions), false, false);
|
|
610
611
|
}
|
|
611
612
|
|
|
612
613
|
async callFunctionOn(options: CallFunctionOptions): Promise<EvaluationResult> {
|
|
@@ -629,8 +630,7 @@ export class ExecutionContext {
|
|
|
629
630
|
return {object: this.runtimeModel.createRemoteObject(response.result), exceptionDetails: response.exceptionDetails};
|
|
630
631
|
}
|
|
631
632
|
|
|
632
|
-
|
|
633
|
-
Promise<EvaluationResult> {
|
|
633
|
+
async evaluate(options: EvaluationOptions, userGesture: boolean, awaitPromise: boolean): Promise<EvaluationResult> {
|
|
634
634
|
if (!options.expression) {
|
|
635
635
|
// There is no expression, so the completion should happen against global properties.
|
|
636
636
|
options.expression = 'this';
|
|
@@ -67,6 +67,7 @@ import * as PaintProfiler from './PaintProfiler.js';
|
|
|
67
67
|
import * as PerformanceMetricsModel from './PerformanceMetricsModel.js';
|
|
68
68
|
import * as PreloadingModel from './PreloadingModel.js';
|
|
69
69
|
import * as RehydratingConnection from './RehydratingConnection.js';
|
|
70
|
+
import * as RehydratingObject from './RehydratingObject.js';
|
|
70
71
|
import * as RemoteObject from './RemoteObject.js';
|
|
71
72
|
import * as Resource from './Resource.js';
|
|
72
73
|
import * as ResourceTreeModel from './ResourceTreeModel.js';
|
|
@@ -153,6 +154,7 @@ export {
|
|
|
153
154
|
PerformanceMetricsModel,
|
|
154
155
|
PreloadingModel,
|
|
155
156
|
RehydratingConnection, // TODO(crbug.com/444191656): Exported for tests.
|
|
157
|
+
RehydratingObject,
|
|
156
158
|
RemoteObject,
|
|
157
159
|
Resource,
|
|
158
160
|
ResourceTreeModel,
|
|
@@ -6,7 +6,7 @@ import * as Platform from '../../core/platform/platform.js';
|
|
|
6
6
|
import * as Root from '../../core/root/root.js';
|
|
7
7
|
// This file is required to bring some types into scope, even though it
|
|
8
8
|
// is not used.
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @devtools/es-modules-import
|
|
10
10
|
import type * as CodeMirrorModule from '../../third_party/codemirror/codemirror-legacy.js';
|
|
11
11
|
|
|
12
12
|
import {CSSFormatter} from './CSSFormatter.js';
|
|
@@ -12,6 +12,7 @@ import * as MobileThrottling from '../../panels/mobile_throttling/mobile_throttl
|
|
|
12
12
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
13
13
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
14
14
|
import * as Lit from '../../ui/lit/lit.js';
|
|
15
|
+
import * as SettingsUI from '../../ui/settings/settings.js';
|
|
15
16
|
|
|
16
17
|
import nodeIconStyles from './nodeIcon.css.js';
|
|
17
18
|
|
|
@@ -247,11 +248,13 @@ export class BackendSettingsSync implements SDK.TargetManager.Observer {
|
|
|
247
248
|
readonly #emulatePageFocusSetting: Common.Settings.Setting<boolean>;
|
|
248
249
|
|
|
249
250
|
constructor() {
|
|
250
|
-
this.#autoAttachSetting = Common.Settings.Settings.instance().
|
|
251
|
+
this.#autoAttachSetting = Common.Settings.Settings.instance().resolve(
|
|
252
|
+
SettingsUI.InspectorMainSettings.autoAttachToCreatedPagesSettingDescriptor);
|
|
251
253
|
this.#autoAttachSetting.addChangeListener(this.#updateAutoAttach, this);
|
|
252
254
|
this.#updateAutoAttach();
|
|
253
255
|
|
|
254
|
-
this.#adBlockEnabledSetting = Common.Settings.Settings.instance().
|
|
256
|
+
this.#adBlockEnabledSetting = Common.Settings.Settings.instance().resolve(
|
|
257
|
+
SettingsUI.InspectorMainSettings.adBlockingEnabledSettingDescriptor);
|
|
255
258
|
this.#adBlockEnabledSetting.addChangeListener(this.#update, this);
|
|
256
259
|
|
|
257
260
|
this.#emulatePageFocusSetting =
|
|
@@ -447,13 +447,9 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
447
447
|
},
|
|
448
448
|
});
|
|
449
449
|
|
|
450
|
-
|
|
450
|
+
SettingsUI.SettingUIRegistration.register(SettingsUI.InspectorMainSettings.adBlockingEnabledSettingDescriptor, {
|
|
451
451
|
category: Common.Settings.SettingCategory.NETWORK,
|
|
452
452
|
title: i18nLazyString(UIStrings.forceAdBlocking),
|
|
453
|
-
settingName: 'network.ad-blocking-enabled',
|
|
454
|
-
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
455
|
-
storageType: Common.Settings.SettingStorageType.SESSION,
|
|
456
|
-
defaultValue: false,
|
|
457
453
|
options: [
|
|
458
454
|
{
|
|
459
455
|
value: true,
|
|
@@ -466,14 +462,10 @@ Common.Settings.registerSettingExtension({
|
|
|
466
462
|
],
|
|
467
463
|
});
|
|
468
464
|
|
|
469
|
-
|
|
465
|
+
SettingsUI.SettingUIRegistration.register(SettingsUI.InspectorMainSettings.autoAttachToCreatedPagesSettingDescriptor, {
|
|
470
466
|
category: Common.Settings.SettingCategory.GLOBAL,
|
|
471
|
-
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
472
467
|
title: i18nLazyString(UIStrings.autoOpenDevTools),
|
|
473
|
-
settingName: 'auto-attach-to-created-pages',
|
|
474
|
-
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
475
468
|
order: 2,
|
|
476
|
-
defaultValue: false,
|
|
477
469
|
options: [
|
|
478
470
|
{
|
|
479
471
|
value: true,
|
|
@@ -56,6 +56,7 @@ import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
|
56
56
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
57
57
|
import * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';
|
|
58
58
|
import {html, render} from '../../ui/lit/lit.js';
|
|
59
|
+
import * as SettingsUI from '../../ui/settings/settings.js';
|
|
59
60
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
60
61
|
|
|
61
62
|
import {ExecutionContextSelector} from './ExecutionContextSelector.js';
|
|
@@ -268,7 +269,8 @@ export class MainImpl {
|
|
|
268
269
|
}
|
|
269
270
|
|
|
270
271
|
async requestAndRegisterLocaleData(): Promise<void> {
|
|
271
|
-
const settingLanguage =
|
|
272
|
+
const settingLanguage =
|
|
273
|
+
Common.Settings.Settings.instance().resolve(SettingsUI.MainSettings.languageSettingDescriptor).get();
|
|
272
274
|
const devToolsLocale = i18n.DevToolsLocale.DevToolsLocale.instance({
|
|
273
275
|
create: true,
|
|
274
276
|
data: {
|
|
@@ -427,8 +429,7 @@ export class MainImpl {
|
|
|
427
429
|
Persistence.IsolatedFileSystemManager.Events.FileSystemError,
|
|
428
430
|
event => Snackbar.Snackbar.Snackbar.show({message: event.data}));
|
|
429
431
|
|
|
430
|
-
const
|
|
431
|
-
const themeSetting = Common.Settings.Settings.instance().createSetting('ui-theme', defaultThemeSetting);
|
|
432
|
+
const themeSetting = Common.Settings.Settings.instance().resolve(SettingsUI.MainSettings.uiThemeSettingDescriptor);
|
|
432
433
|
UI.UIUtils.initializeUIUtils(document);
|
|
433
434
|
|
|
434
435
|
// Initialize theme support and apply it.
|
|
@@ -595,16 +596,15 @@ export class MainImpl {
|
|
|
595
596
|
if (event.data.payload === 'true' || event.data.payload === 'false') {
|
|
596
597
|
VisualLogging.setVeDebuggingEnabled(event.data.payload === 'true', (query: string) => {
|
|
597
598
|
VisualLogging.setVeDebuggingEnabled(false);
|
|
598
|
-
void runtimeModel?.defaultExecutionContext()?.
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
/* awaitPromise */ false);
|
|
599
|
+
void runtimeModel?.defaultExecutionContext()?.evaluateWithSelectedFrameFallback({
|
|
600
|
+
expression: `window.inspect(${JSON.stringify(query)})`,
|
|
601
|
+
includeCommandLineAPI: false,
|
|
602
|
+
silent: true,
|
|
603
|
+
returnByValue: false,
|
|
604
|
+
generatePreview: false,
|
|
605
|
+
},
|
|
606
|
+
/* userGesture */ false,
|
|
607
|
+
/* awaitPromise */ false);
|
|
608
608
|
});
|
|
609
609
|
} else {
|
|
610
610
|
VisualLogging.setHighlightedVe(event.data.payload === 'null' ? null : event.data.payload);
|
|
@@ -658,13 +658,9 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
658
658
|
],
|
|
659
659
|
});
|
|
660
660
|
|
|
661
|
-
|
|
661
|
+
SettingsUI.SettingUIRegistration.register(SettingsUI.MainSettings.uiThemeSettingDescriptor, {
|
|
662
662
|
category: Common.Settings.SettingCategory.APPEARANCE,
|
|
663
|
-
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
664
663
|
title: i18nLazyString(UIStrings.theme),
|
|
665
|
-
settingName: 'ui-theme',
|
|
666
|
-
settingType: Common.Settings.SettingType.ENUM,
|
|
667
|
-
defaultValue: 'systemPreferred',
|
|
668
664
|
reloadRequired: false,
|
|
669
665
|
options: [
|
|
670
666
|
{
|
|
@@ -689,13 +685,9 @@ Common.Settings.registerSettingExtension({
|
|
|
689
685
|
],
|
|
690
686
|
});
|
|
691
687
|
|
|
692
|
-
|
|
688
|
+
SettingsUI.SettingUIRegistration.register(SettingsUI.MainSettings.chromeThemeColorsSettingDescriptor, {
|
|
693
689
|
category: Common.Settings.SettingCategory.APPEARANCE,
|
|
694
|
-
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
695
690
|
title: i18nLazyString(UIStrings.matchChromeColorScheme),
|
|
696
|
-
settingName: 'chrome-theme-colors',
|
|
697
|
-
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
698
|
-
defaultValue: true,
|
|
699
691
|
options: [
|
|
700
692
|
{
|
|
701
693
|
value: true,
|
|
@@ -713,13 +705,9 @@ Common.Settings.registerSettingExtension({
|
|
|
713
705
|
},
|
|
714
706
|
});
|
|
715
707
|
|
|
716
|
-
|
|
708
|
+
SettingsUI.SettingUIRegistration.register(SettingsUI.MainSettings.sidebarPositionSettingDescriptor, {
|
|
717
709
|
category: Common.Settings.SettingCategory.APPEARANCE,
|
|
718
|
-
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
719
710
|
title: i18nLazyString(UIStrings.panelLayout),
|
|
720
|
-
settingName: 'sidebar-position',
|
|
721
|
-
settingType: Common.Settings.SettingType.ENUM,
|
|
722
|
-
defaultValue: 'auto',
|
|
723
711
|
options: [
|
|
724
712
|
{
|
|
725
713
|
title: i18nLazyString(UIStrings.useHorizontalPanelLayout),
|
|
@@ -739,13 +727,9 @@ Common.Settings.registerSettingExtension({
|
|
|
739
727
|
],
|
|
740
728
|
});
|
|
741
729
|
|
|
742
|
-
|
|
730
|
+
SettingsUI.SettingUIRegistration.register(SettingsUI.MainSettings.languageSettingDescriptor, {
|
|
743
731
|
category: Common.Settings.SettingCategory.APPEARANCE,
|
|
744
|
-
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
745
|
-
settingName: 'language',
|
|
746
|
-
settingType: Common.Settings.SettingType.ENUM,
|
|
747
732
|
title: i18nLazyString(UIStrings.language),
|
|
748
|
-
defaultValue: 'en-US',
|
|
749
733
|
options: [
|
|
750
734
|
{
|
|
751
735
|
value: 'browserLanguage',
|
|
@@ -16,11 +16,9 @@ import '../../panels/changes/changes-meta.js';
|
|
|
16
16
|
import '../../panels/linear_memory_inspector/linear_memory_inspector-meta.js';
|
|
17
17
|
import '../../panels/settings/settings-meta.js';
|
|
18
18
|
import '../../panels/protocol_monitor/protocol_monitor-meta.js';
|
|
19
|
-
import '../../models/logs/logs-meta.js';
|
|
20
19
|
import '../main/main-meta.js';
|
|
21
20
|
import '../../ui/legacy/components/perf_ui/perf_ui-meta.js';
|
|
22
21
|
import '../../ui/legacy/components/quick_open/quick_open-meta.js';
|
|
23
|
-
import '../../models/workspace/workspace-meta.js';
|
|
24
22
|
import '../../ui/legacy/components/source_frame/source_frame-meta.js';
|
|
25
23
|
import '../../panels/console_counters/console_counters-meta.js';
|
|
26
24
|
import '../../panels/explain/explain-meta.js';
|
|
@@ -4,13 +4,11 @@
|
|
|
4
4
|
// found in the LICENSE file.
|
|
5
5
|
import '../main/main-meta.js';
|
|
6
6
|
import '../inspector_main/inspector_main-meta.js';
|
|
7
|
-
import '../../models/workspace/workspace-meta.js';
|
|
8
7
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
9
8
|
// @ts-ignore: tsc 6.0 does not support side-effect imports without a type definition.
|
|
10
9
|
// We cannot use `@ts-expect-error` here because the import is correctly resolved
|
|
11
10
|
// when bundling the application (which doesn't error) and only errors in unbundled builds.
|
|
12
11
|
import '../../Images/Images.js';
|
|
13
|
-
import '../../models/logs/logs-meta.js';
|
|
14
12
|
import '../../panels/browser_debugger/browser_debugger-meta.js';
|
|
15
13
|
import '../../panels/developer_resources/developer_resources-meta.js';
|
|
16
14
|
// panels/timeline depends on mobile_throttling for settings UI
|
|
@@ -226,6 +226,8 @@ inspectorBackend.registerCommand("Browser.setContentsSize", [{"name": "windowId"
|
|
|
226
226
|
inspectorBackend.registerCommand("Browser.setDockTile", [{"name": "badgeLabel", "type": "string", "optional": true, "description": "", "typeRef": null}, {"name": "image", "type": "string", "optional": true, "description": "Png encoded image.", "typeRef": null}], [], "Set dock tile details, platform-specific.");
|
|
227
227
|
inspectorBackend.registerCommand("Browser.executeBrowserCommand", [{"name": "commandId", "type": "string", "optional": false, "description": "", "typeRef": "Browser.BrowserCommandId"}], [], "Invoke custom browser commands used by telemetry.");
|
|
228
228
|
inspectorBackend.registerCommand("Browser.addPrivacySandboxEnrollmentOverride", [{"name": "url", "type": "string", "optional": false, "description": "", "typeRef": null}], [], "Allows a site to use privacy sandbox features that require enrollment without the site actually being enrolled. Only supported on page targets.");
|
|
229
|
+
inspectorBackend.registerCommand("Browser.getGlobalPrivacyControl", [], ["gpc"], "Gets the current globally-applied privacy control status See https://www.w3.org/TR/gpc/#get-global-privacy-control");
|
|
230
|
+
inspectorBackend.registerCommand("Browser.setGlobalPrivacyControl", [{"name": "gpc", "type": "boolean", "optional": false, "description": "", "typeRef": null}], ["gpc"], "Sets and then gets the current globally-applied privacy control status See https://www.w3.org/TR/gpc/#set-global-privacy-control");
|
|
229
231
|
inspectorBackend.registerType("Browser.Bounds", [{"name": "left", "type": "number", "optional": true, "description": "The offset from the left edge of the screen to the window in pixels.", "typeRef": null}, {"name": "top", "type": "number", "optional": true, "description": "The offset from the top edge of the screen to the window in pixels.", "typeRef": null}, {"name": "width", "type": "number", "optional": true, "description": "The window width in pixels.", "typeRef": null}, {"name": "height", "type": "number", "optional": true, "description": "The window height in pixels.", "typeRef": null}, {"name": "windowState", "type": "string", "optional": true, "description": "The window state. Default to normal.", "typeRef": "Browser.WindowState"}]);
|
|
230
232
|
inspectorBackend.registerType("Browser.PermissionDescriptor", [{"name": "name", "type": "string", "optional": false, "description": "Name of permission. See https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/permissions/permission_descriptor.idl for valid permission names.", "typeRef": null}, {"name": "sysex", "type": "boolean", "optional": true, "description": "For \\\"midi\\\" permission, may also specify sysex control.", "typeRef": null}, {"name": "userVisibleOnly", "type": "boolean", "optional": true, "description": "For \\\"push\\\" permission, may specify userVisibleOnly. Note that userVisibleOnly = true is the only currently supported type.", "typeRef": null}, {"name": "allowWithoutSanitization", "type": "boolean", "optional": true, "description": "For \\\"clipboard\\\" permission, may specify allowWithoutSanitization.", "typeRef": null}, {"name": "allowWithoutGesture", "type": "boolean", "optional": true, "description": "For \\\"fullscreen\\\" permission, must specify allowWithoutGesture:true.", "typeRef": null}, {"name": "panTiltZoom", "type": "boolean", "optional": true, "description": "For \\\"camera\\\" permission, may specify panTiltZoom.", "typeRef": null}]);
|
|
231
233
|
inspectorBackend.registerType("Browser.Bucket", [{"name": "low", "type": "number", "optional": false, "description": "Minimum value (inclusive).", "typeRef": null}, {"name": "high", "type": "number", "optional": false, "description": "Maximum value (exclusive).", "typeRef": null}, {"name": "count", "type": "number", "optional": false, "description": "Number of samples.", "typeRef": null}]);
|
|
@@ -1135,7 +1137,7 @@ inspectorBackend.registerCommand("Page.setLifecycleEventsEnabled", [{"name": "en
|
|
|
1135
1137
|
inspectorBackend.registerEnum("Page.SetTouchEmulationEnabledRequestConfiguration", {Mobile: "mobile", Desktop: "desktop"});
|
|
1136
1138
|
inspectorBackend.registerCommand("Page.setTouchEmulationEnabled", [{"name": "enabled", "type": "boolean", "optional": false, "description": "Whether the touch event emulation should be enabled.", "typeRef": null}, {"name": "configuration", "type": "string", "optional": true, "description": "Touch/gesture events configuration. Default: current platform.", "typeRef": "Page.SetTouchEmulationEnabledRequestConfiguration"}], [], "Toggles mouse event-based touch event emulation.");
|
|
1137
1139
|
inspectorBackend.registerEnum("Page.StartScreencastRequestFormat", {Jpeg: "jpeg", Png: "png"});
|
|
1138
|
-
inspectorBackend.registerCommand("Page.startScreencast", [{"name": "format", "type": "string", "optional": true, "description": "Image compression format.", "typeRef": "Page.StartScreencastRequestFormat"}, {"name": "quality", "type": "number", "optional": true, "description": "Compression quality from range [0..100].", "typeRef": null}, {"name": "maxWidth", "type": "number", "optional": true, "description": "Maximum screenshot width.", "typeRef": null}, {"name": "maxHeight", "type": "number", "optional": true, "description": "Maximum screenshot height.", "typeRef": null}, {"name": "everyNthFrame", "type": "number", "optional": true, "description": "Send every n-th frame.", "typeRef": null}], [], "Starts sending each frame using the `screencastFrame` event.");
|
|
1140
|
+
inspectorBackend.registerCommand("Page.startScreencast", [{"name": "format", "type": "string", "optional": true, "description": "Image compression format.", "typeRef": "Page.StartScreencastRequestFormat"}, {"name": "quality", "type": "number", "optional": true, "description": "Compression quality from range [0..100].", "typeRef": null}, {"name": "maxWidth", "type": "number", "optional": true, "description": "Maximum screenshot width.", "typeRef": null}, {"name": "maxHeight", "type": "number", "optional": true, "description": "Maximum screenshot height.", "typeRef": null}, {"name": "everyNthFrame", "type": "number", "optional": true, "description": "Send every n-th frame. Must be a positive integer.", "typeRef": null}, {"name": "maxFramesInFlight", "type": "number", "optional": true, "description": "Maximum number of frames sent until screencastFrameAck is required. Defaults to 3. Must be a positive integer.", "typeRef": null}, {"name": "sendLastFrame", "type": "boolean", "optional": true, "description": "By default, after screencastFrameAck arrives, the next produced frame is sent. Passing this flag enables storing the last produced frame in memory, which is immediately sent upon screencastFrameAck. This way, overall performance is traded for a better latency.", "typeRef": null}], [], "Starts sending each frame using the `screencastFrame` event.");
|
|
1139
1141
|
inspectorBackend.registerCommand("Page.startScreenRecording", [{"name": "audio", "type": "boolean", "optional": true, "description": "", "typeRef": null}, {"name": "maxWidth", "type": "number", "optional": true, "description": "Maximum frame width in pixels.", "typeRef": null}, {"name": "maxHeight", "type": "number", "optional": true, "description": "Maximum frame height in pixels.", "typeRef": null}, {"name": "frameRate", "type": "number", "optional": true, "description": "Maximum frame rate in frames per second.", "typeRef": null}], ["stream"], "Starts screencast video recording.");
|
|
1140
1142
|
inspectorBackend.registerCommand("Page.stopScreenRecording", [], ["stream"], "Stops screencast video recording.");
|
|
1141
1143
|
inspectorBackend.registerCommand("Page.stopLoading", [], [], "Force the page stop all navigations and pending resource fetches.");
|
|
@@ -1487,6 +1487,22 @@ export namespace ProtocolMapping {
|
|
|
1487
1487
|
paramsType: [Protocol.Browser.AddPrivacySandboxEnrollmentOverrideRequest];
|
|
1488
1488
|
returnType: void;
|
|
1489
1489
|
};
|
|
1490
|
+
/**
|
|
1491
|
+
* Gets the current globally-applied privacy control status
|
|
1492
|
+
* See https://www.w3.org/TR/gpc/#get-global-privacy-control
|
|
1493
|
+
*/
|
|
1494
|
+
'Browser.getGlobalPrivacyControl': {
|
|
1495
|
+
paramsType: [];
|
|
1496
|
+
returnType: Protocol.Browser.GetGlobalPrivacyControlResponse;
|
|
1497
|
+
};
|
|
1498
|
+
/**
|
|
1499
|
+
* Sets and then gets the current globally-applied privacy control status
|
|
1500
|
+
* See https://www.w3.org/TR/gpc/#set-global-privacy-control
|
|
1501
|
+
*/
|
|
1502
|
+
'Browser.setGlobalPrivacyControl': {
|
|
1503
|
+
paramsType: [Protocol.Browser.SetGlobalPrivacyControlRequest];
|
|
1504
|
+
returnType: Protocol.Browser.SetGlobalPrivacyControlResponse;
|
|
1505
|
+
};
|
|
1490
1506
|
/**
|
|
1491
1507
|
* Inserts a new rule with the given `ruleText` in a stylesheet with given `styleSheetId`, at the
|
|
1492
1508
|
* position specified by `location`.
|
|
@@ -713,6 +713,18 @@ declare namespace ProtocolProxyApi {
|
|
|
713
713
|
*/
|
|
714
714
|
invoke_addPrivacySandboxEnrollmentOverride(params: Protocol.Browser.AddPrivacySandboxEnrollmentOverrideRequest): Promise<Protocol.ProtocolResponseWithError>;
|
|
715
715
|
|
|
716
|
+
/**
|
|
717
|
+
* Gets the current globally-applied privacy control status
|
|
718
|
+
* See https://www.w3.org/TR/gpc/#get-global-privacy-control
|
|
719
|
+
*/
|
|
720
|
+
invoke_getGlobalPrivacyControl(): Promise<Protocol.Browser.GetGlobalPrivacyControlResponse>;
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Sets and then gets the current globally-applied privacy control status
|
|
724
|
+
* See https://www.w3.org/TR/gpc/#set-global-privacy-control
|
|
725
|
+
*/
|
|
726
|
+
invoke_setGlobalPrivacyControl(params: Protocol.Browser.SetGlobalPrivacyControlRequest): Promise<Protocol.Browser.SetGlobalPrivacyControlResponse>;
|
|
727
|
+
|
|
716
728
|
}
|
|
717
729
|
export interface BrowserDispatcher {
|
|
718
730
|
/**
|
|
@@ -2744,6 +2744,18 @@ export namespace Browser {
|
|
|
2744
2744
|
url: string;
|
|
2745
2745
|
}
|
|
2746
2746
|
|
|
2747
|
+
export interface GetGlobalPrivacyControlResponse extends ProtocolResponseWithError {
|
|
2748
|
+
gpc: boolean;
|
|
2749
|
+
}
|
|
2750
|
+
|
|
2751
|
+
export interface SetGlobalPrivacyControlRequest {
|
|
2752
|
+
gpc: boolean;
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
export interface SetGlobalPrivacyControlResponse extends ProtocolResponseWithError {
|
|
2756
|
+
gpc: boolean;
|
|
2757
|
+
}
|
|
2758
|
+
|
|
2747
2759
|
/**
|
|
2748
2760
|
* Fired when page is about to start a download.
|
|
2749
2761
|
*/
|
|
@@ -16287,9 +16299,21 @@ export namespace Page {
|
|
|
16287
16299
|
*/
|
|
16288
16300
|
maxHeight?: integer;
|
|
16289
16301
|
/**
|
|
16290
|
-
* Send every n-th frame.
|
|
16302
|
+
* Send every n-th frame. Must be a positive integer.
|
|
16291
16303
|
*/
|
|
16292
16304
|
everyNthFrame?: integer;
|
|
16305
|
+
/**
|
|
16306
|
+
* Maximum number of frames sent until screencastFrameAck is required.
|
|
16307
|
+
* Defaults to 3. Must be a positive integer.
|
|
16308
|
+
*/
|
|
16309
|
+
maxFramesInFlight?: integer;
|
|
16310
|
+
/**
|
|
16311
|
+
* By default, after screencastFrameAck arrives, the next produced frame is sent.
|
|
16312
|
+
* Passing this flag enables storing the last produced frame in memory, which is
|
|
16313
|
+
* immediately sent upon screencastFrameAck. This way, overall performance is
|
|
16314
|
+
* traded for a better latency.
|
|
16315
|
+
*/
|
|
16316
|
+
sendLastFrame?: boolean;
|
|
16293
16317
|
}
|
|
16294
16318
|
|
|
16295
16319
|
export interface StartScreenRecordingRequest {
|
|
@@ -100,18 +100,17 @@ export class ExtensionScope {
|
|
|
100
100
|
): Promise<{
|
|
101
101
|
object: SDK.RemoteObject.RemoteObject,
|
|
102
102
|
}> {
|
|
103
|
-
const response = await context.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
/* userGesture */ false, /* awaitPromise */ true);
|
|
103
|
+
const response = await context.evaluateWithSelectedFrameFallback({
|
|
104
|
+
expression,
|
|
105
|
+
replMode: true,
|
|
106
|
+
includeCommandLineAPI: false,
|
|
107
|
+
returnByValue,
|
|
108
|
+
silent: false,
|
|
109
|
+
generatePreview: false,
|
|
110
|
+
allowUnsafeEvalBlockedByCSP: true,
|
|
111
|
+
throwOnSideEffect: false,
|
|
112
|
+
},
|
|
113
|
+
/* userGesture */ false, /* awaitPromise */ true);
|
|
115
114
|
|
|
116
115
|
if (!response) {
|
|
117
116
|
throw new Error('Response is not found');
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as Host from '../../../core/host/host.js';
|
|
6
|
-
import type {UrlString} from '../../../core/platform/DevToolsPath.js';
|
|
7
6
|
import type * as Platform from '../../../core/platform/platform.js';
|
|
8
7
|
import * as Root from '../../../core/root/root.js';
|
|
9
8
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
@@ -16,6 +15,7 @@ import {areOriginsEquivalent, extractContextOrigin, isOpaqueOrigin} from '../AiO
|
|
|
16
15
|
import {debugLog, isStructuredLogEnabled} from '../debug.js';
|
|
17
16
|
import type {ContextHandlerResult, DataHandlerResult} from '../tools/Tool.js';
|
|
18
17
|
|
|
18
|
+
type UrlString = Platform.DevToolsPath.UrlString;
|
|
19
19
|
const MAX_SUGGESTION_LENGTH = 200;
|
|
20
20
|
|
|
21
21
|
export const enum ResponseType {
|
|
@@ -6,7 +6,6 @@ import * as Common from '../../../core/common/common.js';
|
|
|
6
6
|
import * as Host from '../../../core/host/host.js';
|
|
7
7
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
8
8
|
import * as Root from '../../../core/root/root.js';
|
|
9
|
-
import type {NetworkRequest} from '../../../core/sdk/NetworkRequest.js';
|
|
10
9
|
import type * as SDK from '../../../core/sdk/sdk.js';
|
|
11
10
|
import type * as LHModel from '../../lighthouse/lighthouse.js';
|
|
12
11
|
import * as Logs from '../../logs/logs.js';
|
|
@@ -32,6 +31,8 @@ import {
|
|
|
32
31
|
type RequestOptions,
|
|
33
32
|
} from './AiAgent.js';
|
|
34
33
|
|
|
34
|
+
type NetworkRequest = SDK.NetworkRequest.NetworkRequest;
|
|
35
|
+
|
|
35
36
|
const lockedString = i18n.i18n.lockedString;
|
|
36
37
|
/**
|
|
37
38
|
* WARNING: preamble defined in code is only used when userTier is
|