How to use electron-context-menu - 6 common examples

To help you get started, we’ve selected a few electron-context-menu 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 dreamnettech / dreamtime / src / electron / src / index.js View on Github external
if (startsWith(url, 'http') || startsWith(url, 'mailto')) {
          event.preventDefault()
          shell.openExternal(url)
          nucleus.track('EXTERNAL_LINK', { href: url })
          return
        }

        logger.debug('Opening new window.', {
          event,
          url,
        })
      })
    })

    // allow save image option
    contextMenu({
      showSaveImageAs: true,
    })

    // system stats.
    await system.setup()

    // user settings.
    await settings.initialSetup()
    await settings.setup()

    // analytics & app settings.
    await nucleus.setup()

    // services
    await Promise.all([
      rollbar.setup(), // bug tracking.
github Opentrons / opentrons / app-shell / src / main.js View on Github external
function startUp() {
  log.info('Starting App')
  process.on('uncaughtException', error => log.error('Uncaught: ', { error }))

  mainWindow = createUi()
  rendererLogger = createRendererLogger()

  mainWindow.once('closed', () => (mainWindow = null))

  if (config.devtools) installDevtools()
  contextMenu({ showInspectElement: config.devtools })
  initializeMenu()

  // wire modules to UI dispatches
  const dispatch = action => {
    log.silly('Sending action via IPC to renderer', { action })
    mainWindow.webContents.send('dispatch', action)
  }

  const actionHandlers = [
    registerConfig(dispatch),
    registerDiscovery(dispatch),
    registerRobotLogs(dispatch, mainWindow),
    registerUpdate(dispatch),
    registerBuildrootUpdate(dispatch),
    registerLabware(dispatch, mainWindow),
  ]
github Kong / insomnia / app / ui / components / viewers / response-webview.js View on Github external
_handleSetWebviewRef (n) {
    this._webview = n;
    if (n) {
      contextMenu({window: this._webview});
    }
  }
github Kong / insomnia / packages / insomnia-app / app / ui / components / viewers / response-web-view.js View on Github external
_handleDOMReady() {
    if (!this._webview) {
      return;
    }

    this._webview.removeEventListener('dom-ready', this._handleDOMReady);
    contextMenu({ window: this._webview });
    this._setBody();
  }
github ZeusWPI / MOZAIC / planetwars / client / app / main / menu.ts View on Github external
export async function attachContextMenu(window: BrowserWindow) {
  contexMenu({
    window,
    showInspectElement: true,
    showSaveImageAs: true,
    prepend: (params, browserWindow): MenuItem[] => [new MenuItem({
      label: 'Rainbow',
      enabled: true,
      visible: params.mediaType === 'image',
      click() {
        log.warn("The Rainbow warns you!");
      },
    })],
  });
}
github ulver2812 / aws-s3-backup / main.ts View on Github external
function createContextMenuInternal() {
  contextMenuInternal.default({
    showInspectElement: false
  });
}

electron-context-menu

Context menu for your Electron app

MIT
Latest version published 4 months ago

Package Health Score

78 / 100
Full package analysis

Popular electron-context-menu functions