mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-25 11:59:27 +08:00
✨ 支持本地启动,修改mac 下获取 APP icon 的方式
This commit is contained in:
@@ -1,4 +1,21 @@
|
||||
const remote = require('@electron/remote');
|
||||
const { ipcRenderer } = require('electron');
|
||||
|
||||
const ipcSendSync = (type, data) => {
|
||||
const returnValue = ipcRenderer.sendSync('msg-trigger', {
|
||||
type,
|
||||
data,
|
||||
});
|
||||
if (returnValue instanceof Error) throw returnValue;
|
||||
return returnValue;
|
||||
};
|
||||
|
||||
const ipcSend = (type, data) => {
|
||||
ipcRenderer.send('msg-trigger', {
|
||||
type,
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
window.market = {
|
||||
getLocalPlugins() {
|
||||
@@ -13,4 +30,10 @@ window.market = {
|
||||
refreshPlugin(plugin) {
|
||||
return remote.getGlobal('LOCAL_PLUGINS').refreshPlugin(plugin);
|
||||
},
|
||||
addLocalStartPlugin(plugin) {
|
||||
ipcSend('addLocalStartPlugin', { plugin });
|
||||
},
|
||||
removeLocalStartPlugin(plugin) {
|
||||
ipcSend('removeLocalStartPlugin', { plugin });
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user