add common.isTouchDevice

This commit is contained in:
isidor 2021-08-16 16:48:54 +02:00
parent f6b8aef1eb
commit 132e88d6f3
No known key found for this signature in database
GPG key ID: F9280366A8370105
2 changed files with 4 additions and 1 deletions

View file

@ -130,7 +130,7 @@ export class Gesture extends Disposable {
}
@memoize
private static isTouchDevice(): boolean {
static isTouchDevice(): boolean {
// `'ontouchstart' in window` always evaluates to true with typescript's modern typings. This causes `window` to be
// `never` later in `window.navigator`. That's why we need the explicit `window as Window` cast
return 'ontouchstart' in window || navigator.maxTouchPoints > 0;

View file

@ -9,6 +9,7 @@ import * as uuid from 'vs/base/common/uuid';
import { cleanRemoteAuthority } from 'vs/platform/telemetry/common/telemetryUtils';
import { mixin } from 'vs/base/common/objects';
import { firstSessionDateStorageKey, lastSessionDateStorageKey, machineIdKey } from 'vs/platform/telemetry/common/telemetry';
import { Gesture } from 'vs/base/browser/touch';
export async function resolveWorkbenchCommonProperties(
storageService: IStorageService,
@ -55,6 +56,8 @@ export async function resolveWorkbenchCommonProperties(
result['common.product'] = productIdentifier ?? 'web';
// __GDPR__COMMON__ "common.userAgent" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
result['common.userAgent'] = Platform.userAgent;
// __GDPR__COMMON__ "common.isTouchDevice" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
result['common.isTouchDevice'] = String(Gesture.isTouchDevice());
// dynamic properties which value differs on each call
let seq = 0;