chrisjlee chrisjlee - 2 years ago 449
Javascript Question

protractor - launch chrome with to disable web security for cors

So our application works in production with a CORS enabled.

I have a project that isn't CORS enabled locally. Is there a way to disable web security for protractor? Is there a way for me to add arguments to the selenium instance ?

We're looking for a configuration based solution. Our local development machines are pretty locked down on what we can install. So is this possible?

What i have tried is setting chrome options:

But that appears to only be used for chrome extensions.

Answer Source

There is also args inside chromeOptions, provide the --disable-web-security argument:

capabilities: {
  'browserName': 'chrome',
  'chromeOptions': {
    'args': ['--disable-web-security']
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download