Git Product home page Git Product logo

electron-localshortcut's Introduction

electron-localshortcut

A module to register/unregister a keyboard shortcut locally to a BrowserWindow instance, without using a Menu.

This is built to circumvent this Electron issue.

Travis Build Status NPM module NPM downloads Greenkeeper badge

Installation

npm install --save electron-localshortcut

Usage

	const electronLocalshortcut = require('electron-localshortcut');
	const BrowserWindow = require('electron').BrowserWindow;

	const win = new BrowserWindow();
	win.loadUrl('https://github.com');
	win.show();

	electronLocalshortcut.register(win, 'Ctrl+A', () => {
		console.log('You pressed ctrl & A');
	});

	electronLocalshortcut.register(win, 'Ctrl+B', () => {
		console.log('You pressed ctrl & B');
	});

	electronLocalshortcut.register(win, ['Ctrl+R', 'F5'], () => {
        console.log('You pressed ctrl & R or F5');
    });

	console.log(
		electronLocalshortcut.isRegistered(win, 'Ctrl+A')
	);      // true

	electronLocalshortcut.unregister(win, 'Ctrl+A');
	electronLocalshortcut.unregisterAll(win);

App shortcuts.

If you omit the window argument of isRegistered, unregisterAll, unregister and register methods, the shortcut is registered as an app shortcut. It is active when any window of the app is focused.

They differ from native global-shortcuts because they doesn't interfere with other apps running on the same machine.

Shortcut behaviour.

If you register a shortcut for a window, this module unregister the shortcut when the window is hidden, unfocused or minimized, and automatically restore it when the window is restored and focused again.

If you register an app shortcut, this module unregister the shortcut when all windows of your app are hidden, unfocused or minimized, and automatically restore it when any window of your app is restored and focused again.

API

disableAll

Disable all of the shortcuts registered on the BrowserWindow instance. Registered shortcuts no more works on the window instance, but the module keep a reference on them. You can reactivate them later by calling enableAll method on the same window instance.

Parameters

  • win BrowserWindow BrowserWindow instance

Returns Undefined

enableAll

Enable all of the shortcuts registered on the BrowserWindow instance that you had previously disabled calling disableAll method.

Parameters

  • win BrowserWindow BrowserWindow instance

Returns Undefined

unregisterAll

Unregisters all of the shortcuts registered on any focused BrowserWindow instance. This method does not unregister any shortcut you registered on a particular window instance.

Parameters

  • win BrowserWindow BrowserWindow instance

Returns Undefined

register

Registers the shortcut acceleratoron the BrowserWindow instance.

Parameters

  • win BrowserWindow BrowserWindow instance to register. This argument could be omitted, in this case the function register the shortcut on all app windows.
  • accelerator (String | Array<String>) the shortcut to register
  • callback Function This function is called when the shortcut is pressed and the window is focused and not minimized.

Returns Undefined

unregister

Unregisters the shortcut of accelerator registered on the BrowserWindow instance.

Parameters

  • win BrowserWindow BrowserWindow instance to unregister. This argument could be omitted, in this case the function unregister the shortcut on all app windows. If you registered the shortcut on a particular window instance, it will do nothing.
  • accelerator (String | Array<String>) the shortcut to unregister

Returns Undefined

isRegistered

Returns true or false depending on whether the shortcut accelerator is registered on window.

Parameters

  • win BrowserWindow BrowserWindow instance to check. This argument could be omitted, in this case the function returns whether the shortcut accelerator is registered on all app windows. If you registered the shortcut on a particular window instance, it return false.
  • accelerator String the shortcut to check

Returns Boolean if the shortcut accelerator is registered on window.

License

The MIT License (MIT)

Copyright (c) 2017 Andrea Parodi

electron-localshortcut's People

Contributors

ayapi avatar blakef avatar gehuangyi20 avatar greenkeeper[bot] avatar jean-emmanuel avatar jeff-hykin avatar kulbear avatar marshallofsound avatar mdogadailo avatar parro-it avatar vitorgalvao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

electron-localshortcut's Issues

An in-range update of debug is breaking the build 🚨

Version 2.6.7 of debug just got published.

Branch Build failing 🚨
Dependency debug
Current Version 2.6.6
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As debug is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

transparent window

I have a transparent window.

When i use your library and register a shortcut and then press the keys, it converts the window to not being transparent.

When I use globalShortcut, it doesn't change the window transparency setting.

'PrintScreen' not working

