Path: blob/main/src/vs/platform/browserView/common/browserViewTelemetry.ts
13397 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { ITelemetryService } from '../../telemetry/common/telemetry.js';67/** Source of an Integrated Browser open event. */8export type IntegratedBrowserOpenSource =9/** Created via CDP, such as by the agent using Playwright tools. */10| 'cdpCreated'11/** Opened via a (non-agentic) chat tool invocation. */12| 'chatTool'13/** Opened via the "Open Integrated Browser" command without a URL argument.14* This typically means the user ran the command manually from the Command Palette. */15| 'commandWithoutUrl'16/** Opened via the "Open Integrated Browser" command with a URL argument.17* This typically means another extension or component invoked the command programmatically. */18| 'commandWithUrl'19/** Opened via the quick open feature with no initial URL. */20| 'quickOpenWithoutUrl'21/** Opened via the quick open feature with an initial URL. */22| 'quickOpenWithUrl'23/** Opened via the "New Tab" command from an existing tab. */24| 'newTabCommand'25/** Opened via the localhost link opener when the `workbench.browser.openLocalhostLinks` setting26* is enabled. This happens when clicking localhost links from the terminal, chat, or other sources. */27| 'localhostLinkOpener'28/** Opened when clicking a link inside the Integrated Browser that opens in a new focused editor29* (e.g., links with target="_blank"). */30| 'browserLinkForeground'31/** Opened when clicking a link inside the Integrated Browser that opens in a new background editor32* (e.g., Ctrl/Cmd+click). */33| 'browserLinkBackground'34/** Opened when clicking a link inside the Integrated Browser that opens in a new window35* (e.g., Shift+click). */36| 'browserLinkNewWindow'37/** Opened when the user copies a browser editor to a new window via "Copy into New Window". */38| 'copyToNewWindow';3940type IntegratedBrowserOpenEvent = {41source: IntegratedBrowserOpenSource;42};4344type IntegratedBrowserOpenClassification = {45source: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How the Integrated Browser was opened' };46owner: 'jruales';47comment: 'Tracks how users open the Integrated Browser';48};4950export function logBrowserOpen(telemetryService: ITelemetryService, source: IntegratedBrowserOpenSource): void {51telemetryService.publicLog2<IntegratedBrowserOpenEvent, IntegratedBrowserOpenClassification>(52'integratedBrowser.open',53{ source }54);55}565758