diff --git a/src/main/app/initialize.ts b/src/main/app/initialize.ts index 8a912c59..f1031a72 100644 --- a/src/main/app/initialize.ts +++ b/src/main/app/initialize.ts @@ -380,12 +380,15 @@ function initializeAfterAppReady() { 'notifications', 'fullscreen', 'openExternal', + 'clipboard-sanitized-write', ]; // handle permission requests // - approve if a supported permission type and the request comes from the renderer or one of the defined servers defaultSession.setPermissionRequestHandler((webContents, permission, callback) => { - // is the requested permission type supported? + log.debug('permission requested', webContents.getURL(), permission); + + // is the requested permission type supported? if (!supportedPermissionTypes.includes(permission)) { callback(false); return; @@ -398,6 +401,18 @@ function initializeAfterAppReady() { return; } + const callsWidgetWindow = WindowManager.callsWidgetWindow; + if (callsWidgetWindow) { + if (webContents.id === callsWidgetWindow.win.webContents.id) { + callback(true); + return; + } + if (callsWidgetWindow.popOut && webContents.id === callsWidgetWindow.popOut.webContents.id) { + callback(true); + return; + } + } + const requestingURL = webContents.getURL(); const serverURL = WindowManager.getServerURLFromWebContentsId(webContents.id); diff --git a/src/main/windows/callsWidgetWindow.ts b/src/main/windows/callsWidgetWindow.ts index 48492ad1..6da8e1ab 100644 --- a/src/main/windows/callsWidgetWindow.ts +++ b/src/main/windows/callsWidgetWindow.ts @@ -39,7 +39,7 @@ type LoadURLOpts = { export default class CallsWidgetWindow extends EventEmitter { public win: BrowserWindow; private main: BrowserWindow; - private popOut: BrowserWindow | null = null; + public popOut: BrowserWindow | null = null; private mainView: MattermostView; private config: CallsWidgetWindowConfig; private boundsErr: Rectangle = {