mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader
synced 2025-08-16 20:25:55 +08:00
chore: use env variable to switch browser headless mode
This commit is contained in:
parent
adce02d708
commit
ff7612414c
21
.vscode/launch.json
vendored
21
.vscode/launch.json
vendored
@ -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": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "node",
|
||||
"outputCapture": "std",
|
||||
"preLaunchTask": "Backend:build:watch",
|
||||
"killBehavior": "forceful"
|
||||
},
|
||||
{
|
||||
"name": "Debug Stand Alone Search",
|
||||
"request": "launch",
|
||||
|
@ -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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user