Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

> **Note**: odd version numbers, for example, `0.13.0`, are not included in this changelog. They are used to test the new features and fixes before the final release.

## [0.23.3] - Unreleased
## [0.23.4] - Unreleased

### Added:

- Support for using Dev Proxy Beta with commands
- Command: `dev-proxy-toolkit.discover-urls-to-watch` - Start Dev Proxy in discovery mode

### Changed:

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The following sections describe the features that the extension contributes to V
- `Dev Proxy Toolkit: Stop recording`- Only available when Dev Proxy is recording
- `Dev Proxy Toolkit: Open configuration file`- Only available when Dev Proxy is installed
- `Dev Proxy Toolkit: Create configuration file`- Only available when Dev Proxy is installed
- `Dev Proxy Toolkit: Discover URLs to watch` - Only available when Dev Proxy is not running

### Diagnostics

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "dev-proxy-toolkit",
"displayName": "Dev Proxy Toolkit",
"description": "Makes it easy to create and update Dev Proxy configuration files.",
"version": "0.23.3",
"version": "0.23.4",
"publisher": "garrytrinder",
"engines": {
"vscode": "^1.89.0"
Expand Down Expand Up @@ -76,6 +76,13 @@
"category": "Dev Proxy Toolkit",
"icon": "$(file-code)",
"enablement": "isDevProxyInstalled"
},
{
"command": "dev-proxy-toolkit.discover-urls-to-watch",
"title": "Discover URLs to watch",
"category": "Dev Proxy Toolkit",
"icon": "$(debug-start)",
"enablement": "!isDevProxyRunning"
}
],
"menus": {
Expand Down
32 changes: 32 additions & 0 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,36 @@ export const registerCommands = (context: vscode.ExtensionContext, configuration
vscode.window.showErrorMessage('Failed to create new config file');
}
}));

context.subscriptions.push(
vscode.commands.registerCommand('dev-proxy-toolkit.discover-urls-to-watch', async () => {
const newTerminal = configuration.get('newTerminal') as boolean;

let terminal: vscode.Terminal;

if (!newTerminal && vscode.window.activeTerminal) {
terminal = vscode.window.activeTerminal;
} else {
terminal = vscode.window.createTerminal('Dev Proxy');

}

const processNames = await vscode.window.showInputBox({
prompt: 'Enter the process names (space separated). Leave empty to intercept requests from all processes.',
placeHolder: 'msedge pwsh',
value: '',
title: 'Intercept requests from specific processes',
validateInput: (value: string) => {
// can be empty string, but if not, must contain space separated process names
if (value && !/^[a-zA-Z0-9\s]+$/.test(value)) {
return 'Process names can only contain alphanumeric characters and spaces';
}
return undefined; // no error
}
});

processNames !== undefined && processNames.trim() !== ''
? terminal.sendText(`${devProxyExe} --discover --watch-process-names ${processNames.trim()}`)
: terminal.sendText(`${devProxyExe} --discover`);
}));
};