-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathdebug-settings.js
54 lines (46 loc) · 1.25 KB
/
debug-settings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Debug script to check what settings are being loaded
const { app, BrowserWindow } = require('electron');
const Store = require('electron-store');
const path = require('path');
// Create a window to capture console logs
let win;
function createWindow() {
win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true,
contextIsolation: false
}
});
win.loadFile('debug.html');
win.webContents.openDevTools();
}
app.whenReady().then(() => {
createWindow();
// Create debug.html
const fs = require('fs');
fs.writeFileSync(path.join(__dirname, 'debug.html'), `
<!DOCTYPE html>
<html>
<head>
<title>Settings Debug</title>
</head>
<body>
<h1>Settings Debug</h1>
<div id="output"></div>
<script>
document.getElementById('output').innerText = 'Loading settings...';
</script>
</body>
</html>
`);
// Check settings
const settingsStore = new Store({ name: 'settings' });
const settings = settingsStore.store;
win.webContents.executeJavaScript(`
const output = document.getElementById('output');
output.innerHTML = '<pre>' + JSON.stringify(${JSON.stringify(settings)}, null, 2) + '</pre>';
`);
console.log('Settings loaded:', settings);
});