This repository has been archived on 2026-11-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
desktop/preload.js
T
2026-10-25 15:32:00 +08:00

15 lines
508 B
JavaScript

const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('desktopBridge', {
isDesktop: true,
notify(payload) {
if (!payload || typeof payload !== 'object') return
ipcRenderer.send('desktop:notify', {
title: typeof payload.title === 'string' ? payload.title : '',
body: typeof payload.body === 'string' ? payload.body : '',
conversationId:
typeof payload.conversationId === 'string' ? payload.conversationId : undefined,
})
},
})