Search code examples
seleniumselenium-webdriverwebdrivermicrosoft-edgecontent-security-policy

Relaxing Microsoft Edge CSP while running tests (webdriver) (Content-Security-policy)


I'm trying to relax Microsoft Edge CSP while running a test using proctractor (webdriver, chromedriver).

So the solution can be either

  1. flag like "--disable-csp" which dose not exist according to my search results.
  2. setting for webdriver/protractor to do so.
  3. load an extension that dose that ( Like in chrome Relaxing Chrome's CSP while running tests (webdriver) (Content-Security-policy)) I could not find any solution but to setup a proxy that filters the header.

any ideas?


Solution

  • I've settled on the best approach by taking the same approach for Chrome, using the same answer from the previous question, and just converting the Chrome extension to a Microsoft-Edge one.

    1. Follow the linked question to the point you got.
    2. Convert the Chrome extension to an Edge extension using this tool
    3. Use the extensionPath option to load the extension.