Skip to content

Commit 221689f

Browse files
committed
feat(electron): grant microphone and clipboard permissions
Add permission handler for media (microphone) and clipboard-read access. Add audio-input entitlement for macOS builds.
1 parent bc8a127 commit 221689f

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

build/entitlements.mac.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@
88
<true/>
99
<key>com.apple.security.cs.disable-library-validation</key>
1010
<true/>
11+
<key>com.apple.security.device.audio-input</key>
12+
<true/>
1113
</dict>
1214
</plist>

electron/main.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { app, BrowserWindow, shell } from 'electron';
1+
import { app, BrowserWindow, session, shell } from 'electron';
22
import path from 'path';
33
import fs from 'fs';
44
import { fileURLToPath } from 'url';
@@ -138,7 +138,14 @@ function createWindow() {
138138
});
139139
}
140140

141-
app.whenReady().then(createWindow);
141+
app.whenReady().then(() => {
142+
// Grant microphone and clipboard access
143+
session.defaultSession.setPermissionRequestHandler((_webContents, permission, callback) => {
144+
callback(permission === 'media' || permission === 'clipboard-read');
145+
});
146+
147+
createWindow();
148+
});
142149

143150
app.on('before-quit', () => {
144151
killAllAgents();

0 commit comments

Comments
 (0)