mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-28 05:14:12 +08:00
Add openIntegratedBrowser option to serverReadyAction.action
Fixes #319676 Co-authored-by: Philip Cox <neogeneva@gmail.com>
This commit is contained in:
co-authored by
Philip Cox
parent
4b24afbf12
commit
795fec9bf0
@@ -47,10 +47,12 @@
|
||||
"action": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"openExternally"
|
||||
"openExternally",
|
||||
"openIntegratedBrowser"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
"%debug.server.ready.action.openExternally.description%"
|
||||
"%debug.server.ready.action.openExternally.description%",
|
||||
"%debug.server.ready.action.openIntegratedBrowser.description%"
|
||||
],
|
||||
"markdownDescription": "%debug.server.ready.action.description%",
|
||||
"default": "openExternally"
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"debug.server.ready.serverReadyAction.description": "Act upon a URI when a server program under debugging is ready (indicated by sending output of the form 'listening on port 3000' or 'Now listening on: https://localhost:5001' to the debug console.)",
|
||||
"debug.server.ready.action.description": "What to do with the URI when the server is ready.",
|
||||
"debug.server.ready.action.openExternally.description": "Open URI externally with the default application.",
|
||||
"debug.server.ready.action.openIntegratedBrowser.description": "Open URI in the integrated browser.",
|
||||
"debug.server.ready.action.debugWithChrome.description": "Start debugging with the 'Debugger for Chrome'.",
|
||||
"debug.server.ready.action.startDebugging.description": "Run another launch configuration.",
|
||||
"debug.server.ready.pattern.description": "Server is ready if this pattern appears on the debug console. The first capture group must include a URI or a port number.",
|
||||
|
||||
@@ -14,7 +14,7 @@ const WEB_ROOT = '${workspaceFolder}';
|
||||
|
||||
interface ServerReadyAction {
|
||||
pattern: string;
|
||||
action?: 'openExternally' | 'debugWithChrome' | 'debugWithEdge' | 'startDebugging';
|
||||
action?: 'openExternally' | 'openIntegratedBrowser' | 'debugWithChrome' | 'debugWithEdge' | 'startDebugging';
|
||||
uriFormat?: string;
|
||||
webRoot?: string;
|
||||
name?: string;
|
||||
@@ -193,6 +193,10 @@ class ServerReadyDetector extends vscode.Disposable {
|
||||
await vscode.env.openExternal(vscode.Uri.parse(uri));
|
||||
break;
|
||||
|
||||
case 'openIntegratedBrowser':
|
||||
vscode.commands.executeCommand('workbench.action.browser.open', uri);
|
||||
break;
|
||||
|
||||
case 'debugWithChrome':
|
||||
await this.debugWithBrowser('pwa-chrome', session, uri);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user