mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader.git
synced 2025-08-18 01:05:59 +08:00
fine: stop worrying about the global environment
This commit is contained in:
parent
a2f810cce6
commit
6335c526ec
@ -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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user