Visual Studio Code extension to access Debug Console's input box

Viewed 173

While writing a JavaScript code, I want to write the code in VS code editor and evaluate it in Chrome browser by sending the code via VS Code's Debug Console. Debug Console is already synced with Debugger for Chrome extension.

I can write the code and copy them and paste to Debug console to send the code to the browser. but it's really annoying and I made a simple VS code extension to do it.

Unfortunately the code below does not send the code to Chrome Dev tool but it only prints the code in the debug console. I researched to find the working solution but I couldn't. Is there a API to send the command to Chrome dev console via code or any other suggestion?

const copyAndPasteToDebug = vscode.commands.registerCommand('extension.copyAndPasteToDebug', () => {
    vscode.debug.activeDebugConsole.append(vscode.window.activeTextEditor.document.getText())
});
context.subscriptions.push(copyAndPasteToDebug);
0 Answers
Related