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 |
|
4 | /*
|
5 | * NOTE: When moving this file, please update "browser" section in package.json
|
6 | * and "plugins" section in webpack.testconfig.ts.
|
7 | */
|
8 |
|
9 | import { TelemetryInfo } from "./userAgentPolicy";
|
10 |
|
11 | interface NavigatorEx extends Navigator {
|
12 | // oscpu is not yet standards-compliant, but can not be undefined in TypeScript 3.6.2
|
13 | readonly oscpu: string;
|
14 | }
|
15 |
|
16 | export function getDefaultUserAgentKey(): string {
|
17 | return "x-ms-command-name";
|
18 | }
|
19 |
|
20 | export function getPlatformSpecificData(): TelemetryInfo[] {
|
21 | const navigator = self.navigator as NavigatorEx;
|
22 | const osInfo = {
|
23 | key: "OS",
|
24 | value: (navigator.oscpu || navigator.platform).replace(" ", ""),
|
25 | };
|
26 |
|
27 | return [osInfo];
|
28 | }
|