Skip to content

Commit

Permalink
Use electron-context-menu for toggle devtools by right-click
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Jun 15, 2016
1 parent 6f175a6 commit 3a6c5c5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions electron/main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
const { app, BrowserWindow, Menu, shell } = require('electron');
const contextMenu = require('electron-context-menu');
const url = require('url');
const qs = require('querystring');

let menu;
let template;
let mainWindow = null;

contextMenu({
prepend: () => [{
label: 'Toggle React DevTools',
click() {
mainWindow.webContents.send('toggle-devtools', 'react');
},
}, {
label: 'Toggle Redux DevTools',
click() {
mainWindow.webContents.send('toggle-devtools', 'redux');
},
}],
});

app.on('window-all-closed', () => {
app.quit();
});
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"worker-loader": "^0.7.0"
},
"dependencies": {
"electron-context-menu": "^0.1.2",
"jsan": "^3.1.2",
"react": "^0.14.8",
"react-addons-create-fragment": "^0.14.8",
Expand Down

0 comments on commit 3a6c5c5

Please sign in to comment.