Basically, I want to overcome the CORS exceptions in my testing site as it uses a different superdomain on the login page, for that I set chromeWebSecurity
to false. But after that, I was getting another issue
Refused to display 'XXXXXXXXX' in a frame because it set 'X-Frame-Options' to 'deny'.
For this one, I added the Chrome extension 'Ignore X frame headers' and it was working perfectly. But in the Azure DevOps CI pipeline, I am getting the same issue and not able to add 'Ignore X frame headers' as I added it to my testing browser from the web store.
To add the extension to the testing browser before it launches, I tried the below solution
https://github.com/cypress-io/cypress/issues/1763
I have extracted the CRX file and added it to the folder Ignore-X-Frame-headers_v1.1 and the below code for plugins/index.js .
module.exports = (on, config) => { on("before:browser:launch", (browser = {}, args) =>
{ if (browser.name === "chrome") {
args.push("--disable-features=CrossSiteDocumentBlockingIfIsolating,CrossSiteDocumentBlockingAlways,IsolateOrigins,site-per-process");
args.push("--load-extension=cypress/extensions/Ignore-X-Frame-headers_v1.1");
return args; } }); };
Also, set the chromewebSecurity to false in cypress.json
"chromeWebSecurity":false,
I am using the following versions,
- Cypress:3.8.0
- Chrome: Chrome 79