[MM-33828] Define CSP for all BrowserWindows, enable contextIsolation for main/settings window, other fixes (#1517)
* [MM-33828] Added CSP to renderer process pages and turned off remote module when not needed * Turn on contextIsolation and turn off nodeIntegration for main and settings windows * Check for details.reason instead of object
This commit is contained in:
@@ -43,7 +43,7 @@ export class MattermostView extends EventEmitter {
|
||||
`version=${app.version}`,
|
||||
`appName=${app.name}`,
|
||||
],
|
||||
enableRemoteModule: true,
|
||||
enableRemoteModule: process.env.NODE_ENV === 'test',
|
||||
nodeIntegration: process.env.NODE_ENV === 'test',
|
||||
},
|
||||
...options,
|
||||
|
@@ -242,8 +242,8 @@ export const addWebContentsEventListeners = (mmview, getServersFunction) => {
|
||||
|
||||
listeners[contents.id] = removeListeners;
|
||||
contents.once('render-process-gone', (event, details) => {
|
||||
if (details !== 'clean-exit') {
|
||||
log.error(`Renderer process for a webcontent is no longer available: ${details}`);
|
||||
if (details.reason !== 'clean-exit') {
|
||||
log.error('Renderer process for a webcontent is no longer available:', details.reason);
|
||||
}
|
||||
removeListeners();
|
||||
});
|
||||
|
Reference in New Issue
Block a user