How to use the electron.ipcRenderer.send function in electron

To help you get started, we’ve selected a few electron 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 tonton-pixel / vade-mecum-shelf / renderer / renderer.js View on Github external
}
//
webFrame.setLayoutZoomLevelLimits (settings.minZoomLevel, settings.maxZoomLevel);
//
function generateTitle (unitName)
{
    let title = settings.window.titleTemplate
                    .replace ("{{app}}", appName)
                    .replace ("{{unit}}", unitName);
    let zoomFactor = Math.round (webFrame.getZoomFactor () * 100);
    return title + ((zoomFactor !== 100) ? settings.window.zoomSuffixTemplate.replace ("{{zoom}}", zoomFactor) : "");
}
//
if (settings.unitsMenu)
{
    ipcRenderer.send ('update-units-menu', [ ]);
}
//
// Collect units information
let categories = { };
let categoryNames = [ ];
let unitNames = [ ];
let unitElements = { };
let unitImports = [ ];
//
let unitsDirname = path.join (__dirname, 'units');
let unitsFilenames = fs.readdirSync (unitsDirname);
//
let unitFilenames = [ ];
//
for (let unitsFilename of unitsFilenames)
{
github HR / CryptoSync / static / masterpassprompt.html View on Github external
function validateField (field, errLabel) {
      var MPregex = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$/g,
        MPel = $(`input#${field + 'Input'}`)
      const masterpass = MPel.val()
      if (MPregex.test(masterpass)) {
        errLabel.hide()
        MPel.val('')
        ipcRenderer.send(field, masterpass)
      } else if (!masterpass) {
        errLabel.text(responses.empty)
        errLabel.show()
        MPel.val('')
      } else {
        errLabel.text(responses.invalid)
        errLabel.show()
        MPel.val('')
      }
    }
github pursuit-gg / pursuit-client / public / uploadCaptureFolderBW.html View on Github external
fs.pathExists(folder, (err, exists) => {
        if (err) {
          console.error(err);
          Sentry.captureException(err);
          ipc.send('capture-folder-upload-error', folder, userId, spectator, err);
          if (uploadTries < 5) {
            setTimeout(uploadFolder, 3000);
          } else {
            deleteFolder();
          }
          return;
        } else if (!exists) {
          ipc.send('capture-folder-upload-finished', folder, userId, spectator);
          window.close();
          return;
        }
        const folderName = folder.match(/[\\/]([^\\/]+)$/)[1];
        const uploadKey = `fortnite/packed/${userId}/${folderName}.tar.gz`;
        console.log('pre zip');
        const passThrough = new PassThrough();
        tar.create({ gzip: true }, [folder]).pipe(passThrough);
github Sn8z / Poddr / src / app / services / audio.service.ts View on Github external
private onPlay = () => {
		log.info("Audio service :: Playing.");
		this.playing.next(true);
		ipc.send("media-play");
	}
github bunqCommunity / bunqDesktop / src / react / Pages / Contacts / Contacts.jsx View on Github external
openGoogleConsentScreen = event => {
        ipcRenderer.send("open-google-oauth");
    };
    handleGoogleCallback = (event, accessToken) => {
github elyukai / optolith-client / src / entry.tsx View on Github external
dispatch (redoAccelerator ())
    })

    localShortcut.register (currentWindow, "CmdOrCtrl+Shift+Z", () => {
      dispatch (redoAccelerator ())
    })

    localShortcut.register (currentWindow, "CmdOrCtrl+W", () => {
      dispatch (backAccelerator ())
    })

    localShortcut.register (currentWindow, "CmdOrCtrl+O", () => {
      dispatch (openSettingsAccelerator ())
    })

    ipcRenderer.send ("loading-done")

    return Unit
  })
  .catch (() => undefined)
github iamjohnbarker / button-switch / assets / customisation / streamDeckCustomisation.js View on Github external
document.getElementById("streamdeckSave").addEventListener("click", () => {
	ipcRenderer.send("streamdeck-save", "save clicked!");
});
github keybase / client / shared / app / main.desktop.js View on Github external
_updateBadges = () => {
    ipcRenderer.send('showTray', this.props.widgetBadge, this.props.desktopAppBadgeCount)
  }
github drakang4 / jamak / app / renderer / components / PrepareDropzone / index.js View on Github external
files.forEach((file) => {
      const filePath = file.path;
      const ext = path.extname(filePath).substring(1);

      if (validator.isIn(ext, subtitleTypes)) {
        ipcRenderer.send('ask-open-file', filePath);
      } else if (validator.isIn(ext, videoTypes)) {
        ipcRenderer.send('ask-open-video', filePath);
      }
    });
  };