Fix context menu doesn't work when multiple windows are open (#135)

This commit is contained in:
Quang Lam 2020-02-15 14:26:37 -06:00 committed by GitHub
parent 10cffc8e05
commit 58c904fe01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 39 additions and 8 deletions

View file

@ -3,3 +3,10 @@ const path = require('path');
window.mode = 'about';
window.iconPath = path.join(__dirname, '..', 'icon.png');
const { remote } = require('electron');
const contextMenu = require('electron-context-menu');
contextMenu({
window: remote.getCurrentWindow(),
});

View file

@ -1,5 +1,8 @@
window.mode = 'add-workspace';
const { remote } = require('electron');
const contextMenu = require('electron-context-menu');
contextMenu();
contextMenu({
window: remote.getCurrentWindow(),
});

View file

@ -1,5 +1,8 @@
window.mode = 'code-injection';
const { remote } = require('electron');
const contextMenu = require('electron-context-menu');
contextMenu();
contextMenu({
window: remote.getCurrentWindow(),
});

View file

@ -1,5 +1,8 @@
window.mode = 'custom-user-agent';
const { remote } = require('electron');
const contextMenu = require('electron-context-menu');
contextMenu();
contextMenu({
window: remote.getCurrentWindow(),
});

View file

@ -1,5 +1,8 @@
window.mode = 'edit-workspace';
const { remote } = require('electron');
const contextMenu = require('electron-context-menu');
contextMenu();
contextMenu({
window: remote.getCurrentWindow(),
});

View file

@ -1,5 +1,8 @@
window.mode = 'go-to-url';
const { remote } = require('electron');
const contextMenu = require('electron-context-menu');
contextMenu();
contextMenu({
window: remote.getCurrentWindow(),
});

View file

@ -1,5 +1,8 @@
window.mode = 'license-registration';
const { remote } = require('electron');
const contextMenu = require('electron-context-menu');
contextMenu();
contextMenu({
window: remote.getCurrentWindow(),
});

View file

@ -1,5 +1,8 @@
window.mode = 'main';
const { remote } = require('electron');
const contextMenu = require('electron-context-menu');
contextMenu();
contextMenu({
window: remote.getCurrentWindow(),
});

View file

@ -1,5 +1,8 @@
window.mode = 'menubar';
const { remote } = require('electron');
const contextMenu = require('electron-context-menu');
contextMenu();
contextMenu({
window: remote.getCurrentWindow(),
});