Cypress throwing SecurityError Cypress throwing SecurityError google-chrome google-chrome

Cypress throwing SecurityError


I had the very same issue yesterday and the answer from @jsjoeio in the cypress issue #1951 you've referenced in your question actually helped me.

So basically only thing I've done was to modify my cypress.json and add following value:

{  "chromeWebSecurity": false}


So, at least for me, my further problem was an internal one with tokens, logins, etc. BUT!

the code I posted for how the index in the plugin folder is correct to bypass the chrome issue. That is how you want to fix it!


I had exactly the same problem, I advise you to do as DurkoMatko recommends. Documentation chromeWebSecurity

But I encountered another problem with a link pointing to localhost in an iframe.If you want to use a link in an iframe I recommend this :

cy.get('iframe').then((iframe) => {  const body = iframe.contents().find('body');  cy.wrap(body).find('a').click();});