mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 06:51:53 +01:00
debt - reduce usage of electron remote module
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const remote = require('electron').remote;
|
||||
const ipc = require('electron').ipcRenderer;
|
||||
|
||||
function assign(destination, source) {
|
||||
return Object.keys(source)
|
||||
@@ -141,9 +141,9 @@ function main() {
|
||||
window.addEventListener('keydown', function (e) {
|
||||
const key = extractKey(e);
|
||||
if (key === TOGGLE_DEV_TOOLS_KB) {
|
||||
remote.getCurrentWebContents().toggleDevTools();
|
||||
ipc.send('vscode:toggleDevTools');
|
||||
} else if (key === RELOAD_KB) {
|
||||
remote.getCurrentWindow().reload();
|
||||
ipc.send('vscode:reloadWindow');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ export function startup(data: ProcessExplorerData): void {
|
||||
applyZoom(data.zoomLevel);
|
||||
|
||||
// Map window process pids to titles, annotate process names with this when rendering to distinguish between them
|
||||
ipcRenderer.on('windowsInfoResponse', (event, windows) => {
|
||||
ipcRenderer.on('vscode:windowsInfoResponse', (event, windows) => {
|
||||
mapPidToWindowTitle = new Map<number, string>();
|
||||
windows.forEach(window => mapPidToWindowTitle.set(window.pid, window.title));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user