-
-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e051aa8
commit d8c8b0a
Showing
12 changed files
with
7,232 additions
and
1,348 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,33 @@ | ||
//console.log('preload is loading...') | ||
|
||
const { | ||
contextBridge, | ||
ipcRenderer | ||
} = require("electron"); | ||
|
||
|
||
//console.log('hello from preload...') | ||
|
||
// Expose protected methods that allow the renderer process to use | ||
// the ipcRenderer without exposing the entire object | ||
contextBridge.exposeInMainWorld( | ||
"api", { | ||
send: (channel, data) => { | ||
// whitelist channels | ||
let validChannels = ["toMain","online","number","data","offnum","offline","imgsrc","whatsapp_username","profile_data","contact_data"]; | ||
if (validChannels.includes(channel)) { | ||
ipcRenderer.send(channel, data); | ||
} | ||
}, | ||
receive: (channel, func) => { | ||
let validChannels = ["fromMain"]; | ||
if (validChannels.includes(channel)) { | ||
// Deliberately strip event as it includes `sender` | ||
ipcRenderer.on(channel, (event, ...args) => func(...args)); | ||
} | ||
} | ||
} | ||
); | ||
|
||
|
||
//console.log('preload loaded successfully') |
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.