nomagick commited on
Commit
6335c52
·
unverified ·
1 Parent(s): a2f810c

fine: stop worrying about the global environment

Browse files
backend/functions/src/services/puppeteer.ts CHANGED
@@ -223,23 +223,7 @@ const MUTATION_IDLE_WATCH = `
223
  })();
224
  `;
225
 
226
- const DONT_MESS_WITH_THE_FUNDAMENTALS = `
227
- (()=> {
228
- const fnToStringDesc = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');
229
- Object.defineProperty(Function.prototype, 'toString', {
230
- get: ()=> fnToStringDesc.value,
231
- set: ()=> 'Dont mess with this',
232
- writeable: true,
233
- configurable: true,
234
- enumerable: false,
235
- });
236
- })();
237
- delete Function.prototype.bind.apply;
238
- delete Function.prototype.bind.call;
239
- `;
240
-
241
  const SCRIPT_TO_INJECT_INTO_FRAME = `
242
- ${DONT_MESS_WITH_THE_FUNDAMENTALS}
243
  ${READABILITY_JS}
244
  ${SIMULATE_SCROLL}
245
  ${MUTATION_IDLE_WATCH}
@@ -510,7 +494,7 @@ export class PuppeteerControl extends AsyncService {
510
  }
511
  this.browser = await puppeteer.launch({
512
  timeout: 10_000,
513
- headless: true,
514
  executablePath: process.env.OVERRIDE_CHROME_EXECUTABLE_PATH,
515
  args: ['--disable-dev-shm-usage']
516
  }).catch((err: any) => {
 
223
  })();
224
  `;
225
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  const SCRIPT_TO_INJECT_INTO_FRAME = `
 
227
  ${READABILITY_JS}
228
  ${SIMULATE_SCROLL}
229
  ${MUTATION_IDLE_WATCH}
 
494
  }
495
  this.browser = await puppeteer.launch({
496
  timeout: 10_000,
497
+ headless: false,
498
  executablePath: process.env.OVERRIDE_CHROME_EXECUTABLE_PATH,
499
  args: ['--disable-dev-shm-usage']
500
  }).catch((err: any) => {