How to set header in puppeteer just main page request not all request

I want to just apply header in just opened page in puppeteer not all inside page headers

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

will apply all pages request headers all css/js/images and etc...

i want to set just main request headers not all of pages requests.

Upvotes: 3

Views: 9381

Answers (1)

Answered here: https://github.com/GoogleChrome/puppeteer/issues/2627#issuecomment-393407765

Seems be new feature added to puppeteer.

Upvotes: 1

Related Questions