This repository was archived by the owner on Jun 20, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { app } from 'electron'
2
+
3
+ /**
4
+ * @FIXME
5
+ * Due to a bug in Electron (https://github.com/electron/electron/issues/28422),
6
+ * downloading a file using the File System Access API does not work, causing an exception:
7
+ * "Uncaught DOMException: The request is not allowed by the user agent or the platform in the current context."
8
+ *
9
+ * The following workaround fixes the issue by enabling experimental web platform features
10
+ * which makes the file system access permission always be true.
11
+ *
12
+ * Since this workaround involves enabling experimental features, it could lead
13
+ * to other issues. This should be removed as soon as the upstream bug is fixed.
14
+ */
15
+ export const enableExperimentalFeaturesForFileAccessFix = ( ) =>
16
+ app . commandLine . appendSwitch ( 'enable-experimental-web-platform-features' )
Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ import { setupTesting } from './javascripts/Main/Utils/Testing'
10
10
import { CommandLineArgs } from './javascripts/Shared/CommandLineArgs'
11
11
import { Store , StoreKeys } from './javascripts/Main/Store'
12
12
import { Paths } from './javascripts/Main/Types/Paths'
13
+ import { enableExperimentalFeaturesForFileAccessFix } from './enableExperimentalWebFeatures'
14
+
15
+ enableExperimentalFeaturesForFileAccessFix ( )
13
16
14
17
require ( '@electron/remote/main' ) . initialize ( )
15
18
You can’t perform that action at this time.
0 commit comments