如何在puppeter中设置标题只是主页请求而不是所有请求

时间:2018-05-28 13:56:19

标签: puppeteer

我想只在puppeter中打开的页面中应用标题而不是所有内页标题

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

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

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

1 个答案:

答案 0 :(得分:1)

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

似乎是木偶的新功能。