question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Validate setCacheEnable and setRequestInterception usage

See original GitHub issue

I got a question on Puppeteer-Sharp saying something like:

I want to enable cache, to cache images, but I need to intercept my xhr request. When I set setRequestInterception, cache stop working.

So I ended up reading some changes made on #4260. Here _updateProtocolCacheDisabled to be more specific.

So, I have two questions regarding this piece of code:

cacheDisabled: this._userCacheDisabled || this._protocolRequestInterceptionEnabled
  1. Do we need to disable the cache there, when the user explicitly opted to enable it?
  2. If so, as those are two explicit actions made by the user (setCacheEnable and setRequestInterception), Shouldn’t we assert there saying something like Cannot user setCacheEnable and setRequestInterception at the same time?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:31
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Androbincommented, May 7, 2021

The issue described by @liweixi100 is described in #7038 and solved by #7060.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Page.setRequestInterception() method - Puppeteer
Activating request interception enables HTTPRequest.abort(), HTTPRequest.continue() and HTTPRequest.respond() methods. This provides the capability to ...
Read more >
Using setRequestInterception in Puppeteer - The Parsed Web
Use setRequestInterception to customize handling of browser requests, both before the request begins and after it completes.
Read more >
Use setRequestInterception in Puppeteer With Examples
Use the setRequestInterception method in your next Puppeteer project with LambdaTest Automation Testing Advisor. Learn how to set up and run automated tests ......
Read more >
Request interception with Puppeteer and Playwright
When we browse the web, a series of HTTP requests and responses are exchanged between our browser and the pages we are visiting....
Read more >
Validation - Laravel - The PHP Framework For Web Artisans
To do this, we will use the validate method provided by the Illuminate\Http\Request object. If the validation rules pass, your code will keep...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found