work around startup hang in dev on Win10 dark mode #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves
This is a workaround for MarshallOfSound/electron-devtools-installer#122 which seems to be a result of electron/electron#19468.
Proposed Changes
The main change is to introduce a bit of code which, on Windows only, deletes the file
DevTools Extensions
from Electron's internal storage directory. That's pretty hacky, but short of asking the user to change their system settings this seems to be the only reliable workaround for the issues.While trying to track down the cause of the problem, I ended up making minor improvements to the way we install DevTools extensions. Those changes are in this PR as well, and include:
Reason for Changes
There seem to be two workarounds for the DevTools startup hang:
DevTools Extensions
file and/orextensions
directory.Since I don't want to force a user or developer to change their system settings, I opted for the latter option. Also, deleting the
DevTools Extensions
file should be quicker and possibly more reliable than deleting the directory.Note that if a user opens the developer panel in a released build, which isn't easy but isn't impossible, they might cause the
DevTools Extensions
file to be created. If they're using Windows 10 dark mode, the app would then hang on next launch despite not being "officially" in development mode. For that reason, the code to delete theDevTools Extensions
file is not inside a check for development mode.