Skip to content

Commit 3f1206a

Browse files
committed
Fix isWeb platform check
The new check should be safer
1 parent 5b9fd52 commit 3f1206a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • extensions/typescript-language-features/src/utils

extensions/typescript-language-features/src/utils/platform.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6+
import * as vscode from 'vscode';
7+
68
export function isWeb(): boolean {
7-
return typeof process === 'undefined';
9+
// @ts-expect-error
10+
return typeof navigator !== 'undefined' && vscode.env.uiKind === vscode.UIKind.Web;
811
}

0 commit comments

Comments
 (0)