main: fix external link not working correctly
This commit is contained in:
1 parent
c38d6153fe
commit
5599c40db1
3 files changed
+9
-5
No files matched your search
@@ -1,11 +1,10 @@
|
||||
import { contextBridge, ipcRenderer, shell } from 'electron'
|
||||
import { contextBridge, ipcRenderer } from 'electron'
|
||||
|
||||
// Whitelist of valid channels used for IPC communication (Send message from Renderer to Main)
|
||||
const mainAvailChannels = ['msgRequestGetVersion']
|
||||
const mainAvailChannels = ['msgRequestGetVersion', 'msgOpenExternalLink']
|
||||
const rendererAvailChannels = ['msgReceivedVersion']
|
||||
|
||||
contextBridge.exposeInMainWorld('mainApi', {
|
||||
openExternal: async (url) => await shell.openExternal(url),
|
||||
send: (channel, data) => {
|
||||
if (mainAvailChannels.includes(channel)) {
|
||||
ipcRenderer.send(channel, data)
|
||||
|
||||
Reference in new issue
Block a user