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
It seems that beforeScreenshot (when provided) is called after rendering the provided html, and just before the screenshot as seen below. However we have limited control of the Page prior to rendering. If I move the beforeScreenshot call prior to the setContent, this enables us to do things like intercept HTTP/XHR requests.
I would like to propose the addition of a beforeRendering parameter that allows for more control of the page prior to rendering. This example intercepts XHR requests.
If you are open to it i can submit a PR, as I would rather use this lib as built rather than forking it. Alternatively we could execute the beforeScreenshot prior to setting the content. Im not sure of the implications in doing so but it has proven the concept.
Thanks!
The text was updated successfully, but these errors were encountered:
justinherter
changed the title
Unable to use beforeScreenshot parameter for intercepting HXR
Unable to use beforeScreenshot parameter for intercepting XHR
Aug 21, 2023
It seems that
beforeScreenshot
(when provided) is called after rendering the provided html, and just before the screenshot as seen below. However we have limited control of thePage
prior to rendering. If I move the beforeScreenshot call prior to thesetContent
, this enables us to do things like intercept HTTP/XHR requests.I would like to propose the addition of a
beforeRendering
parameter that allows for more control of the page prior to rendering. This example intercepts XHR requests.If you are open to it i can submit a PR, as I would rather use this lib as built rather than forking it. Alternatively we could execute the
beforeScreenshot
prior to setting the content. Im not sure of the implications in doing so but it has proven the concept.Thanks!
The text was updated successfully, but these errors were encountered: