【问题标题】:How to set header in puppeteer just main page request not all request如何在 puppeteer 中设置标头只是主页请求而不是所有请求
【发布时间】:2018-05-28 13:56:19
【问题描述】:

我只想在 puppeteer 中刚刚打开的页面中应用页眉,而不是所有内部页眉

  page.setExtraHTTPHeaders({
     'X-Just-Must-Be-Request-In-Main-Request': '1',
  })

将应用所有页面请求标头所有 css/js/images 等...

我只想设置主请求标头而不是所有页面请求。

【问题讨论】:

    标签: puppeteer


    【解决方案1】:

    在这里回答: https://github.com/GoogleChrome/puppeteer/issues/2627#issuecomment-393407765

    似乎是 puppeteer 中添加的新功能。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-21
      • 2012-03-28
      • 1970-01-01
      • 2015-10-30
      • 2018-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多