-
Notifications
You must be signed in to change notification settings - Fork 30.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show InputBox for unsupported clients
Fixes #238147
- Loading branch information
1 parent
8237317
commit 4bf6d38
Showing
3 changed files
with
190 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
import { Uri } from 'vscode'; | ||
|
||
const VALID_DESKTOP_CALLBACK_SCHEMES = [ | ||
'vscode', | ||
'vscode-insiders', | ||
// On Windows, some browsers don't seem to redirect back to OSS properly. | ||
// As a result, you get stuck in the auth flow. We exclude this from the | ||
// list until we can figure out a way to fix this behavior in browsers. | ||
// 'code-oss', | ||
'vscode-wsl', | ||
'vscode-exploration' | ||
]; | ||
|
||
export function isSupportedClient(uri: Uri): boolean { | ||
return ( | ||
VALID_DESKTOP_CALLBACK_SCHEMES.includes(uri.scheme) || | ||
// vscode.dev & insiders.vscode.dev | ||
/(?:^|\.)vscode\.dev$/.test(uri.authority) || | ||
// github.dev & codespaces | ||
/(?:^|\.)github\.dev$/.test(uri.authority) || | ||
// localhost | ||
/^localhost:\d+$/.test(uri.authority) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters