How to use the electron-better-ipc.callRenderer function in electron-better-ipc

To help you get started, we’ve selected a few electron-better-ipc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WhiteMinds / LiveAutoRecord / src / main / index.js View on Github external
mainWindow.on('close', (event) => {
    if (store.recordingChannels.length > 0) {
      // 有录制中的视频, 将关闭过程转交给主窗口
      event.preventDefault()
      ipc.callRenderer(mainWindow, IPCMsg.OpenCloseTip)
    } else {
      // 主窗口关闭直接强制退出, 后面要兼容mac的话应该还要再修改
      app.quit()
    }
  })
github pacocoursey / Opus / src / helpers.js View on Github external
async click() {
            // If called from splash window, send a message to show spinner
            if (BrowserWindow.getFocusedWindow() === splashWindow) {
              ipc.callRenderer(splashWindow, 'showSpinner');
            }

            const res = await openWindow();

            if (res) {
              closeSplashWindow();
            }
          },
        },
github WhiteMinds / LiveAutoRecord / src / main / index.js View on Github external
click: () => {
        if (store.recordingChannels.length > 0) {
          if (!win.isVisible()) win.show()
          win.focus()
          ipc.callRenderer(mainWindow, IPCMsg.OpenCloseTip)
        } else {
          app.quit()
        }
      }
    }
github rethinkdb / rethinkdb-desktop / app / main / db / models / stats.js View on Github external
async onTick () {
    try {
      const servers = await getServerStats()
      const tables = await getTableStats()
      const indexes = await getIndexStats()
      const resources = await getResourceStats()
      const issues = await getIssuesStats()

      const win = BrowserWindow.getAllWindows()
      if (win.length) {
        ipc.callRenderer(win[0], STATS_CHANNEL_NAME, {
          servers,
          tables,
          indexes,
          resources,
          issues
        })
      }
    } catch (e) {
      console.warn('startLiveStats failed: ', e)
    }
  },
  async startLiveStats () {
github kitze / JSUI / electron / electron.js View on Github external
app.on('browser-window-blur', () => ipc.callRenderer(mainWindow, 'set-focused', false));
github kitze / JSUI / electron / electron.js View on Github external
const callShortcut = shortcut => ipc.callRenderer(mainWindow, CALLS.SHORTCUT, shortcut);
github kitze / JSUI / electron / electron.js View on Github external
app.on('browser-window-focus', () => ipc.callRenderer(mainWindow, 'set-focused', true));
github WhiteMinds / LiveAutoRecord / src / main / ipc.js View on Github external
.forEach(win => {
      ipc.callRenderer(win, IPCMsg.SetConfig, config.data)
    })
})
github deadcoder0904 / wip-desktop / src / main / createWindow.js View on Github external
window.on("focus", async () => {
    await callRenderer(window, "window-blur", "false");
  });