Path: blob/main/src/vs/workbench/contrib/browserView/electron-browser/browserViewTelemetry.ts
5222 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 '../../../../platform/telemetry/common/telemetry.js';67/**8* Source of an Integrated Browser open event.9*10* - `'commandWithoutUrl'`: opened via the "Open Integrated Browser" command without a URL argument.11* This typically means the user ran the command manually from the Command Palette.12* - `'commandWithUrl'`: opened via the "Open Integrated Browser" command with a URL argument.13* This typically means another extension or component invoked the command programmatically.14* - `'newTabCommand'`: opened via the "New Tab" command from an existing tab.15* - `'localhostLinkOpener'`: opened via the localhost link opener when the16* `workbench.browser.openLocalhostLinks` setting is enabled. This happens when clicking17* localhost links from the terminal, chat, or other sources.18* - `'browserLinkForeground'`: opened when clicking a link inside the Integrated Browser that19* opens in a new focused editor (e.g., links with target="_blank").20* - `'browserLinkBackground'`: opened when clicking a link inside the Integrated Browser that21* opens in a new background editor (e.g., Ctrl/Cmd+click).22* - `'browserLinkNewWindow'`: opened when clicking a link inside the Integrated Browser that23* opens in a new window (e.g., Shift+click).24* - `'copyToNewWindow'`: opened when the user copies a browser editor to a new window25* via "Copy into New Window".26*/27export type IntegratedBrowserOpenSource = 'commandWithoutUrl' | 'commandWithUrl' | 'newTabCommand' | 'localhostLinkOpener' | 'browserLinkForeground' | 'browserLinkBackground' | 'browserLinkNewWindow' | 'copyToNewWindow';2829type IntegratedBrowserOpenEvent = {30source: IntegratedBrowserOpenSource;31};3233type IntegratedBrowserOpenClassification = {34source: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How the Integrated Browser was opened' };35owner: 'jruales';36comment: 'Tracks how users open the Integrated Browser';37};3839export function logBrowserOpen(telemetryService: ITelemetryService, source: IntegratedBrowserOpenSource): void {40telemetryService.publicLog2<IntegratedBrowserOpenEvent, IntegratedBrowserOpenClassification>(41'integratedBrowser.open',42{ source }43);44}454647