mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
fix(desktop): verify privileged ipc senders (#2360)
This commit is contained in:
1 parent
de2ea99928
commit
a53f5d1289
6 files changed
+56
-9
No files matched your search
@@ -7,6 +7,7 @@ import type {NotificationOptions} from '@electron/common/Types';
|
||||
import {getNativeNotificationsMode} from '@electron/main/LaunchOptions';
|
||||
import {resolveNotificationIcon} from '@electron/main/NotificationIcon';
|
||||
import {shouldPlayNotificationSound} from '@electron/main/NotificationState';
|
||||
import {requirePrivilegedRendererDocumentSender} from '@electron/main/PrivilegedRendererDocuments';
|
||||
import {type BrowserWindow, ipcMain, Notification, nativeImage} from 'electron';
|
||||
|
||||
const logger = createChildLogger('Notifications');
|
||||
@@ -319,11 +320,12 @@ export function registerNotificationIpcHandlers(getMainWindow: () => BrowserWind
|
||||
ipcMain.handle(
|
||||
'show-notification',
|
||||
async (
|
||||
_event,
|
||||
event,
|
||||
options: NotificationOptions,
|
||||
): Promise<{
|
||||
id: string;
|
||||
}> => {
|
||||
requirePrivilegedRendererDocumentSender(event, 'show-notification');
|
||||
const id = getNotificationId(options);
|
||||
if (process.platform === 'linux') {
|
||||
await showLinuxNativeNotification(id, options, getMainWindow);
|
||||
|
||||
Reference in new issue
Block a user