javascript - Windows Defender slowing down Electron startup
问题描述
Context
I have setup a trivial Electron app which shows a plain html file and it consistently takes more than two seconds to start up. The key performance measurements are:
- 170 ms: a blank window appears on the screen
- 2800 ms: the window shows the specified HTML
After asking about it, I discovered that the problem is caused by Windows Defender. Disabling its real-time protection gets us an acceptable startup speed:
- 150 ms: a blank window appears on the screen
- 500 ms: the window shows the specified HTML
While this speedup solves the problem completely, it is a no-go to ask users to disable Windows Defender in order to have faster startup.
Question
I have observed some popular Electron apps, like Visual Studio Code, have normal startup time so I assume there is a way to achieve that without disabling Windows Defender. The question is: how?
The only thing that comes to my mind is signing the electron binary, in the hope that it solves the problem. But since a signing certificate costs money I'd rather be sure I need it before going down this route. It would be great if someone with experience on this area could chime in!
Requirement
I am looking for a solution that doesn't require telling my users to modify their environment.
解决方案
您最好的选择是将您的可执行文件作为示例提交给 MS Defender Team 以供审核:https ://www.microsoft.com/en-us/wdsi/filesubmission,请在评论中提及您的问题。他们几乎每天都会发布防御者更新,所以这应该没什么大不了的
您可以帮助自己的另一件事是将您的 exe 放入 Defender AV 的排除列表中(大多数 Microsoft 受信任的位置通常都在排除中),所以这应该是轻而易举的事。
当然,同时与 Microsoft 一起打开一个案例来帮助您。
推荐阅读
- python - 找不到文件制造商数据源名称,并且未指定默认驱动程序 - pythonanywhere
- javascript - 输入元素内的动态数字操作,增量加法
- php - 无法在 localhost 中使用 guzzle 或 curl
- plesk - 在 Plesk 中将自定义用户代理添加到 Modsecurity OWASP 规则
- javascript - Javascript 切换样式显示 ON/OFF 在单个函数中不起作用?
- elasticsearch - Elasticsearch Java HighLevelRestClient如何创建not_analyzed索引?
- c++ - 委托构造函数和引用参数
- sql - 无重复联合或连接查询
- docker - 无法使用 Google Cloud Kubernetes 替换
- python-3.x - 在 Python 中将列表连接成字符串