Skip to content

Commit 55e2f18

Browse files
authored
Merge pull request element-hq#10392 from vector-im/jryans/electron-5
Upgrade to Electron 5
2 parents e71fcc3 + 88e8fbb commit 55e2f18

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

electron_app/src/electron-main.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
Copyright 2016 Aviral Dasgupta
33
Copyright 2016 OpenMarket Ltd
4-
Copyright 2018 New Vector Ltd
4+
Copyright 2018, 2019 New Vector Ltd
55
Copyright 2017, 2019 Michael Telatynski <7t3chguy@gmail.com>
66
77
Licensed under the Apache License, Version 2.0 (the "License");
@@ -211,7 +211,14 @@ const launcher = new AutoLaunch({
211211
// work.
212212
// Also mark it as secure (ie. accessing resources from this
213213
// protocol and HTTPS won't trigger mixed content warnings).
214-
protocol.registerStandardSchemes(['vector'], {secure: true});
214+
protocol.registerSchemesAsPrivileged([{
215+
scheme: 'vector',
216+
privileges: {
217+
standard: true,
218+
secure: true,
219+
supportFetchAPI: true,
220+
},
221+
}]);
215222

216223
app.on('ready', () => {
217224
if (argv['devtools']) {

electron_app/src/preload.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2018 New Vector Ltd
2+
Copyright 2018, 2019 New Vector Ltd
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -14,16 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
const { ipcRenderer, webFrame } = require('electron');
17+
const { ipcRenderer } = require('electron');
1818

1919
// expose ipcRenderer to the renderer process
2020
window.ipcRenderer = ipcRenderer;
21-
22-
// Allow the fetch API to load resources from this
23-
// protocol: this is necessary to load olm.wasm.
24-
// (Also mark it a secure although we've already
25-
// done this in the main process).
26-
webFrame.registerURLSchemeAsPrivileged('vector', {
27-
secure: true,
28-
supportFetchAPI: true,
29-
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
},
155155
"build": {
156156
"appId": "im.riot.app",
157-
"electronVersion": "4.2.6",
157+
"electronVersion": "5.0.7",
158158
"files": [
159159
"node_modules/**",
160160
"src/**"

0 commit comments

Comments
 (0)