mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 08:15:56 +01:00
Never use simple browser on desktop (#303312)
* Never use simple browser on desktop * Update extensions/simple-browser/package.nls.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -42,6 +42,14 @@
|
||||
"category": "Simple Browser"
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
"commandPalette": [
|
||||
{
|
||||
"command": "simpleBrowser.show",
|
||||
"when": "isWeb"
|
||||
}
|
||||
]
|
||||
},
|
||||
"configuration": [
|
||||
{
|
||||
"title": "Simple Browser",
|
||||
@@ -51,12 +59,6 @@
|
||||
"default": true,
|
||||
"title": "Focus Lock Indicator Enabled",
|
||||
"description": "%configuration.focusLockIndicator.enabled.description%"
|
||||
},
|
||||
"simpleBrowser.useIntegratedBrowser": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"markdownDescription": "%configuration.useIntegratedBrowser.description%",
|
||||
"scope": "application"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"displayName": "Simple Browser",
|
||||
"description": "A very basic built-in webview for displaying web content.",
|
||||
"configuration.focusLockIndicator.enabled.description": "Enable/disable the floating indicator that shows when focused in the simple browser.",
|
||||
"configuration.useIntegratedBrowser.description": "When enabled, the `simpleBrowser.show` command will open URLs in the integrated browser instead of the Simple Browser webview. **Note:** This setting is only available on desktop."
|
||||
"configuration.focusLockIndicator.enabled.description": "Enable/disable the floating indicator that shows when focused in the simple browser."
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ declare class URL {
|
||||
const openApiCommand = 'simpleBrowser.api.open';
|
||||
const showCommand = 'simpleBrowser.show';
|
||||
const integratedBrowserCommand = 'workbench.action.browser.open';
|
||||
const useIntegratedBrowserSetting = 'simpleBrowser.useIntegratedBrowser';
|
||||
|
||||
const enabledHosts = new Set<string>([
|
||||
'localhost',
|
||||
@@ -37,12 +36,6 @@ const openerId = 'simpleBrowser.open';
|
||||
* Checks if the integrated browser should be used instead of the simple browser
|
||||
*/
|
||||
async function shouldUseIntegratedBrowser(): Promise<boolean> {
|
||||
const config = vscode.workspace.getConfiguration();
|
||||
if (!config.get<boolean>(useIntegratedBrowserSetting, true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Verify that the integrated browser command is available
|
||||
const commands = await vscode.commands.getCommands(true);
|
||||
return commands.includes(integratedBrowserCommand);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user