diff --git a/.vscode/launch.json b/.vscode/launch.json index c05221a..6569984 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -39,6 +39,27 @@ "preLaunchTask": "Backend:build:watch", "killBehavior": "forceful" }, + { + "name": "Debug Stand Alone Crawl + Browser", + "request": "launch", + "runtimeArgs": [ + "--env-file=.secret.local", + ], + "env": { + "GCLOUD_PROJECT": "reader-6b7dc", + "DEBUG_BROWSER": "true", + "LD_PRELOAD": "/usr/local/lib/libcurl-impersonate-chrome.dylib" + }, + "cwd": "${workspaceFolder}", + "program": "build/stand-alone/crawl.js", + "skipFiles": [ + "/**" + ], + "type": "node", + "outputCapture": "std", + "preLaunchTask": "Backend:build:watch", + "killBehavior": "forceful" + }, { "name": "Debug Stand Alone Search", "request": "launch", diff --git a/src/services/puppeteer.ts b/src/services/puppeteer.ts index 27c7e15..b52a072 100644 --- a/src/services/puppeteer.ts +++ b/src/services/puppeteer.ts @@ -561,7 +561,7 @@ export class PuppeteerControl extends AsyncService { } this.browser = await puppeteer.launch({ timeout: 10_000, - headless: true, + headless: !Boolean(process.env.DEBUG_BROWSER), executablePath: process.env.OVERRIDE_CHROME_EXECUTABLE_PATH, args: ['--disable-dev-shm-usage'] }).catch((err: any) => {