From 6335c526ec13c2144f82d7e69a6a6e45f5fb1060 Mon Sep 17 00:00:00 2001 From: "yanlong.wang" Date: Mon, 24 Feb 2025 11:31:38 +0800 Subject: [PATCH] fine: stop worrying about the global environment --- backend/functions/src/services/puppeteer.ts | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/backend/functions/src/services/puppeteer.ts b/backend/functions/src/services/puppeteer.ts index 4666d25..4bd4522 100644 --- a/backend/functions/src/services/puppeteer.ts +++ b/backend/functions/src/services/puppeteer.ts @@ -223,23 +223,7 @@ const MUTATION_IDLE_WATCH = ` })(); `; -const DONT_MESS_WITH_THE_FUNDAMENTALS = ` -(()=> { - const fnToStringDesc = Object.getOwnPropertyDescriptor(Function.prototype, 'toString'); - Object.defineProperty(Function.prototype, 'toString', { - get: ()=> fnToStringDesc.value, - set: ()=> 'Dont mess with this', - writeable: true, - configurable: true, - enumerable: false, - }); -})(); -delete Function.prototype.bind.apply; -delete Function.prototype.bind.call; -`; - const SCRIPT_TO_INJECT_INTO_FRAME = ` -${DONT_MESS_WITH_THE_FUNDAMENTALS} ${READABILITY_JS} ${SIMULATE_SCROLL} ${MUTATION_IDLE_WATCH} @@ -510,7 +494,7 @@ export class PuppeteerControl extends AsyncService { } this.browser = await puppeteer.launch({ timeout: 10_000, - headless: true, + headless: false, executablePath: process.env.OVERRIDE_CHROME_EXECUTABLE_PATH, args: ['--disable-dev-shm-usage'] }).catch((err: any) => {