Skip to content
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

Request Interception is not enabled #1495

Closed
jef opened this issue Dec 8, 2020 · 4 comments
Closed

Request Interception is not enabled #1495

jef opened this issue Dec 8, 2020 · 4 comments

Comments

@jef
Copy link

jef commented Dec 8, 2020

Description

Related: jef/streetmerchant#826

image

So it seems like it's a problem with the adblocker dependency. Adding this.page.removeListener('request', this.onRequest); to the adblocker code fixed my problem as well. Not sure what is happening since I'm not an expert on Puppeteer. I'm guessing that promise doesn't resolve and so when request interception is done later on in the code base it errors out. A ticket should probably be filed.

@howdoicomputer

@remusao
Copy link
Collaborator

remusao commented Dec 8, 2020

Hey @jef,

Thanks for taking the time to open an issue here. I skimmed through the original discussion and it was not clear how I could reproduce the issue easily on my side. I see that streetmerchant uses the adblocker through the puppeteer-extra plugin and has some logic on top to enable/disable it as well as register custom listeners. I can have a look at the issue but I would need some reasonably small script to reproduce the issue if possible.

Best,
Rémi

@howdoicomputer
Copy link

Also, the removeListener function call was a false positive; seems to have broken after a bit.

@jef
Copy link
Author

jef commented Dec 11, 2020

I'm sorry @remusao, this was an easy fix -- and silly on my part not to look into it.

Puppeteer looks to allow for request interceptions and we hadn't enabled it.

https://pptr.dev/#?product=Puppeteer&version=v5.5.0&show=api-pagesetrequestinterceptionvalue

Going to close this out. Thanks for your time and your thoughtful input.

@jef jef closed this as completed Dec 11, 2020
@remusao
Copy link
Collaborator

remusao commented Dec 11, 2020

Hey @jef,

I'm glad you found the root cause. No worries at all, I'm happy to help,

Best,
Rémi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants