Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read redirect history #747

Merged
merged 1 commit into from
Jun 30, 2023
Merged

Conversation

bessone
Copy link
Contributor

@bessone bessone commented Jun 30, 2023

Sometimes it can happen that the screenshot made by Browsershot is different from the one displayed by your browser.
It is often due to one or more redirects made by the site, based on geolocation, cookies, etc...

To understand what happens, I tried to keep track of the redirects made by the site, both HTTP, Javascript and HTML ones, not using only the Puppeteer redirectChain because it only considers the HTTP ones.
I tried to capture any request that is a navigation requests that attempts to load a new document, mke sure the redirect is in the parent frame or we will see the navigation for other frames.

Since they are available, in addition to the URLs I thought of including HTTP status, reason and headers.

@freekmurze freekmurze merged commit 93708dd into spatie:main Jun 30, 2023
@freekmurze
Copy link
Member

Thank you!

@freekmurze
Copy link
Member

Could you send a PR to document this feature in our docs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants