@@ -29,7 +29,8 @@ enum Permissions {
29
29
const PERMISSIONS_NAMESPACE = 'Permissions' ;
30
30
31
31
const saveWindowSettings = async ( ) : Promise < void > => {
32
- const browserWindow = BrowserWindow . getFocusedWindow ( ) as ICustomBrowserWindow ;
32
+ const browserWindow =
33
+ BrowserWindow . getFocusedWindow ( ) as ICustomBrowserWindow ;
33
34
const mainWebContents = windowHandler . getMainWebContents ( ) ;
34
35
35
36
if ( browserWindow && windowExists ( browserWindow ) ) {
@@ -86,7 +87,8 @@ const saveWindowSettings = async (): Promise<void> => {
86
87
} ;
87
88
88
89
const windowMaximized = async ( ) : Promise < void > => {
89
- const browserWindow = BrowserWindow . getFocusedWindow ( ) as ICustomBrowserWindow ;
90
+ const browserWindow =
91
+ BrowserWindow . getFocusedWindow ( ) as ICustomBrowserWindow ;
90
92
if ( browserWindow && windowExists ( browserWindow ) ) {
91
93
const isMaximized = browserWindow . isMaximized ( ) ;
92
94
const isFullScreen = browserWindow . isFullScreen ( ) ;
@@ -216,7 +218,8 @@ export const updateAlwaysOnTop = async (
216
218
logger . info (
217
219
`window-actions: Should we set always on top? ${ shouldSetAlwaysOnTop } !` ,
218
220
) ;
219
- const browserWins : ICustomBrowserWindow [ ] = BrowserWindow . getAllWindows ( ) as ICustomBrowserWindow [ ] ;
221
+ const browserWins : ICustomBrowserWindow [ ] =
222
+ BrowserWindow . getAllWindows ( ) as ICustomBrowserWindow [ ] ;
220
223
if ( shouldUpdateUserConfig ) {
221
224
await config . updateUserConfig ( {
222
225
alwaysOnTop : shouldSetAlwaysOnTop
@@ -264,7 +267,8 @@ export const handleKeyPress = (key: number): void => {
264
267
if ( isMac || isLinux ) {
265
268
return ;
266
269
}
267
- const browserWin = BrowserWindow . getFocusedWindow ( ) as ICustomBrowserWindow ;
270
+ const browserWin =
271
+ BrowserWindow . getFocusedWindow ( ) as ICustomBrowserWindow ;
268
272
if (
269
273
browserWin &&
270
274
windowExists ( browserWin ) &&
@@ -476,6 +480,11 @@ export const handlePermissionRequests = (webContents: WebContents): void => {
476
480
return ;
477
481
}
478
482
483
+ const allowedPermissions = new Set ( [
484
+ 'clipboard-read' ,
485
+ 'clipboard-sanitized-write' ,
486
+ ] ) ;
487
+
479
488
session . setPermissionRequestHandler (
480
489
( _webContents , permission , callback , details ) => {
481
490
switch ( permission ) {
@@ -550,7 +559,7 @@ export const handlePermissionRequests = (webContents: WebContents): void => {
550
559
callback ,
551
560
) ;
552
561
default :
553
- return callback ( false ) ;
562
+ return callback ( allowedPermissions . has ( permission ) ) ;
554
563
}
555
564
} ,
556
565
) ;
0 commit comments