diff --git a/.changeset/chatty-ravens-study.md b/.changeset/chatty-ravens-study.md index 983bf4f0f6..b7d74111f2 100644 --- a/.changeset/chatty-ravens-study.md +++ b/.changeset/chatty-ravens-study.md @@ -2,4 +2,4 @@ "roo-cline": minor --- -Enabled Roo Cline to use pupetteer to prompt a browser and manually authenticate to site it cant by itself +Enabled Roo Cline to use puppeteer and connect to a current browser which is already authenticated to multiple sites. diff --git a/.github/workflows/code-qa.yml b/.github/workflows/code-qa.yml index 4f049ffb6a..4876c26f0b 100644 --- a/.github/workflows/code-qa.yml +++ b/.github/workflows/code-qa.yml @@ -7,6 +7,9 @@ on: types: [opened, reopened, ready_for_review, synchronize] branches: [main] +env: + NODE_VERSION: '18' + jobs: code-qa: runs-on: ubuntu-latest @@ -17,7 +20,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v4 with: - node-version: '18' + node-version: ${{ env.NODE_VERSION }} - name: Cache node modules id: cache-node-modules @@ -26,9 +29,9 @@ jobs: cache-name: cache-node-modules with: path: node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-node-${{ env.NODE_VERSION }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- diff --git a/src/services/browser/BrowserSession.ts b/src/services/browser/BrowserSession.ts index a08c8be427..61d328eed1 100644 --- a/src/services/browser/BrowserSession.ts +++ b/src/services/browser/BrowserSession.ts @@ -6,6 +6,7 @@ import pWaitFor from "p-wait-for" import delay from "delay" import { fileExistsAtPath } from "../../utils/fs" import { BrowserActionResult } from "../../shared/ExtensionMessage" +import axios from 'axios' export class BrowserSession { private context: vscode.ExtensionContext @@ -34,10 +35,9 @@ export class BrowserSession { if (this.isInteractive) { try { - // Fetch the WebSocket endpoint from Chrome's debugging API - const response = await fetch(`http://127.0.0.1:${this.browserPort}/json/version`) - const data = await response.json() - const browserWSEndpoint = data.webSocketDebuggerUrl + // Fetch the WebSocket endpoint from Chrome's debugging API using axios + const response = await axios.get(`http://127.0.0.1:${this.browserPort}/json/version`) + const browserWSEndpoint = response.data.webSocketDebuggerUrl if (!browserWSEndpoint) { throw new Error(`BrowserSession.ts :: launchBrowser :: Could not get webSocketDebuggerUrl from Chrome debugging API, port: ${this.browserPort}`) @@ -47,8 +47,8 @@ export class BrowserSession { browserWSEndpoint, }) } catch (error) { - console.error("BrowserSession.ts :: launchBrowser :: Failed to connect to browser, make sure you have a running browser with --remote-debugging-port=7333", error) - throw new Error(`BrowserSession.ts :: launchBrowser :: Failed to connect to browser: ${error.message}, make sure you have a running browser with --remote-debugging-port=7333`) + console.error(`BrowserSession.ts :: launchBrowser :: Failed to connect to browser, make sure you have a running browser with --remote-debugging-port=${this.browserPort}`, error) + throw new Error(`BrowserSession.ts :: launchBrowser :: Failed to connect to browser: ${error.message}, make sure you have a running browser with --remote-debugging-port=${this.browserPort}`) } } else { this.browser = await launch({