question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cypress Cross Origin error with Chrome despite the chromeWebSecurity to false

See original GitHub issue

Current behavior

We have a test that needs to click to an element leading to an external url. Once the url is loaded some checks happen. We used to have the test working on 9.7. But since the migration to 10.4.0 we have this test failing with the error explaining to add the chromeSecurity flag to false but we already have it set on the cypress.config.js. Maybe a small detail here : we call cypress with our own config.js provided with a path.

Desired behavior

The test should work as before since the security flag is disabled.

Test code to reproduce

    afterEach(() => {
      cy.url().should("include", EXTRA_INFORMATION);
    });

    it("Opens an external url with extra information on element click", () => {
      cy.get(SELECTOR)
        .first()
        .click();
    });

Cypress Version

10.4.0

Other

Running on windows 10

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:23 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
AurelienKuncommented, Aug 11, 2022

OK i found some little time and was able to easily reproduce : https://github.com/AurelienKun/demo

1reaction
AurelienKuncommented, Aug 20, 2022

Hi @AurelienKun ! It’s interesting that it works in headless mode but not in open mode. Are you using the same browser when running headless and open? Which browser is it?

Same 104 version. You can see it on the screenshot I have provided 😃

Here’s instructions on how to print debug logs that you can then upload to this issue

Great ! I’ll give it a try soon. I’ll keep you updated as soon as I get some logs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Web Security - Cypress Documentation
Set chromeWebSecurity to false · Display insecure content · Navigate to any superdomain without cross-origin errors with or without cy.origin · Access cross-origin...
Read more >
{ "chromeWebSecurity": false } seems not work as expected
Chrome console displays "refused to display "https://......." in a frame because it set 'X-Frame-Options' to 'sameorigin'. I'm testing an app ...
Read more >
Disable Chrome Web Security for Cypress Testing
I have multiple tests where 1 test requires chromeWebSecurity to be true and another test that requires chromeWebSecurity(iFrames CORS error) to ...
Read more >
Configuring Cypress to work with iFrames & cross-origin sites.
Access cross origin iframes that are embedded in your application. Simply by setting chromeWebSecurity to false in your cypress.json { "chromeWebSecurity": ...
Read more >
Web Security - Cypress - w3resource
Access the cross-origin iframes that are embedded in your application. To disable web security, you will need to set chromeWebSecurity to false ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found