localShortcut.register(mainWindow,'PrintScreen',()=>{
//stuff
})
Code is not working.Electron cant detect 'PrintScreen' keypress

An in-range update of p-event is breaking the build 🚨

Version 1.2.0 of p-event just got published.

Branch Build failing 🚨
Dependency p-event
Current Version 1.1.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As p-event is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 3 commits0.

false

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

unregisterAll(mainWindow) shows error

Hi,
I'm trying to remove all shortcuts on app.ready.
I'm using electron V5.07 and localshortcut V3.1.0

My code main.js:

const { app, BrowserWindow, ipcMain, webContents, session, dialog, globalShortcut } = require('electron');
const localshortcut = require('electron-localshortcut');
const settings = require('electron-settings');
const menu = require('./menu');
const fs = require('fs-extra');

let win, mainWindow, newWindow, sets;

app.on('ready', function() {
    // defines mainWindow
    createMainWindow();

    // and load the index.html of the app.
    mainWindow.loadFile('index.html');

    mainWindow.once('ready-to-show', () => {
        mainWindow.show()
    });

    mainWindow.on('leave-full-screen', () => {
        mainWindow.setAutoHideMenuBar(false);
        mainWindow.setMenuBarVisibility(true);
    });

    mainWindow.on('enter-full-screen', () => {
        mainWindow.setAutoHideMenuBar(true);
        mainWindow.setMenuBarVisibility(false);
    });

    localshortcut.unregisterAll(mainWindow);
});

...

function createMainWindow () {
    // Create the browser window.
    mainWindow = new BrowserWindow({
        width: 1000,
        height: 600,
        closable: false,
        resizable: false,
        autoHideMenuBar: true,
        fullscreenable: true,
        // fullscreen: true,    // @TODO - on production set to true and active
        minimizable: false,
        webPreferences: {
            nodeIntegration: true,
            devTools: true,     // @TODO - on production set to false
            plugins: true,
            webviewTag: true,
            webgl: true,
            webaudio: true
        }
    });

    const menu = require('./menu');

    mainWindow.on('closed', () => {
        mainWindow = null;
    })
}
...

The error I get:
grafik

What am I doing wrong?
line 42 is: localshortcut.unregisterAll(mainWindow);

Another question would be - how to disable alt+f4, etc? is it possible? All my tries don't work.

On qwertz keyboard, "z" and "y" are triggered by both "z" and "y"

If I define register for Ctrl + Z or Ctrl + Y for undo and redo, only the one defined first is executed, regardless of whether Ctrl + Z or Ctrl + Y is typed on keyboard. I use a qwertz keyboard for input.

  electronLocalshortcut.register(win, 'Ctrl+Z', () => {
    ... [executed if Ctrl + Z or Ctrl + Y is pressed]
  });
  electronLocalshortcut.register(win, 'Ctrl+Y', () => {
    ... [never executed]
  });

An in-range update of delay is breaking the build 🚨

The devDependency delay was updated from 4.0.1 to 4.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

delay is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v4.1.0
  • Add delay.createWithTimers() method. e589469
  • Fix TypeScript type definition conflict with React Native. 04ef16f

v4.0.1...v4.1.0

Commits

