From 4c7f6d0281c5cf88562affa1fb76d9c413bc1c26 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Mon, 9 May 2022 12:15:28 +0800 Subject: [PATCH] Update comments --- packages/puppeteer-parse/index.js | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/packages/puppeteer-parse/index.js b/packages/puppeteer-parse/index.js index bbff3ff2c..23ccdd4ea 100644 --- a/packages/puppeteer-parse/index.js +++ b/packages/puppeteer-parse/index.js @@ -26,11 +26,10 @@ const { derstandardHandler } = require('./derstandard-handler'); const { imageHandler } = require('./image-handler'); const puppeteer = require('puppeteer-extra'); -// Add stealth plugin and use defaults (all tricks to hide puppeteer usage) +// Add stealth plugin to hide puppeteer usage const StealthPlugin = require('puppeteer-extra-plugin-stealth'); puppeteer.use(StealthPlugin()); -// Add adblocker plugin, which will transparently block ads in all pages you -// create using puppeteer. +// Add adblocker plugin to block ads and trackers const AdblockerPlugin = require('puppeteer-extra-plugin-adblocker'); puppeteer.use(AdblockerPlugin({ blockTrackers: true })); @@ -610,28 +609,6 @@ async function retrievePage(url) { } catch {} }); - /* - * Disallow MathJax from running in Puppeteer and modifying the document, - * we shall instead run it in our frontend application to transform any - * mathjax content when present. - */ - // await page.setRequestInterception(true); - // let requestCount = 0; - // page.on('request', request => { - // if (requestCount++ > 100) { - // request.abort(); - // return; - // } - // if ( - // request.resourceType() === 'script' && - // request.url().toLowerCase().indexOf('mathjax') > -1 - // ) { - // request.abort(); - // } else { - // request.continue(); - // } - // }); - // Puppeteer fails during download of PDf files, // so record the failure and use those items let lastPdfUrl = undefined;