-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for adblock and other puppeter extra plugins #32
Comments
Hello,
|
Well i edited it like this, but ads are still there, (the addblock added here part) |
I guess its because the page already created, thus the plugin is not registered properly on that initial page you can also check my fork: @zfcsoftware may I create a PR for this? |
Hi, thanks for your support. I think some plugins may get errors when used in this way. I will update Puppeteer to allow the user to submit. |
hey thanks for the replies, i made it work in my on way
then returned the blocker, and used the plugins manual blocking like this after creating each page
|
@sharpanimes Could you please display the full code snippet that you edited? |
Hey, sorry if my instructions were unclear.
|
@sharpanimes I followed your instructions and encountered an error: Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'D:\laragon\www\node_modules\puppeteer-real-browser\src\module\afp.js' imported from D:\laragon\www\node_modules\puppeteer-real-browser\src\index.js |
I think there are some changes in the latest version. |
Thank bro |
@zfcsoftware @sharpanimes According to @sharpanimes, it works well on version 1.2.11 but doesn't work on 1.2.20. Please fix the issue for the puppeteer-real-browser version: '1.2.20'. I tried but couldn't resolve it with the new version. |
I will make this feature request after major updates have been added. |
Thank you very much. |
@zfcsoftware I see there are many requests for an ad-blocking feature when opening the browser. Please prioritize implementing it! Thank you very much for this useful and wonderful source code. |
I will add support in a few days. |
thank bro |
Thank you. This is a much needed feature. Might be best to allow overriding the whole launch call for more flexibility. |
Please update . Thanks |
@zfcsoftware it looks like the package doesn't support adblock yet. |
It supports it. I suggest you try again. 2024-08-25.05-12-24.mp4
|
@zfcsoftware Thanks, I think the package would support adblock directly :) |
@zfcsoftware plugins/Adblock doesn't work when the proxy is enabled. I tested with ESM: import test from 'node:test';
import assert from 'node:assert';
import { connect } from '../../lib/esm/index.mjs';
const realBrowserOption = {
args: ["--start-maximized"],
turnstile: true,
headless: false,
disableXvfb: true,
customConfig: {},
connectOption: {
defaultViewport: null
},
plugins: []
}
test('Puppeteer Extra Plugin', async () => {
const AdblockerPlugin = await (
await import("puppeteer-extra-plugin-adblocker")
).default
const { browser, page } = await connect({
headless: false,
proxy: {
host: "xxxx",
port: "xxx",
username: "xxx",
password: "xxx"
}, // works fine if we remove this option.
args: [],
skipTarget: [],
fingerprint: false,
turnstile: true,
connectOption: {},
fpconfig: {},
plugins: [
AdblockerPlugin({
blockTrackers: true,
interceptResolutionPriority: 0,
blockTrackersAndAnnoyances: true
})
]
})
await page.goto("https://www.youtube.com/results?search_query=what+is+seo", { waitUntil: "domcontentloaded" })
}) |
@zfcsoftware please fix it |
This issue has been fixed. I have attached a video of the test and sample code below. Please test again with the latest version. 2024-09-09.22-36-53.mp4
|
I cannot solve captchas when I use the page.solveRecaptchas() function. There is no response. Error: Error: TimeoutError: Waiting failed: 10000ms exceeded (Recaptcha-plugin)
|
Hey i was wondering if i could use the puppeter extra adblock feature, cause i couldnt find a way to do this currently.
The text was updated successfully, but these errors were encountered: