mirror of
https://github.com/mileswolfallen2/gelectron.git
synced 2026-12-03 23:53:26 +00:00
feat: add macOS application menu and icon support, enhance permissions for microphone and camera
This commit is contained in:
1 parent
075a051f74
commit
bbdcbd1e7f
6 files changed
+542
-28
No files matched your search
@@ -12,6 +12,7 @@
|
||||
|
||||
const { EventEmitter } = require('events');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const { bridge } = require('./native-bridge');
|
||||
const NativeImage = require('./native-image');
|
||||
|
||||
@@ -46,6 +47,17 @@ class App extends EventEmitter {
|
||||
};
|
||||
|
||||
this._commandLine = new Map();
|
||||
|
||||
// Real Electron creates these dirs at startup; mirror that so apps can
|
||||
// chdir/write into userData immediately.
|
||||
for (const p of [this._paths.userData, this._paths.crashDumps, this._paths.logs]) {
|
||||
try {
|
||||
fs.mkdirSync(p, { recursive: true });
|
||||
} catch (e) {
|
||||
// Non-fatal: some paths may not be creatable in odd environments
|
||||
}
|
||||
}
|
||||
|
||||
this._dock = process.platform === 'darwin' ? {
|
||||
setIcon: (icon) => {
|
||||
const b64 = this._iconToBase64Png(icon);
|
||||
|
||||
Reference in new issue
Block a user