You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If referer is passed to the options object its value will be used as the referer instead of the value set by `Page.setExtraHTTPHeaders()`.
This is the correct way to set referer header: otherwise, the `referer` header will override all the document subrequests.
Fixes#3090.
If you look at this line, we trying to get referrer from
extraHTTPHeaders
:https://github.com/GoogleChrome/puppeteer/blob/master/lib/Page.js#L565
So, at this code example I forced to clear extra headers for proper resources loading:
This is really bad way to set referrer, because even in CDP referrer is specified as a parameter, not header. This is not even funny!
https://github.com/GoogleChrome/puppeteer/blob/master/lib/Page.js#L601
While I'm trying to clear headers after navigation with empty object, page will load resources (like CSS and scripts, images) with a wrong referrer!
Try to set extra header
referer
on your page and load image, and you will see amazing wrong referer:So wee need smth like this:
goto
, in this case method will ignore headersreferer
checkNow I'm forced to rewrite
goto
method a little, can we fix it?The text was updated successfully, but these errors were encountered: