MicrosoftEdge / EdgeWebDriver

Feedback and discussions about WebDriver for Microsoft Edge
MIT License
52 stars 7 forks source link

Launching msedge.exe with --no-sandbox command line switch #141

Open michasanyi opened 3 months ago

michasanyi commented 3 months ago

Hi there, Since version 119 on some machines edge browser is not able to run due to the following error:

"Code Integrity determined that a process (\Device\HarddiskVolume2\Program Files (x86)\Microsoft\Edge\Application\msedge.exe) attempted to load \Device\HarddiskVolume2\Windows\System32\sysfer.dll that did not meet the Microsoft signing level requirements."

The mentioned sysfer.dll is part of Symantec Endpoint Protection, which is used in our company. However if msedge.exe is started with --no-sandbox command line switch, then edge browser is able to run well (however there is a security risk). Our tests use only web pages written by us, that's why it is sure that those web pages do not contain any harmful viruses. It would be nice if there was a way to have msedgedriver to launch edge browser with --no-sandbox switch. I guess a new option could be added to EdgeOptions. Thanks in advance, michasanyi

michasanyi commented 3 months ago

I had a look into structure of EdgeDriverService. It has a property named CommandLineArguments, but it has only getter. Adding setter to it would solve my problem.

michasanyi commented 3 months ago

There might be a simpler and more general solution: It looks from the verbose log that msedge.exe is searched for first in the current directory, then in the current user's \AppData\Local\Microsoft\Edge\Application\ folder, finally in C:\Program Files (x86)\Microsoft\Edge\Application. If shortcut to msedge.exe was searched for also (before checking if exe is present in the mentioned folders), then any additional command line argument could be set in the shortcut.