-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump electron; Use exposeInMainWorld; (#41)
* Bymp electron; Use exposeInMainWorld; * Add test case; Co-authored-by: Kiril Knysh <>
- Loading branch information
1 parent
a9c0fc9
commit 36b47ce
Showing
10 changed files
with
215 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const { contextBridge, ipcRenderer } = require('electron'); | ||
|
||
// inspired by https://stackoverflow.com/a/59888788/1404942 | ||
contextBridge.exposeInMainWorld('qd', { | ||
onWorkerCreated(payload) { | ||
ipcRenderer.send('wrk::created', payload); | ||
}, | ||
onWorkerFilled(payload) { | ||
ipcRenderer.send('wrk::filled', payload); | ||
}, | ||
onWorkerDone(payload) { | ||
ipcRenderer.send('wrk::done', payload); | ||
}, | ||
|
||
onMessage(callback) { | ||
ipcRenderer.on('message', (event, ...args) => { | ||
callback(...args); | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.