The new version differs by 4 commits.

  • 3217a33 4.1.0
  • 04ef16f Remove dependency on dom.d.ts (#41)
  • e589469 Add delay.createWithTimers() (#42)
  • 34e5009 Rename the TS options interface an export the unexported types

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

F12 shortcut is not working

I try to implement opening of the DevTools on F12 press.
My code (main.js):

const electronLocalshortcut = require('electron-localshortcut');
electronLocalshortcut.register('F12', function() {
    console.log("F12 pressed!")
});

Nothing happened.
Other shortcuts that I tried instead of F12 do work (F11, F3, Ctrl+A and etc.)

Does not respect alternate keyboard layouts?

I'm trying out the Brave browser and I noticed that it doesn't currently register its keyboard shortcuts correctly. I assume they're busy with all sorts of other things and don't have time to help a picky Dvorak user such as me, so I figured I'd help them out. I'm new to electron but familiar with JS & React & webpack, etc.

The issue

I use the Dvorak keyboard layout. When I press cmdshift] to try to switch tabs, Brave-via-electronlocalshortcut looks at the key position rather than the character typed, and instead sends cmdshift+. I zoom in instead of switching tabs.

The code

Here's how they define their shortcuts. Essentially:

const electronLocalshortcut = require('electron-localshortcut')

module.exports.register = win => {
  electronLocalshortcut.register(win, 'CmdOrCtrl+Shift+]', () => {...})
}

What's wrong?

Is there something that they did wrong, or is this an error in electron-localshortcut? Point me in the right direction and I can help fix the issue.

Thanks!

'numadd', `numsub` are not valid accelerators - but they are

I'm using this as a reference: https://electronjs.org/docs/api/accelerator

All of the below hotkeys should work in theory and I have confirmed that esc and numadd function as intended when registering directly with electron

Errors listed below. Thank you very, very much for this awesome library. It patches a weakness in Electron and makes development a lot more pleasant.

WARNING: esc is not a valid accelerator.

    at Array.forEach (<anonymous>)
    at createSecondaryMenu (webpack:///./app/desktop/main/secondaryWindow.js?:148:76)
    at createMainWindow (webpack:///./app/desktop/main/createMainWindow.js?:89:74)


WARNING: numadd is not a valid accelerator.

    at Array.forEach (<anonymous>)
    at createSecondaryMenu (webpack:///./app/desktop/main/secondaryWindow.js?:148:76)
    at createMainWindow (webpack:///./app/desktop/main/createMainWindow.js?:89:74)

17:27:43.999 > Error: Unvalid keycode `u`.
    at reduceKey (webpack:///./node_modules/keyboardevent-from-electron-accelerator/index.js?:186:9)
    at toKeyEvent (webpack:///./node_modules/keyboardevent-from-electron-accelerator/index.js?:274:14)
    at Object.register (webpack:///./node_modules/electron-localshortcut/index.js?:224:21)
    at eval (webpack:///./app/desktop/main/secondaryWindow.js?:150:29)
    at Array.forEach (<anonymous>)
    at createSecondaryMenu (webpack:///./app/desktop/main/secondaryWindow.js?:148:76)
    at createMainWindow (webpack:///./app/desktop/main/createMainWindow.js?:89:74)

WARNING: shift+- is not a valid accelerator.

    at Array.forEach (<anonymous>)
    at createSecondaryMenu (webpack:///./app/desktop/main/secondaryWindow.js?:148:76)
    at createMainWindow (webpack:///./app/desktop/main/createMainWindow.js?:89:74)


WARNING: shift+numadd is not a valid accelerator.

    at Array.forEach (<anonymous>)
    at createSecondaryMenu (webpack:///./app/desktop/main/secondaryWindow.js?:148:76)
    at createMainWindow (webpack:///./app/desktop/main/createMainWindow.js?:89:74)

17:27:44.023 > Error: Unvalid keycode `u`.
    at reduceKey (webpack:///./node_modules/keyboardevent-from-electron-accelerator/index.js?:186:9)
    at toKeyEvent (webpack:///./node_modules/keyboardevent-from-electron-accelerator/index.js?:274:14)
    at Object.register (webpack:///./node_modules/electron-localshortcut/index.js?:224:21)
    at eval (webpack:///./app/desktop/main/secondaryWindow.js?:150:29)
    at Array.forEach (<anonymous>)
    at createSecondaryMenu (webpack:///./app/desktop/main/secondaryWindow.js?:148:76)
    at createMainWindow (webpack:///./app/desktop/main/createMainWindow.js?:89:74)

WARNING: ctrl+- is not a valid accelerator.

    at Array.forEach (<anonymous>)
    at createSecondaryMenu (webpack:///./app/desktop/main/secondaryWindow.js?:148:76)
    at createMainWindow (webpack:///./app/desktop/main/createMainWindow.js?:89:74)


WARNING: ctrl+numadd is not a valid accelerator.

    at Array.forEach (<anonymous>)
    at createSecondaryMenu (webpack:///./app/desktop/main/secondaryWindow.js?:148:76)
    at createMainWindow (webpack:///./app/desktop/main/createMainWindow.js?:89:74)

17:27:44.032 > Error: Unvalid keycode `u`.
    at reduceKey (webpack:///./node_modules/keyboardevent-from-electron-accelerator/index.js?:186:9)
    at toKeyEvent (webpack:///./node_modules/keyboardevent-from-electron-accelerator/index.js?:274:14)
    at Object.register (webpack:///./node_modules/electron-localshortcut/index.js?:224:21)
    at eval (webpack:///./app/desktop/main/secondaryWindow.js?:150:29)
    at Array.forEach (<anonymous>)
    at createSecondaryMenu (webpack:///./app/desktop/main/secondaryWindow.js?:148:76)
    at createMainWindow (webpack:///./app/desktop/main/createMainWindow.js?:89:74)

CommandOrControl+` not working on mac

Using this for the first time. The code below does not work on a mac:

electronLocalshortcut.register( 'CmdOrCtrl+`', () => {
    console.log(12123123);
});

I suspect the issue is somewhere around here:

# index.js -> L129 ...

	const event = _normalizeEvent(input);

	debug(`before-input-event: ${input} is translated to: ${event}`);
	for (const {eventStamp, callback} of shortcutsOfWindow) {
		console.log(equals(eventStamp, event), eventStamp, event);
		**if (equals(eventStamp, event)) {**
			debug(`eventStamp: ${eventStamp} match`);
			callback();

			return;
		}

Console output:

false { metaKey: true, key: '`', code: 'Backquote' } {
  code: 'MetaLeft',
  key: 'Meta',
  altKey: false,
  shiftKey: false,
  metaKey: true,
  ctrlKey: false
}

Shortcuts not unregisted on minify event

Hello,

I was having an issue with the electron application Caprine posted here:
sindresorhus/caprine#202

The issue was that f5 and ctrl+shift+c were not being unregistered when I minimized Caprine to the tray, so I could no longer use f5 to refresh pages in my browser; the key was still bound to Caprine.

If I brought Caprine out of the tray or killed the application, I regained control of the f5 key.

I have been told that the issue is likely with this package not unregistering the shortcuts on a minify event.

Is there something I can do to help confirm/fix this?

An in-range update of p-timeout is breaking the build 🚨

Version 1.1.0 of p-timeout just got published.

Branch Build failing 🚨
Dependency p-timeout
Current Version 1.0.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As p-timeout is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 5 commits0.

  • fd9ac50 1.1.0
  • 1547fe2 Define error name manually so it will work when minified
  • 7d46b45 Allow Infinity timeout
  • e6bed58 Simplify error
  • 3555910 add a related module to the readme

false

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

memory leakage after calling unregisterAll

In the first time of calling register(), the following code line 167-177 register the event for the window

if (win !== ANY_WINDOW) {
    win.on('close', _unregister('the window was closed.'));

    win.on('hide', _unregister('the window was hidden.'));

    win.on('minimize', _unregister('the window was minimized.'));

    win.on('restore', _register('the window was restored from minimized state.'));

    win.on('show', _register('the window was showed.'));
}

However, these registered event are not freed after calling unregisterAll. This will cause memory leakage.

An in-range update of debug is breaking the build 🚨

The dependency debug was updated from 4.0.1 to 4.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

debug is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for 4.1.0

Minor Changes

  • migrate Makefile to npm scripts (4236585)
  • feat: Return namespaces string when invoking disable() (7ef8b41)

Massive thank you to @mblarsen and @outsideris for knocking out two long-awaited changes.

Commits

The new version differs by 3 commits.

  • e30e8fd 4.1.0
  • 7ef8b41 feat: Return namespaces string when invoking disable()
  • 4236585 migrate Makefile to npm scripts

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Not able to unregister shortcuts

I'm not able to use the local shortcuts correctly. On closing window the shortcuts are still registered and throws error. I'm using it like this. @parro-it can you suggest me where I'm going wrong?

An in-range update of p-event is breaking the build 🚨

The devDependency p-event was updated from 2.1.0 to 2.2.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

p-event is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v2.2.0
  • Support waiting for multiple event emissions (#15) b902979
Commits

The new version differs by 6 commits.

  • 14afe41 2.2.0
  • eb0564d Bump dev dependencies
  • 9a1320a Meta tweaks
  • 5578cee Fix readme typo (#17)
  • b902979 Support waiting for multiple event emissions (#15)
  • be3fcbd Document dealing with emitters that can resolve with success (#13)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

3.2.0 Breaks electron-vue

I just setup a new electron-vue project and run into the issue:

Install vue-cli and scaffold boilerplate

npm install -g vue-cli
vue init simulatedgreg/electron-vue my-project

Install dependencies and run your app

cd my-project
npm install
npm run dev

Error

The last command builds the app and the error is produced.

...
 ----------------------------

 Electron -------------------

  App threw an error during load
  C:\Users\blibla\myvueelectron\node_modules\electron-localshortcut\index.js:20
                } catch {
                        ^

  SyntaxError: Unexpected token {
      at createScript (vm.js:80:10)
      at Object.runInThisContext (vm.js:139:10)
      at Module._compile (module.js:606:28)
      at Object.Module._extensions..js (module.js:653:10)
      at Module.load (module.js:561:32)
      at tryModuleLoad (module.js:504:12)
      at Function.Module._load (module.js:496:3)
      at Module.require (module.js:586:17)
      at require (internal/module.js:11:18)
      at eval (webpack:///external_%22electron-localshortcut%22?:1:18)

 ----------------------------

Catch without parameter doesn't seem to be supported by the other tools yet. Not sure if this is your business but wanted to let you know about it.

Workaround

Use 3.1.0

npm install [email protected]
npm run dev

Prevent default event action

I noticed you are using the before-input-event event to listen for shortcuts. Would it be possible to prevent the default action by reading the result from the callback function?

callback();

Exactly in this place and call e.preventDefault() if the result is true.

Allow using `electron-localshortcut` from render process

When I try to require('electron-localshortcut'), I get an error:

Uncaught TypeError: Cannot read property 'on' of undefined

This is because it's grabbing app by a direct require, while it needs to be obtained from remote if in the render process.

ReRegister shortcut works just after tab-out&in

I'm unregister all shortcuts and register them with new callbacks but they are just available after I tab out and back in the window.
So they get unregistered and also registered but arent' useable.

Do you have any idea why or how to solve it?

const shortcut = require('electron-localshortcut');
shortcut.register('CommandOrControl+E', function () {
    screen_edit();
});
shortcut.unregisterAll();
shortcut.register('CommandOrControl+E', function () {
    win.webContents.send('save-img-cfg');
    screen_show();
});

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

On azerty keyboard, "w" is triggered by both "w" and "z"

Hi,
With an azerty keyboard, the input object can looks like this:

{
  type: 'keyDown',
  key: 'w',
  code: 'KeyZ',
  // ...
}
// or 
{
  type: 'keyDown',
  key: 'z',
  code: 'KeyW',
  // ...
}

The input comparison fails to differentiate these cases. It does not occur with electron global shortcuts.

LocalShortcut in renderer.js

Can I use electron-localshortcut in renderer.js (which is not main file) ???
And if yes, then how ??
I know about remote api of electron but it doesn't work ?

Thanks in advance .

An in-range update of electron is breaking the build 🚨

The devDependency electron was updated from 3.0.0 to 3.0.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

electron is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for electron v3.0.1

Bug Fixes/Changes

  • chore: fix await in cleanup script (backport: 3-0-x). #14696

  • docs: specify BrowserWindow features passable to window.open. #14702

  • Fix second-instance handler signature. #14748

  • fix: do not set layer explicitly for frameless window. #14736

  • fix: actually return appmetrics. #14750

  • fix: initialize tracing controller before starting platform (3-0-x). #14503

  • docs: clarify allowable background colors for BrowserWindow transparency (backport: 3-0-x). #14781

  • fix: inconsistent titleBarStyle on transparent fullscreen. #14790

  • chore: bump libcc (3-0-x). #14809

  • fix: get background color from GtkMenuBar#menubar. #14812

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Uncaught Exception: TypeError: str.split is not a function

I just installed and configured as instructed and I get this error when I launch electron.

This a new project, started with create-react-app and then adding electron, the standard main.js file from electron-quick-start, and the few necessary changes to package.json. I also added a .env file with BROWSER=none and a different port and I'm using concurrently and wait-on to start react in the electron window.

Could one of these things be interfering?

An in-range update of electron is breaking the build 🚨

Version 1.6.8 of electron just got published.

Branch Build failing 🚨
Dependency electron
Current Version 1.7.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As electron is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes electron v1.6.8 beta

1.6.8 Release Notes

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

DOM shortcuts implementation

I started to implement a DOM based version of electron-localshortcut, in an effort to make it less error prone and less "aggressive".

Many issues of this module was caused by the fact that it uses globalShortcut method to register shortcuts. These interferes with the other system shortcuts, often in an obstrusive way...

The new version will instead listen for DOM keydown and keyup events, and will trigger shortcut handlers if emitted DOM events match the registered Accelerator.

Today I published keyboardevent-from-electron-accelerator, a module that take an Accelerator and convert it to a derived Keyboard event.

The new version of electron-localshortcut will use it to check if an emitted keyvoard event match a registered shortcuts.

It would be beautiful if anyone interested would check the module on runkit to help catch bugs before use the module as dependency here.

Accelerator stopped working in v3

This used to work in v2, but stopped working in v3:

localShortcut.register('Cmd+Alt+I', () => {
  console.log('Works');
});

Other accelerators like `'Cmd+Shift+C'` work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.