mirror of
https://github.com/burrow-dev/burrow-client.git
synced 2026-11-19 01:37:50 -05:00
Brought up to date with the private repository (6630f7f)
This commit is contained in:
commit
c8178dce98
26 files changed
+6314
No files matched your search
@@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
|
||||
const { ipcRenderer, contextBridge } = require("electron");
|
||||
|
||||
const sendWhitelist = new Set()
|
||||
.add("initialized")
|
||||
.add("fps")
|
||||
.add("printImage")
|
||||
.add("reloadGame")
|
||||
.add("reportError")
|
||||
.add("signupCompleted");
|
||||
|
||||
const receiveWhitelist = new Set()
|
||||
.add("flashVarsReady")
|
||||
.add("hud")
|
||||
.add("removed");
|
||||
|
||||
contextBridge.exposeInMainWorld(
|
||||
"ipc", {
|
||||
sendToHost: (channel, ...args) => {
|
||||
if (sendWhitelist.has(channel)) {
|
||||
ipcRenderer.sendToHost(channel, ...args);
|
||||
}
|
||||
},
|
||||
on: (channel, listener) => {
|
||||
if (receiveWhitelist.has(channel)) {
|
||||
ipcRenderer.on(channel, listener);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
ipcRenderer.on("redirect-url", (event, url) => {
|
||||
console.log("REDIRECT");
|
||||
});
|
||||
Reference in new issue
Block a user