You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Whenever you try to enable both plugins alongside, BlockResourcesPlugin stops working. I've set up to block images, stylesheets and media types, and it works fine when AdblockerPlugin is not enabled, but if you enable both, BlockResourcesPlugin stop blocking the provided resources.
Steps to reproduce
After running the above code snippet, check the example.png image created to see that styles and images are in fact loaded. If we remove AdblockerPlugin from the equation, the screenshot is as expected, without styles nor images.
I'm getting a request already handled error when enabling puppeteer page proxy and both adblocker plugin and block resources. But everything works fine if I disabled the adblocker.
/node_modules/puppeteer/lib/cjs/puppeteer/common/assert.js:26
throw new Error(message);
^
Error: Request is already handled!
at assert (/node_modules/puppeteer/lib/cjs/puppeteer/common/assert.js:26:15)
at HTTPRequest.abort (/node_modules/puppeteer/lib/cjs/puppeteer/common/HTTPRequest.js:453:32)
at requestHandler (/node_modules/puppeteer-page-proxy/src/core/proxy.js:41:23)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async $ppp_request_listener (/node_modules/puppeteer-page-proxy/src/core/proxy.js:82:9)
at async HTTPRequest.finalizeInterceptions (/node_modules/puppeteer/lib/cjs/puppeteer/common/HTTPRequest.js:151:9)
Not sure if this would work, but mentioned a potential solution SnowLew #5334.
However, since this removes existing page listeners, does that mean the adblocker plugin no longer works? Also, the above code MUST be called before page.goto(URL), otherwise it wouldn't block resources. Then it kinda seems like the adblocker part would no longer work, since that request listener was removed and a new one added.
Perhaps, a solution would be to implement the ad blocker AND resource blocker in the same request listener, thus no conflicts.
Describe the bug
Whenever you try to enable both plugins alongside, BlockResourcesPlugin stops working. I've set up to block images, stylesheets and media types, and it works fine when AdblockerPlugin is not enabled, but if you enable both, BlockResourcesPlugin stop blocking the provided resources.
Code Snippet
Steps to reproduce
After running the above code snippet, check the example.png image created to see that styles and images are in fact loaded. If we remove AdblockerPlugin from the equation, the screenshot is as expected, without styles nor images.
Versions
System:
OS: Linux 5.14 Fedora 34 (Thirty Four) 34 (Thirty Four)
CPU: (16) x64 AMD Ryzen 7 3800X 8-Core Processor
Memory: 1.95 GB / 15.54 GB
Container: Yes
Shell: 5.1.0 - /bin/bash
Binaries:
Node: 14.17.4 - ~/.nvm/versions/node/v14.17.4/bin/node
Yarn: 1.22.15 - ~/.nvm/versions/node/v14.17.4/bin/yarn
npm: 6.14.14 - ~/.nvm/versions/node/v14.17.4/bin/npm
npmPackages:
puppeteer: ^10.4.0 => 10.4.0
puppeteer-extra: ^3.2.3 => 3.2.3
puppeteer-extra-plugin-adblocker: ^2.12.0 => 2.12.0
puppeteer-extra-plugin-block-resources: ^2.3.0 => 2.3.0
puppeteer-extra-plugin-stealth: ^2.9.0 => 2.9.0
The text was updated successfully, but these errors were encountered: