79748087

Date: 2025-08-27 14:16:44
Score: 2.5
Natty:
Report link

原因很简单, await page.setRequestInterception(true); 启用时开始拦截事件, 这个时候, 事件队列里有很多事件, 有的已经进入page.on('request', callback)中的callback中, 还有没有进入,但是正在等待进入callback中的事件, 当你执行await page.setRequestInterception(false);时, 会停止拦截新的事件进入事件队列, 但是已经进入事件队列的事件可能还有很多, 他们会陆续进入callback中, 当在callback中进行处理时req.continue();,此时因为setRequestInterception(false),这个时候执行req.continue();会报错. 注意:setRequestInterception(false)时执行req.continue();会报错

Reasons:
  • No code block (0.5):
  • Single line (0.5):
  • No latin characters (0.5):
  • Low reputation (1):
Posted by: 唐子洋