Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/browserView/electron-browser/browserViewTelemetry.ts
5222 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';
7
8
/**
9
* Source of an Integrated Browser open event.
10
*
11
* - `'commandWithoutUrl'`: opened via the "Open Integrated Browser" command without a URL argument.
12
* This typically means the user ran the command manually from the Command Palette.
13
* - `'commandWithUrl'`: opened via the "Open Integrated Browser" command with a URL argument.
14
* This typically means another extension or component invoked the command programmatically.
15
* - `'newTabCommand'`: opened via the "New Tab" command from an existing tab.
16
* - `'localhostLinkOpener'`: opened via the localhost link opener when the
17
* `workbench.browser.openLocalhostLinks` setting is enabled. This happens when clicking
18
* localhost links from the terminal, chat, or other sources.
19
* - `'browserLinkForeground'`: opened when clicking a link inside the Integrated Browser that
20
* opens in a new focused editor (e.g., links with target="_blank").
21
* - `'browserLinkBackground'`: opened when clicking a link inside the Integrated Browser that
22
* opens in a new background editor (e.g., Ctrl/Cmd+click).
23
* - `'browserLinkNewWindow'`: opened when clicking a link inside the Integrated Browser that
24
* opens in a new window (e.g., Shift+click).
25
* - `'copyToNewWindow'`: opened when the user copies a browser editor to a new window
26
* via "Copy into New Window".
27
*/
28
export type IntegratedBrowserOpenSource = 'commandWithoutUrl' | 'commandWithUrl' | 'newTabCommand' | 'localhostLinkOpener' | 'browserLinkForeground' | 'browserLinkBackground' | 'browserLinkNewWindow' | 'copyToNewWindow';
29
30
type IntegratedBrowserOpenEvent = {
31
source: IntegratedBrowserOpenSource;
32
};
33
34
type IntegratedBrowserOpenClassification = {
35
source: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How the Integrated Browser was opened' };
36
owner: 'jruales';
37
comment: 'Tracks how users open the Integrated Browser';
38
};
39
40
export function logBrowserOpen(telemetryService: ITelemetryService, source: IntegratedBrowserOpenSource): void {
41
telemetryService.publicLog2<IntegratedBrowserOpenEvent, IntegratedBrowserOpenClassification>(
42
'integratedBrowser.open',
43
{ source }
44
);
45
}
46
47