feat(electron): add a new crash report HTML page for displaying error details and logs

This commit is contained in:
2026-01-03 15:45:05 -06:00
parent b59c21f483
commit 46f2700770
7 changed files with 20341 additions and 83 deletions

View File

@@ -9,6 +9,21 @@ contextBridge.exposeInMainWorld("electron", {
return await ipcRenderer.invoke("app-version");
},
// allow fetching electron version
electronVersion: function () {
return process.versions.electron;
},
// allow fetching chrome version
chromeVersion: function () {
return process.versions.chrome;
},
// allow fetching node version
nodeVersion: function () {
return process.versions.node;
},
// show an alert dialog in electron browser window, this fixes a bug where alert breaks input fields on windows
alert: async function (message) {
return await ipcRenderer.invoke("alert", message);
@@ -29,8 +44,43 @@ contextBridge.exposeInMainWorld("electron", {
return await ipcRenderer.invoke("relaunch");
},
// allow relaunching app in emergency mode
relaunchEmergency: async function () {
return await ipcRenderer.invoke("relaunch-emergency");
},
// allow shutting down app in electron browser window
shutdown: async function () {
return await ipcRenderer.invoke("shutdown");
},
// allow getting memory usage in electron browser window
getMemoryUsage: async function () {
return await ipcRenderer.invoke("get-memory-usage");
},
// allow showing a file path in os file manager
showPathInFolder: async function (path) {
return await ipcRenderer.invoke("showPathInFolder", path);
},
// allow checking hardware acceleration status
isHardwareAccelerationEnabled: async function () {
return await ipcRenderer.invoke("is-hardware-acceleration-enabled");
},
// allow checking integrity status
getIntegrityStatus: async function () {
return await ipcRenderer.invoke("get-integrity-status");
},
// allow showing a native notification
showNotification: function (title, body, silent = false) {
ipcRenderer.invoke("show-notification", { title, body, silent });
},
// allow controlling power save blocker
setPowerSaveBlocker: async function (enabled) {
return await ipcRenderer.invoke("set-power-save-blocker", enabled);
},
// listen for protocol links
onProtocolLink: function (callback) {
ipcRenderer.on("open-protocol-link", (event, url) => callback(url));
},
});