Fix isWeb platform check

The new check should be safer
This commit is contained in:
Matt Bierner 2020-07-22 14:51:57 -07:00
parent 5b9fd525fa
commit 3f1206a355

View file

@ -3,6 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
export function isWeb(): boolean {
return typeof process === 'undefined';
// @ts-expect-error
return typeof navigator !== 'undefined' && vscode.env.uiKind === vscode.UIKind.Web;
}