Skip to content

Commit c67b95a

Browse files
committed
Update templates
1 parent 8073377 commit c67b95a

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"nodemon": "^2.0.7",
4242
"style-loader": "^2.0.0",
4343
"underscore.string": "^3.3.5",
44-
"webpack": "^5.24.2",
44+
"webpack": "^5.24.3",
4545
"webpack-inject-plugin": "^1.5.5",
4646
"webpack-merge": "^5.7.3"
4747
},

templates/javascripts/preload.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
// Preload File that should be loaded into browser window instead of
33
// setting nodeIntegration: true for browser window
44

5-
import { ipcRenderer } from 'electron'
5+
import { contextBridge, ipcRenderer } from 'electron'
66

7-
window.onLoaded = callback => {
8-
ipcRenderer.on('loaded', callback)
9-
}
7+
contextBridge.exposeInMainWorld('MessagesAPI', {
8+
onLoaded: callback => {
9+
ipcRenderer.on('loaded', callback)
10+
}
11+
})

templates/javascripts/renderer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require('application.css')
22

3-
window.onLoaded((_, data) => {
3+
window.MessagesAPI.onLoaded((_, data) => {
44
document.getElementById('title').innerHTML = data.appName + ' App'
55
document.getElementById('details').innerHTML = 'built with Electron v' + data.electronVersion
66
document.getElementById('versions').innerHTML = 'running on Node v' + data.nodeVersion + ' and Chromium v' + data.chromiumVersion

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -7926,10 +7926,10 @@ webpack-sources@^2.1.1:
79267926
source-list-map "^2.0.1"
79277927
source-map "^0.6.1"
79287928

7929-
webpack@^5.24.2:
7930-
version "5.24.2"
7931-
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.24.2.tgz#33790dad631e8b639f4246d762e257720875fe54"
7932-
integrity sha512-uxxKYEY4kMNjP+D2Y+8aw5Vd7ar4pMuKCNemxV26ysr1nk0YDiQTylg9U3VZIdkmI0YHa0uC8ABxL+uGxGWWJg==
7929+
webpack@^5.24.3:
7930+
version "5.24.3"
7931+
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.24.3.tgz#6ec0f5059f8d7c7961075fa553cfce7b7928acb3"
7932+
integrity sha512-x7lrWZ7wlWAdyKdML6YPvfVZkhD1ICuIZGODE5SzKJjqI9A4SpqGTjGJTc6CwaHqn19gGaoOR3ONJ46nYsn9rw==
79337933
dependencies:
79347934
"@types/eslint-scope" "^3.7.0"
79357935
"@types/estree" "^0.0.46"

0 commit comments

Comments
 (0)