Ellipsis comments

This commit is contained in:
a8trejo 2024-11-27 22:52:34 -08:00
parent 0784970a33
commit f48707f6ce
3 changed files with 13 additions and 10 deletions

View file

@ -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.

View file

@ -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 }}-

View file

@ -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({