How to use the electron.remote.getGlobal 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 sidneys / pb-for-desktop / app / scripts / renderer / browser.js View on Github external
window.showNotification = function(push) {
    // If snooze is active, global.snoozeUntil is === 0
    let isSnoozed = Boolean(remote.getGlobal('snoozeUntil'));

    // DEBUG
    logger.devtools('snoozed', isSnoozed);

    if (Date.now() < remote.getGlobal('snoozeUntil')) {
        return;
    }

    if ((push.active && push.active === true) || (push.type && push.type === 'mirror')) {
        return new Notification(null, push);
    }
};
github Lewdninja / liveme-pro-tools / app / js / index.js View on Github external
/* global $ */

const MAX_PER_PAGE = 10
const MAX_RETRIES = 3

const { electron, BrowserWindow, remote, ipcRenderer, shell, dialog, clipboard } = require('electron')
const fs = require('fs')
const path = require('path')
const appSettings = remote.require('electron-settings')
const isDev = remote.getGlobal('isDev')
const LiveMe = remote.getGlobal('LiveMe')
const DataManager = remote.getGlobal('DataManager')
const formatDuration = require('format-duration')
const prettydate = require('pretty-date')
const request = require('request')

let currentUser = {}
let currentPage = 1
let currentIndex = 0
let tempvar = null
let hasMore = false
let currentSearch = ''
let scrollBusy = false
let currentView = 'home'

$(function () {
    document.title = 'LiveMe Pro Tools v' + remote.app.getVersion() // Set Title of Window
github OpenBazaar / openbazaar-desktop / js / start.js View on Github external
window.addEventListener('contextmenu', (e) => {
  e.preventDefault();
  ipcRenderer.send('contextmenu-click');
}, false);

// Instantiating our Server Configs collection now since the page nav
// utilizes it. We'll fetch it later on.
app.serverConfigs = new ServerConfigs();

app.pageNav = new PageNav({
  serverConfigs: app.serverConfigs,
});
$('#pageNavContainer').append(app.pageNav.render().el);

let externalRoute = remote.getGlobal('externalRoute');

app.router = new ObRouter();

// Clear the external route flag as soon as it's used so it's not re-used
// on app refreshes.
app.router.on('route', () => (externalRoute = null));

// create our status bar view
app.statusBar = new StatusBar();
$('#statusBar').html(app.statusBar.render().el);

const startupConnectMessaging = new StartupConnectMessaging();

// Create loading modal, which is a shared instance used throughout the app
app.loadingModal = new LoadingModal({
  dismissOnOverlayClick: false,
github MarshallOfSound / Google-Play-Music-Desktop-Player-UNOFFICIAL- / src / renderer / generic / core / RendererPluginController.js View on Github external
uninstall(pluginPath) {
    if (this.plugins[pluginPath]) {
      try {
        this.plugins[pluginPath].uninstall();
      } catch (err) {
        remote.getGlobal('Logger').error('Error while uninstalling plugin', this.plugins[pluginPath].constructor.PLUGIN_NAME, { message: err.message, stack: err.stack });
      }
      this.plugins[pluginPath].__BINDINGS__.forEach((binding) => {
        Emitter.off(binding[0], binding[1]);
      });
      purgeCache(pluginPath);
    }
  }
}
github web-pal / chronos-timetracker / app / utils / api / timer.js View on Github external
fs.writeFile(imageDir, validImage, 'base64', (err) => {
              if (err) reject();

              remote.getGlobal('sharedObj').lastScreenshotPath = imageDir;
              remote.getGlobal('sharedObj').screenshotTime = screenshotTime;
              remote.getGlobal('sharedObj').timestamp = now;
              remote.getGlobal('sharedObj').screenshotPreviewTime = screenshotPreviewTime;
              remote.getGlobal('sharedObj').nativeNotifications = nativeNotifications;

              if (showPreview) {
                ipcRenderer.send('show-screenshot-popup');
              } else {
                ipcRenderer.send('screenshot-accept');
              }
              resolve();
            });
          },
github machawk1 / wail / wail-ui / components / combined / collectionView.js View on Github external
acum[ seed.get('url') ] = state.get('crawls').get(`${latest}`)
        return acum
      }
      acum[ seed.get('url') ] = state.get('crawls').get(`${seed.get('jobIds').get(0)}`)
      return acum
    }, {}))
  } else {
    return Immutable.Map()
  }
}

const stateToProps = (state, ownProps) => ({
  collection: state.get('collections').get(ownProps.params.col),
  viewingCol: ownProps.params.col,
})
const wbUrl = remote.getGlobal('settings').get('pywb.url')
const openInWb = (seed, forCol) => shell.openExternal(`${wbUrl}${forCol}/*/${seed}`)

@connect(stateToProps)
export default class CollectionView extends Component {
  static contextTypes = {
    muiTheme: PropTypes.object.isRequired
  }
  static propTypes = {
    collection: PropTypes.instanceOf(Immutable.Map).isRequired,
    viewingCol: PropTypes.string.isRequired
  }

  constructor (...args) {
    super(...args)
    this.state = {
      searchText: '',
github zenoven / Dara / src / renderer / layout / sidebar / index.js View on Github external
import { connect } from 'dva';
import { remote } from 'electron';
import React, { PureComponent } from 'react';
import { Icon, Menu, Button } from 'antd';
import styles from './index.less';

const { window } = remote.getGlobal('services');
const MenuItem = Menu.Item;

export const statusList = [
  {
    key: 'active',
    countProps: 'numActive',
    text: 'θΏ›θ‘ŒδΈ­',
    icon: 'caret-right'
  },
  {
    key: 'waiting',
    countProps: 'numWaiting',
    text: 'ε·²ζš‚εœ',
    icon: 'pause',
  },
  {
github MattNer0 / Epiphany / src / renderer / js / utils / elosenv.js View on Github external
isDarwin() {
		return remote.getGlobal('isDarwin')
	},
	isLinux() {
github burtonator / polar-bookshelf / web / js / electron / app_path / AppPath.ts View on Github external
public static get() {

        const electronContext =  ElectronContextTypes.create();

        if (electronContext === ElectronContextType.RENDERER) {
            return remote.getGlobal("appPath");
        } else {
            return global.appPath;
        }

    }