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
Wrong document referrer while using Chrome 89 #6144
Comments
Hello, Could you please check your scenario with the latest TestCafe version? If the issue persists, please let us know. We will look into this. |
Hi, thank you for quick response. Unfortunately, the same issue occurs with latest |
Thank you for the detailed explanation and the example. I reproduced the issue with the incorrect For the team: require('http')
.createServer((req, res) => {
if (req.url === '/') {
res.writeHead(200, { 'content-type': 'text/html' });
res.end(`
<!DOCTYPE html>
<head>
<link rel="shortcut icon" href="#" />
</head>
<body>
<script>
var iframe = document.createElement('iframe');
iframe.src = 'http://localhost:3000/iframe';
document.body.appendChild(iframe);
</script>
</body>
`);
} else
res.destroy();
})
.listen(3009, () => console.log('http://localhost:3009/'));
require('http')
.createServer((req, res) => {
if (req.url === '/iframe') {
res.writeHead(200, { 'content-type': 'text/html' });
res.end(`
<!DOCTYPE html>
<body>
<script>
console.log(document.referrer);
</script>
</body>
`);
} else
res.destroy();
})
.listen(3000, () => console.log('http://localhost:3000/iframe')); |
Hi, Is there any workaround for this problem? |
@blazeej Thank you for additional information. I managed to reproduce the issue in the latest (90) Firefox version. For now, there is no workaround. Please track this thread to get updates. |
I have the same problem where referer and host headers are sent that of hammerhead proxy. Any guidance on how to fix it ? |
Hi @ash1425, This issue was resolved. So, your case seems to be different. Please follow this instruction and share your simple sample: https://testcafe.io/402636/faq#how-to-create-a-minimal-working-example-when-you-submit-an-issue. |
What is your Test Scenario?
Hi,
we use testcafe for our E2E tests, everything was fine until our CI updated Chrome version to 89. We have one test which tests our embed widget which is injected into HTML as
iframe
via our SDK scripts. Our embed communicates with SDK scripts that's why we check ifdocument.referrer
for ou embed is same asevent.origin
(inwindow.parent.postMessage
event which comes to the widget) - to avoid any security vulnerabilities.To do the test we start web server on 3009 port, this web server returns HTML with our SDK and all data needed to initialize widget. Then our SDK script injects
iframe
which point to our main application on 3000 port. Then iframe communicates with parent document which should initialize widget and here we have an issue. Document referrer should point tohttp://localhost:3009/
instead it point to dynamic testcafe url (for example:http://192.168.1.231:53152/
), without running tests by testcafe widget in latest version of Chrome works as expected.Before Chrome update everything was fine (previous version which wasn't failing 86), on the other hand Safari works as should and
document.referrer
points to proper address inside our iframe. I attached screenshots with logs from both Chrome, Chrome - testcafe runner and Safari - testcafe runner.What is the Current behavior?
document.referrer
inside iframe point to wrong address.What is the Expected behavior?
document.referrer
inside iframe should point to our test server address.What is your web application and your TestCafe test code?
Your website URL (or attach your complete example):
Example app with SDK: https://adoring-roentgen-3ac020.netlify.app/
Your complete test code (or attach your test files):
Your complete configuration file (if any):
Your complete test report:
Screenshots:
Chrome 89 without testcafe runner
Chrome 89 running by testcafe.
Safari running by testcafe
Steps to Reproduce:
Your Environment details:
The text was updated successfully, but these errors were encountered: