mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-25 12:47:14 +00:00
Improve logic for detection of node vs web worker extension host (#248534)
* Use `WorkerGlobalScope` instead of `navigator` since node defines `navigator` now * microsoft auth too * better logic
This commit is contained in:
committed by
GitHub
parent
2c38508d76
commit
b2224f2fc6
@@ -114,11 +114,12 @@ export class GitHubServer implements IGitHubServer {
|
||||
const supportedClient = isSupportedClient(callbackUri);
|
||||
const supportedTarget = isSupportedTarget(this._type, this._ghesUri);
|
||||
|
||||
const isNodeEnvironment = typeof process !== 'undefined' && typeof process?.versions?.node === 'string';
|
||||
const flows = getFlows({
|
||||
target: this._type === AuthProviderType.github
|
||||
? GitHubTarget.DotCom
|
||||
: supportedTarget ? GitHubTarget.HostedEnterprise : GitHubTarget.Enterprise,
|
||||
extensionHost: typeof navigator === 'undefined'
|
||||
extensionHost: isNodeEnvironment
|
||||
? this._extensionKind === vscode.ExtensionKind.UI ? ExtensionHost.Local : ExtensionHost.Remote
|
||||
: ExtensionHost.WebWorker,
|
||||
isSupportedClient: supportedClient
|
||||
|
||||
Reference in New Issue
Block a user