-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates electron and associated dependencies to the latest #2102
Merged
Merged
Changes from 16 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1ad109a
Update electron
belcherj 85126d8
Complete updating electron
belcherj f455999
Delete unused code
belcherj fc7804c
Remove icon in BrowserWidow as it is uneeded
belcherj e00df89
Update dependencies
belcherj 87e0c75
Add --no-sandbox arg to linux
belcherj c8e0694
Use an array
belcherj 5f08687
Remove icons folder
belcherj 8e053e7
Turn off node integration
belcherj 0e8f972
Add unhandled to determine why Electron is failing on Linux
belcherj 8732b0f
Try asar false
belcherj fb6a985
Fix up config to get app running without no sandbox flag
belcherj e9ffd52
Make menus work
belcherj 0abb00e
Fix isMac detection
belcherj 2ef2f90
Cleanup
belcherj 22f0aae
Get insert checklist working
belcherj e12a573
Add types and remove ipc require
belcherj 0141274
Make electron reload on log out
belcherj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,21 @@ | ||
require('./context-menu'); | ||
belcherj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const { contextBridge, ipcRenderer } = require('electron'); | ||
|
||
contextBridge.exposeInMainWorld('electron', { | ||
send: (channel, data) => { | ||
// whitelist channels | ||
let validChannels = ['appCommand', 'setAutoHideMenuBar', 'settingsUpdate']; | ||
if (validChannels.includes(channel)) { | ||
ipcRenderer.send(channel, data); | ||
} | ||
}, | ||
receive: (channel, func) => { | ||
let validChannels = ['appCommand']; | ||
if (validChannels.includes(channel)) { | ||
// Deliberately strip event as it includes `sender` | ||
ipcRenderer.on(channel, (event, ...args) => { | ||
return func(...args); | ||
}); | ||
} | ||
}, | ||
isMac: process.platform === 'darwin', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
'use strict'; | ||
|
||
/** | ||
* External dependencies | ||
*/ | ||
const { Menu, MenuItem } = require('electron'); | ||
|
||
module.exports = function (mainWindow) { | ||
mainWindow.webContents.on('context-menu', (event, params) => { | ||
const menu = new Menu(); | ||
|
||
const copy = new MenuItem({ label: 'Copy', role: 'copy' }); | ||
|
||
if (!params.isEditable) { | ||
// If text is not editable, only permit the `Copy` action | ||
menu.append(copy); | ||
} else { | ||
// Add each spelling suggestion | ||
for (const suggestion of params.dictionarySuggestions) { | ||
menu.append( | ||
new MenuItem({ | ||
label: suggestion, | ||
click: () => mainWindow.webContents.replaceMisspelling(suggestion), | ||
}) | ||
); | ||
} | ||
|
||
// Allow users to add the misspelled word to the dictionary | ||
if (params.misspelledWord) { | ||
menu.append(new MenuItem({ type: 'separator' })); | ||
menu.append( | ||
new MenuItem({ | ||
label: 'Add to Dictionary', | ||
click: () => | ||
mainWindow.webContents.session.addWordToSpellCheckerDictionary( | ||
params.misspelledWord | ||
), | ||
}) | ||
); | ||
} | ||
|
||
// If text is editable, permit the Select All, Cut, Copy and Paste actions | ||
const cut = new MenuItem({ label: 'Cut', role: 'cut' }); | ||
const paste = new MenuItem({ label: 'Paste', role: 'paste' }); | ||
const selectAll = new MenuItem({ | ||
label: 'Select All', | ||
role: 'selectAll', | ||
}); | ||
|
||
const menuItems = [selectAll, cut, copy, paste]; | ||
|
||
if (params?.dictionarySuggestions?.length > 0) { | ||
menu.append(new MenuItem({ type: 'separator' })); | ||
} | ||
|
||
for (const item of menuItems) { | ||
menu.append(item); | ||
} | ||
} | ||
|
||
menu.popup(); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean this icon is now unused, or is it being loaded somewhere else? I would like to remove it if possible (see #2158)