fix: hangs in an iframe when it redirects to a cross-domain site #6331
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
TestCafe hangs when click in an iframe redirects to a page on a different domain. It occurs due to the cross-origin iframe's driver not able to read the pending actions from the
ContextStorage
of its parent and because of that the driver doesn't send the "ready" driver status and TestCafe hangs.Approach
In the cross-domain iframe we should check that the parent doesn't have pending actions as well. Because the iframe and its parent with different origins doesn't share a common
sessionStorage
(its used under the hood ofContextStorage
), we should send the message to check if there're some pending actions in the parent's driver.References
Fixes #4232
Pre-Merge TODO