@@ -11,9 +11,9 @@ import type { IDEMetric } from '@gitpod/ide-metrics-api-grpcweb';
11
11
import type { ErrorEvent } from '../../platform/telemetry/common/errorTelemetry.js' ;
12
12
import { IGitpodPreviewConfiguration } from '../../base/common/product.js' ;
13
13
import { filter } from '../../base/common/objects.js' ;
14
- // eslint-disable-next-line local/code-amd-node-module
15
14
import type { Analytics , AnalyticsSettings } from '@jeanp413/analytics-node-umd' ;
16
15
import { importAMDNodeModule } from '../../amdX.js' ;
16
+ import { mainWindow } from '../../base/browser/window.js' ;
17
17
18
18
const segmentResolver = importAMDNodeModule < typeof import ( '@jeanp413/analytics-node-umd' ) > ( '@jeanp413/analytics-node-umd' , 'dist/umd/index.js' ) ;
19
19
@@ -153,7 +153,7 @@ export class GitpodInsightsAppender implements ITelemetryAppender {
153
153
const params : ReportErrorParam = {
154
154
workspaceId : gitpodWsInfo . workspaceId ,
155
155
instanceId : gitpodWsInfo . instanceId ,
156
- userId : window . gitpod . loggedUserID || gitpodWsInfo . ownerId ,
156
+ userId : mainWindow . gitpod . loggedUserID || gitpodWsInfo . ownerId ,
157
157
errorStack : error . callstack ,
158
158
component : 'vscode-web' ,
159
159
version : this . productVersion ,
@@ -191,7 +191,6 @@ export class GitpodInsightsAppender implements ITelemetryAppender {
191
191
}
192
192
// load grpc-web before see https://github.com/gitpod-io/gitpod/issues/4448
193
193
await importAMDNodeModule < typeof import ( '@improbable-eng/grpc-web' ) > ( '@improbable-eng/grpc-web' , 'dist/grpc-web-client.umd.js' ) ;
194
- // eslint-disable-next-line local/code-amd-node-module
195
194
196
195
const MetricsServiceClient = ( await importAMDNodeModule < typeof import ( '@gitpod/ide-metrics-api-grpcweb' ) > ( '@gitpod/ide-metrics-api-grpcweb' , 'lib/idemetrics_grpc_web_pb.js' ) ) . MetricsServiceClient ;
197
196
const sendMetrics = ( await importAMDNodeModule < typeof import ( '@gitpod/ide-metrics-api-grpcweb' ) > ( '@gitpod/ide-metrics-api-grpcweb' , 'lib/index.js' ) ) . sendMetrics ;
@@ -211,7 +210,7 @@ export class GitpodInsightsAppender implements ITelemetryAppender {
211
210
private async getWorkspaceInfo ( ) {
212
211
if ( ! this . _workspaceInfo ) {
213
212
this . _workspaceInfo = ( async ( ) => {
214
- const infoResponse = await fetch ( window . location . protocol + '//' + window . location . host + '/_supervisor/v1/info/workspace' , {
213
+ const infoResponse = await fetch ( mainWindow . location . protocol + '//' + mainWindow . location . host + '/_supervisor/v1/info/workspace' , {
215
214
credentials : 'include'
216
215
} ) ;
217
216
if ( ! infoResponse . ok ) {
0 commit comments