google-chrome-devtools - PuppeteerSharp:如何同时启用请求拦截和缓存?
问题描述
我想同时启用请求拦截和缓存。但是,在挖掘PuppeteerSharp源代码时,我发现似乎有故意的代码使这两个属性互斥。因此,我有两个问题:
- 为什么在 PuppeteerSharp 中缓存和请求拦截是互斥的?
- 是否可以覆盖它以便同时启用两者?如何?
以下是附加信息:
有关以下所有屏幕截图,请参阅https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/NetworkManager.cs 。
该方法表示UpdateProtocolCacheDisabledAsync()
当被调用时Fetch.enable
调用,是DevTools内部用于请求拦截的方法。
_protocolRequestInterceptionEnabled
当设置为true
when_userRequestInterceptionEnabled
也设置为 时,缓存实际上是禁用的true
。
解决方案
推荐阅读
- ios - didSelectRowAt 不适用于我的 UITableViewController
- c# - 使用 Cookie 在 Web API 中配置域
- python - 如何更新代码以显示随机游走?
- excel - 运行时错误 53 file not found for some files in directory
- charts - 谷歌图表没有占用 100% 的空间
- java - android.view.accessibility.AccessibilityNodeInfo.setText 致命异常:java.lang.IndexOutOfBoundsException
- python - Ray 集群配置 file_mounts 部分不允许工作节点启动
- ruby-on-rails - 如何在开发模式下访问加密凭据?
- python - 如何将 FFMPEG 导出到我的 Python 程序中?
- tensorboard - TensorBoard:如何添加电子邮件链接?